AI Gateway Docs
API Reference

Chat Completions

POST /v1/chat/completions — OpenAI-compatible chat completion endpoint

POST /v1/chat/completions
Authorization: Bearer $BRAND_API_KEY
Content-Type: application/json

Request fields

FieldTypeRequiredDescription
modelstringYesModel ID, e.g. gpt-4o-mini
messagesarrayYesConversation history
streambooleanNoEnable SSE streaming
temperaturenumberNoSampling temperature, 0–2

Example

curl https://api.example.com/v1/chat/completions \
  -H "Authorization: Bearer $BRAND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

On this page