Appearance
Fresh 2026
SOP: Route LLM Requests with Gateway
Procedure to send LLM traffic through Merge Gateway and route it across providers with a policy.
Prerequisites
- A Merge account with Gateway enabled.
- A Gateway project and a management API key.
Procedure
- Create a project. Projects scope keys, policies, and spend. See Projects.
- Send a first request. Point your existing OpenAI-style client at the Gateway endpoint and call
POST /responses. See Quickstart. - Choose a routing strategy. Pick single-provider, priority, performance, or intelligent routing based on whether you optimize for simplicity, reliability, latency, or cost-vs-quality. See Routing Policies.
- Define the policy. Write the routing policy JSON once. Your application code keeps calling the same endpoint.
- Add cost governance. Set budgets and spend caps. See Cost governance and savings.
- Enable extras as needed. Tool calling, multimodal inputs, web search, and context compression are policy and request options. See Features.
Verification
POST /responsesreturns a completion through the routed provider.- Failover and cost rules behave as defined when you change the policy (not the code).