Chat Completions
POST https://api.zonetoken.net/v1/chat/completionsGenerate a model response for a conversation. This endpoint is compatible with the OpenAI Chat Completions API.
Authentication
Authorization: Bearer <apiKey>Request body
| Field | Type | Description |
|---|---|---|
model | string | The model id, e.g. gpt-5.5. |
messages | array | The conversation so far, as { role, content } objects. |
temperature | number | Optional. Sampling temperature (0–2). |
stream | boolean | Optional. Stream tokens as server-sent events. |
Request
bash
curl https://api.zonetoken.net/v1/chat/completions \
-H "Authorization: Bearer $ZONETOKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Explain what ZoneToken is in one sentence." }
],
"temperature": 0.7
}'json
{
"model": "gpt-5.5",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Explain what ZoneToken is in one sentence." }
],
"temperature": 0.7
}Response
json
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1730000000,
"model": "gpt-5.5",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "ZoneToken is an OpenAI-compatible API gateway you can use with your existing tools and SDKs."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 24,
"completion_tokens": 19,
"total_tokens": 43
}
}