Streaming and retries

Set stream: true and read SSE events. Network chunks are not complete events: split on blank lines, combine data: lines and then parse. Do not call response.json() on an entire SSE body.

curl  -N https://api.inoneapi.com/v1/chat/completions \
  -H "Authorization: Bearer $INONEAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"YOUR_MODEL_ID","messages":[{"role":"user","content":"Hello"}],"stream":true}'

Chat Completions uses choices[].delta and fragmented tool arguments, ending normally with [DONE]. Responses uses events such as response.output_text.delta and response.completed / response.failed. Messages uses content_block_delta, message_stop and error. HTTP 200 can still be followed by an error event or a broken connection.

The gateway retries only under safe conditions. A request already sent with an uncertain result, or a response started toward the client, is not guaranteed a retry. Bound client retries, respect Retry-After, and do not retry 402 budget or 401/403 permission failures. Media creation and tools can incur cost or side effects; there is no universal Idempotency-Key deduplication guarantee. A read timeout does not cancel a task.

HTTP errors · Limits · Video tasks

Streaming and retries · Documentation · InOneAPI