Skip to main content
Zunova

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

CodeMeaning
unauthorizedMissing or invalid credentials.
invalid_requestMalformed request body, unsupported model, or request too large.
quota_exceededDaily quota or rate limit reached.
upstream_errorProvider returned an error or the gateway could not fetch upstream.
upstream_timeoutProvider did not respond within the configured timeout.
stream_errorStreaming connection failed before completion.

Debugging checklist

  1. Copy request_id from the error response.
  2. Open Dashboard → Requests and search by request_id.
  3. Check status code, model, endpoint, latency, and error code.
  4. Verify the API key is active and attached to the expected account.
  5. Retry with a minimal request body to isolate prompt or payload issues.

On this page