curl --request POST \
--url https://api.caprioletech.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai-latest",
"messages": [
{
"role": "user",
"content": "Hello World!"
}
]
}
'{
"id": "chatcmpl_123",
"object": "chat.completion",
"created": 1764547200,
"model": "gpt-5.5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 8,
"total_tokens": 20
}
}Endpoints
Chat completions
Create OpenAI-compatible chat completions with Capriole AI models.
POST
/
v1
/
chat
/
completions
curl --request POST \
--url https://api.caprioletech.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "openai-latest",
"messages": [
{
"role": "user",
"content": "Hello World!"
}
]
}
'{
"id": "chatcmpl_123",
"object": "chat.completion",
"created": 1764547200,
"model": "gpt-5.5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 8,
"total_tokens": 20
}
}Use this endpoint when your application, SDK, or gateway expects the OpenAI Chat Completions request and response format.
Send a standard Chat Completions payload with
model and messages. Capriole AI resolves latest aliases to the selected provider model ID before upstream dispatch, forwards compatible fields such as messages, tools, tool_choice, response_format, and stream, and returns the upstream JSON or SSE stream unchanged, except for the GLM SSE correction below. For streaming requests, Capriole AI sets stream_options.include_usage=true before forwarding so usage can be recorded.
For SSE responses from the configured Tian, RelayRouter, or VE gateway with model="zai/glm-5.3-flash", Capriole AI removes only the empty legacy function_call={"name":"","arguments":""} field from streamed deltas. Real or partial function calls, tool_calls, text, and usage remain intact. This exception does not change non-streaming responses or other models.
POST /v1/chat/completions accepts openai-latest, claude-latest, google-latest, and public concrete model IDs returned by GET /v1/models. Use a latest alias to let Capriole AI choose our recommended flagship model for that provider.
Latest aliases are input shortcuts. Usage is recorded against the resolved model, while the response body keeps the model naming behavior of the selected compatible endpoint.
For Capriole-native text generation, use POST /v1/chat. Use POST /v1/chat/completions when OpenAI-compatible wire behavior is required.Authorizations
Use an API key created in the Capriole AI page. Send it as Authorization: Bearer sk-....
Body
application/json
Public model identifier or latest alias returned by GET /v1/models
Available options:
openai-latest, openai/gpt-6-astra, openai/gpt-6.1-sol, openai/gpt-6-sol, openai/gpt-6-luna, openai/gpt-5.6-terra, openai/gpt-5.6-luna, openai/gpt-5.5, claude-latest, anthropic/claude-fable-5-1, anthropic/claude-opus-5-5, anthropic/claude-fable-5, anthropic/claude-opus-5, anthropic/claude-opus-4-8, anthropic/claude-opus-4-7, anthropic/claude-opus-4-6, anthropic/claude-sonnet-4-6, google-latest, google/gemini-4-argon, google/gemini-3.1-pro-preview, google/gemini-3.8-flash, xai/grok-4.7, xai/grok-4.6, xai/grok-4.5, zai/glm-5.3-flash, zai/glm-5.2, moonshot/kimi-k3 OpenAI-compatible conversation messages.
Show child attributes
Show child attributes
OpenAI-compatible tool definitions.
OpenAI-compatible tool choice.
OpenAI-compatible response format.
Stream the response as OpenAI-compatible server-sent events.
OpenAI-compatible stream options. For streaming requests, Capriole AI sets include_usage=true before upstream dispatch for usage accounting.
Response
OpenAI-compatible Chat Completions response or SSE stream. Response model fields follow the selected compatible endpoint and may differ from the input alias.
Last modified on September 8, 2026