/v1; the TypeScript equivalents of these calls are
executed in CI (see documentation/docs/snippets/rest/).
Already speak the OpenAI wire format? A parallel OpenAI-compatible surface
serves
POST /openai/v1/chat/completions (and embeddings, models, images) at
/openai/v1. This page documents Roadie’s native contract.Authorization header:
Non-streaming chat
fetch (Node 18+, Deno, Bun, browsers via a server proxy):
snippets/rest/chat.ts
gatewayBaseUrl() and apiKey() are the tiny helpers at the top of
snippets/rest/chat.ts that read ROADIE_BASE_URL / ROADIE_KEY.)
Streaming (SSE)
Add"stream": true and read Server-Sent Events. Each data: line is one JSON frame tagged
with a type; the terminal sentinel is data: [DONE]. Lines beginning with : are
heartbeat comments — ignore them.
fetch:
snippets/rest/chat.ts
Errors
Non-2xx responses use the uniform envelope. See the error reference.Next steps
Node quickstart
Let the SDK handle retries, idempotency, and typed errors.
Error reference
Every error type and code, with how to handle each.