1. Cut over behind an environment flag
The two things that change are the base URL and the API key. Keep both in the environment so you can flip back to OpenAI instantly if you need to.- Base URL →
/openai/v1 - API key → your Roadie secret key (
rd_sk_…), created in the dashboard
Node
chat.completions, embeddings, images, streaming, tools, JSON mode, and vision all work verbatim. See Using OpenAI SDKs for the full per-language compatibility matrix.
2. Add a provider credential (BYOK)
Roadie is bring-your-own-key: the gateway calls OpenAI using your OpenAI key, held server-side. Before your first request succeeds, add that key as a provider credential to the project’s environment in the dashboard. It is validated live on save and envelope-encrypted — only the gateway can ever decrypt it. If a request resolves to a provider with no configured credential, it fails before any provider work withprovider_credential_missing. Add an Anthropic key too if you plan to route to anthropic/* models.
3. Keep or qualify your model names
Themodel field accepts three forms, so your existing gpt-4o strings keep working:
- A bare OpenAI name (
gpt-4o) resolves toopenai/gpt-4owhen it is in your project’s catalog — OpenAI is the default provider on this surface. - A qualified
provider/modelid (anthropic/claude-sonnet-5) routes to that provider directly — this is how you reach Anthropic through the OpenAI SDK. - A project alias (
smart) that can fail over across providers. See Models, aliases & fallback.
A bare name that matches models from more than one provider is rejected with
model_ambiguous
(400). Use the qualified provider/model id to disambiguate.4. Review the differences
Almost everything maps one-to-one. These are the edges worth checking during a migration:5. Map error handling
Errors come back in the OpenAI error shape, so your existingtry/catch and the OpenAI SDK’s typed error classes keep working. Two Roadie-specific mappings to know:
- A quota or budget rejection is reported as
insufficient_quotaat HTTP429on this surface, because the OpenAI error schema has no402. (The native Roadie surface keeps them distinct —quota_errorat429,budget_errorat402.) - Provider failures surface only after the gateway exhausts its own retries and fallbacks, mapped to a safe message — never the provider’s raw body.
6. Verify, then keep what you gained
Send a request, then open the dashboard: you now have request logs, usage and cost rollups, and can attach per-end-user limits, quotas, and budgets — all without changing your inference code. To roll back at any point, pointbaseURL and the API key back at OpenAI. You are never locked in.
Next steps
Set usage controls
Cap spend and per-user usage before it happens.
Observability: logs & usage
Inspect request logs, cost, and usage.
Rotate BYOK credentials
Rotate your OpenAI and Anthropic keys with zero downtime.
Using OpenAI SDKs
The full compatibility reference across Node, Python, and Swift.