> This page is for Gateway.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Overview

> How Gateway routes agent requests, applies project and customer controls, and returns model usage and cost.

Gateway gives your application one API for model inference, with model selection, routing, budgets, and data controls in the request path. Use it to change models without changing your client integration, or to apply consistent routing and spend rules across your agent traffic.

Use Gateway's native [Responses API](/merge-gateway/api-overview) or a compatible OpenAI, Anthropic, AI SDK, or LangChain endpoint. Most existing clients need a new base URL and API key. The endpoint matters because compatible APIs can use different request and streaming formats. See [Get started](/merge-gateway/get-started) or [move an existing integration](/merge-gateway/migrate).

## What happens to a request

1. **Choose a route.** Send a concrete `provider/model` ID to call that model, or a model alias to use a routing policy. Without either, Gateway checks the key, customer, project, and organization defaults in order. See [policy resolution](/merge-gateway/routing/using-policies#how-routing-policies-are-applied).
2. **Apply controls.** Gateway checks the key's model access, budgets, vendor and region restrictions, zero data retention settings, and any configured security scans. A request blocked before a vendor call does not incur model inference cost.
3. **Return and meter.** The response identifies the model and vendor that served it. Supported surfaces include `usage.cost` in USD, and Gateway records usage against the request's organization, project, or customer.

## Scopes and credentials

An **organization** owns projects, keys, policies, and budgets. A **project** groups traffic for a team or environment. An Embedded Routing **customer** represents one of your end customers and can have its own policy, budget, controls, and credentials. See [projects](/merge-gateway/cost/projects) and [Embedded Routing](/merge-gateway/embedded-routing-stack/overview).

Use a model API key for inference. A `mgmt_` management key is for the [Management API](/merge-gateway/management-api), which administers Gateway resources and cannot call model endpoints. Project and customer API keys scope inference requests to those resources. See [API keys](/merge-gateway/automation/api-keys).

## Model and vendor names

Model IDs use `provider/model`, where the provider is the model's direct creator and the vendor is the service that serves it. For example, `anthropic/claude-sonnet-5-5` served by Amazon Bedrock has provider Anthropic and vendor Amazon Bedrock. Use a full model ID when a bare name could match more than one provider. Browse available models in the [model catalog](/merge-gateway/models/catalog) or with `GET /v1/models`.

## Next steps

#### [Get started](/merge-gateway/get-started)

Send your first request through Gateway

#### [Routing policies](/merge-gateway/routing/overview)

Choose how Gateway selects models and vendors

#### [Move an existing integration](/merge-gateway/migrate)

Check compatibility and plan a staged cutover