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": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{}
],
"usage": {}
}Endpunkte
Chat completions
Erstellen Sie OpenAI-kompatible Chat Completions mit Capriole AI Modellen.
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": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{}
],
"usage": {}
}Verwenden Sie diesen Endpunkt, wenn Ihre Anwendung, Ihr SDK oder Ihr Gateway das Anfrage- und Antwortformat von OpenAI Chat Completions erwartet.
Senden Sie eine Standard-Chat Completions-Nutzlast mit
model und messages. Capriole AI löst Latest-Aliase vor der Upstream-Weiterleitung zur ausgewählten Anbietermodell-ID auf, leitet kompatible Felder wie messages, tools, tool_choice, response_format und stream weiter und gibt den Upstream-JSON- oder SSE-Stream unverändert zurück, mit Ausnahme der unten beschriebenen GLM-SSE-Korrektur. Bei Streaming-Anfragen setzt Capriole AI vor der Weiterleitung stream_options.include_usage=true, damit die Nutzung erfasst werden kann.
Bei SSE-Antworten des konfigurierten Tian-, RelayRouter- oder VE-Gateways mit model="zai/glm-5.3-flash" entfernt Capriole AI nur das leere Legacy-Feld function_call={"name":"","arguments":""} aus den Deltas. Echte oder teilweise übertragene Funktionsaufrufe, tool_calls, Text und Nutzungsdaten bleiben erhalten. Diese Ausnahme betrifft weder nicht gestreamte Antworten noch andere Modelle.
POST /v1/chat/completions akzeptiert openai-latest, claude-latest, google-latest und öffentliche konkrete Modell-IDs aus GET /v1/models. Verwenden Sie einen Latest-Alias, damit Capriole AI das von uns empfohlene Flaggschiff-Modell für diesen Anbieter wählt.
Latest-Aliase sind Eingabe-Kurzformen. Die Nutzung wird für das aufgelöste Modell erfasst, während der Antwortkörper das Modellbenennungsverhalten des gewählten kompatiblen Endpunkts beibehält.
Für Capriole-native Textgenerierung verwenden Sie POST /v1/chat. Verwenden Sie POST /v1/chat/completions, wenn OpenAI-kompatibles Wire-Verhalten erforderlich ist.Autorisierungen
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
Verfügbare Optionen:
openai-latest, openai/gpt-6-astra, openai/gpt-5.6-terra, openai/gpt-5.6-luna, openai/gpt-5.5, openai/gpt-5.4-mini, claude-latest, anthropic/claude-fable-5-1, 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-3.1-pro-preview, google/gemini-3.8-flash, 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.
Antwort
OpenAI-compatible Chat Completions response or SSE stream. Response model fields follow the selected compatible endpoint and may differ from the input alias.
Zuletzt geändert am 8. September 2026