APIKO
API reference / Chat

Chat completions

OpenAI-compatible chat completion endpoint. Use a model id returned by GET /v1/models.

POST
/
v1
/
chat
/
completions
bashcopy from the code panel
curl https://api.apiko.app/v1/chat/completions \
  -H "Authorization: Bearer $APIKO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL_FROM_/v1/models",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
  • Set stream to true for SSE streaming; read usage from the final stream event when enabled by the client.
  • Keep the API key server-side and use the exact public model id returned for that key.
  • Use Images for image generation; Chat is not a media task endpoint.
FieldRequiredNotes
modelyesPublic model id from /v1/models.
messagesyesOpenAI-compatible conversation messages.
streamnoEnable SSE when true.
tools / response_formatmodel-dependentOnly send fields supported by the selected model.