API reference / Chat
Chat completions
OpenAI-compatible chat completion endpoint. Use a model id returned by GET /v1/models.
POST
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.
| Field | Required | Notes |
|---|---|---|
| model | yes | Public model id from /v1/models. |
| messages | yes | OpenAI-compatible conversation messages. |
| stream | no | Enable SSE when true. |
| tools / response_format | model-dependent | Only send fields supported by the selected model. |