Embedded Routing Stack

Provision customers, routing policies, keys, budgets, and usage programmatically

The Embedded Routing API lets a platform built on Gateway provision each of its own end customers as a Customer: an object holding that customer’s routing policies, BYOK provider keys, and budget, with per-customer usage reporting. Attach a Customer to an LLM request with the customer field on Create response. For a walkthrough with examples, see the Embedded routing guide.

Base URL

https://api-gateway.merge.dev

Authentication

Authenticate with your organization’s production access key as a bearer token, the same key you use for LLM requests. Everything is scoped to your organization automatically, because the organization is derived from the key.

Authorization: Bearer mg_<your_production_key>

Embedded routing must be enabled for your organization; without it, requests carrying a customer return 400.