Skip to main content

Request Format

All requests use JSON and require these headers:

Successful Responses

Response shapes vary by endpoint, each following its own API spec:
  • Chat Completions — OpenAI standard response format
  • Claude Messages — Anthropic standard response format
  • Gemini — Google standard response format
  • Asynchronous Tasks — QWave API unified task response format

Billing Field (usage.cost)

Text and embedding endpoints return the actual charge of each call (quota, integer) in the usage object:
  • Non-streamingusage.cost in the response body
  • Streaming (SSE) → the last data frame carrying usage (see Streaming)
  • Async taskspre_consumed_cost on submission (pre-deduction), cost in the terminal state (settlement; 0 after refund on failure/cancellation)
For per-call reconciliation, the accumulated value of these fields matches your account balance deductions exactly.

Error Responses

Error structures differ slightly across endpoints: Synchronous endpoints (chat / messages / images, etc.) — OpenAI-compatible format with a type field:
Asynchronous task endpoints (/v1/tasks/...) — Simplified format with only message + code:

Status Codes