- Base URL →
/openai/v1 - API key → your Roadie secret key (
rd_sk_…)
1. Install the official OpenAI SDK
These are the stock OpenAI packages — not a Roadie fork.development or production).
2. Send a chat completion
Construct the client with the two overrides, then call it exactly as you would OpenAI.Model names
Themodel field accepts three forms:
- A bare OpenAI name like
gpt-4o— resolved toopenai/gpt-4owhen it is in your project’s catalog (OpenAI is the default provider on this surface). - A qualified
provider/modelid likeanthropic/claude-sonnet-5— routes to that provider directly. This is how you reach Anthropic through the OpenAI SDK. - A project alias like
smart— a stable name you define that can fail over across providers. See Models, aliases & fallback.
3. Streaming
Streaming works verbatim — passstream: true and iterate the deltas.
4. Embeddings and images work too
The same client reaches embeddings and images with no extra setup.Image responses are always returned as
b64_json (never a URL), and n is capped at 1 per
request. Both images.generate (/images/generations) and images.edit (/images/edits)
are supported. Embeddings accept a string or an array of strings.Authentication rule
The OpenAI-compatible surface accepts either credential type as the SDK’s API key:- A secret key (
rd_sk_…) — for server-side code. - A client token (a short-lived JWT minted for an end user) — for browser and mobile apps.
rd_pk_…) is mint-only: it can create client tokens but cannot call model
endpoints, so using one here returns 403. See Authentication.
When to reach for the Roadie SDK instead
The OpenAI-compatible surface is the zero-friction path — nothing to learn, nothing to migrate. The first-party@roadie/sdk is optional and layers on typed error classes,
built-in retries and idempotency, and a normalized response with usage, cost, and the gateway
requestId. Use whichever fits; both hit the same gateway.
Next steps
Node quickstart
Adopt
@roadie/sdk for typed errors, retries, and streaming.Using OpenAI SDKs
The full compatibility reference across Node, Python, and Swift.
OpenAI migration guide
What maps one-to-one and what to watch for.
Rate limits, quotas & budgets
Cap spend and usage before it happens.