Connect a provider
The AI Gateway routes requests through provider credentials configured in the workspace, keeping spend and data fully under control.- In the AI Gateway sidebar, go to BYOK.
- Pick a provider (this quickstart uses OpenAI) and click Connect.
- Choose Setup your own API key and paste the provider key.
No OpenAI key yet? Create one at platform.openai.com/api-keys. For other providers, see the providers overview.
Supported providers
See the full list of supported model providers and how to connect them.
Get an API key
In the AI Gateway sidebar, go to API Keys. Click Create API Key, give it a name, and copy it.Then run the command below in a terminal, replacingyour-api-key-here with the key copied above. The code samples in the next step read from this environment variable.Make a request
Send a request to the unified/v3/router/responses endpoint using the provider-prefixed model id (e.g. openai/gpt-5.4).- API & SDK
- Frameworks
JSON
Troubleshooting
401 Unauthorized
401 Unauthorized
Provider not configured
Provider not configured
Model not enabled
Model not enabled
Some models require an explicit toggle in the AI Gateway. Search for the model id under Models and enable it before invoking it.
Next steps
Auto Router
Let the gateway pick the optimal model per request based on quality, cost, and latency.
Fallbacks and retries
Define backup models so requests survive provider outages automatically.
Identity tracking
Attribute usage and cost to a specific end user or tenant.
Supported models
Browse 300+ models across OpenAI, Anthropic, Google, AWS, Azure, and more.