Get started
Merge Gateway is the control plane for production AI. Access all LLMs through a single API, with intelligent routing, cost management, and security built-in. Route to OpenAI, Anthropic, Google, and AWS Bedrock through a single endpoint, with automatic failover and observability.
You’ll need a Merge Gateway API key. Get one from the Merge Gateway dashboard.
Merge Gateway SDK
Send a request
If you have a routing policy configured (on a project or as the org default), the model field is optional. The policy picks the provider and model. Either omit model or set it to the sentinel value "default_routing" to explicitly hand off to your policy. To scope a request to a project, pass project_id in the request body.
OpenAI SDK
Already using the OpenAI SDK? Point it at Merge Gateway to get multi-provider routing without changing your application code.
AI SDK (Vercel)
Using the Vercel AI SDK? Use the Merge Gateway provider for full access to routing, tags, and cost tracking, or use the quick-start URL shim for zero-install setup.
Recommended: Merge Gateway provider
The native provider gives you typed access to Gateway features like tags, vendor routing, and routing metadata via providerOptions.mergeGateway.
Alternative: URL shim (no extra install)
If you already have @ai-sdk/openai installed, point it at Gateway with a base URL change:
Other SDKs
Gateway is compatible with any SDK that lets you set a custom base URL.