Capabilities
Markdown ↗

Streaming

Enable streaming on a supported text route and consume the events for that endpoint’s native wire format.

Make a streaming request

bash
curl -N https://api.zrelay.net/v1/chat/completions \
  -H "Authorization: Bearer $ZRELAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-6.1-sol","messages":[{"role":"user","content":"Hello from Zrelay"}],"max_tokens":256,"stream":true}'

Handle native events

EndpointStream format
Chat CompletionsRead choices[].delta; [DONE] ends the stream
MessagesAnthropic events such as content_block_delta and message_stop
ResponsesTyped response events; handle both completion and failure

Handle interruption

A 200 status starts a stream; it does not prove completion. Handle error events, early disconnects and missing terminal events. Keep the request ID and check request history for confirmed billing before retrying.

Use an endpoint-aware client

An SDK can parse event boundaries and partial text for you. See SDKs and frameworks. Do not assume one network chunk equals one JSON event.

Questions about your integration? support@zrelay.net