Docs / API reference

Chat completions

POST /chat/completions — the primary endpoint for conversational models.

Request

Accepts the standard parameters (messages, max_tokens, temperature, top_p, stop, tools, response_format, stream) plus gateway extensions: models (fallback list) and provider (routing preferences).

cURL
curl https://api.jackz.ai/v1/chat/completions \
  -H "Authorization: Bearer $JACKZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-5",
    "messages": [{"role": "user", "content": "Hello"}],
    "max_tokens": 512,
    "temperature": 0.7,
    "stream": false
  }'

Response

The model field reports the model that actually served the request when fallbacks are in play.

JSON
{
  "id": "gen-...",
  "model": "anthropic/claude-sonnet-5",
  "choices": [{
    "index": 0,
    "message": {"role": "assistant", "content": "Hello! How can I help?"},
    "finish_reason": "stop"
  }],
  "usage": {"prompt_tokens": 8, "completion_tokens": 6, "total_tokens": 14}
}