Response Example
Example success, streaming, and error responses returned by the gateway.
Success response
For non-streaming requests, responses follow the OpenAI chat completion shape when the upstream provider returns compatible data.
{
"id": "chatcmpl_123",
"object": "chat.completion",
"created": 1778899200,
"model": "zunova-m1",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! How can I help?"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 8,
"total_tokens": 20
}
}Streaming response
Streaming requests return text/event-stream frames. Consume them incrementally and stop when the stream sends [DONE].
data: {"id":"chatcmpl_123","choices":[{"delta":{"content":"Hello"}}]}
data: {"id":"chatcmpl_123","choices":[{"delta":{"content":"!"}}]}
data: [DONE]Error response
Error responses include a machine-readable code, a human-readable message, and a request_id you can use when checking logs or contacting support.
{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API key.",
"request_id": "req_123"
}
}Common error codes
| Code | Meaning |
|---|---|
unauthorized | Missing or invalid credentials. |
invalid_request | Malformed request body, unsupported model, or request too large. |
quota_exceeded | Daily quota or rate limit reached. |
upstream_error | Provider returned an error or the gateway could not fetch upstream. |
upstream_timeout | Provider did not respond within the configured timeout. |
stream_error | Streaming connection failed before completion. |
Debugging checklist
- Copy
request_idfrom the error response. - Open Dashboard → Requests and search by
request_id. - Check status code, model, endpoint, latency, and error code.
- Verify the API key is active and attached to the expected account.
- Retry with a minimal request body to isolate prompt or payload issues.