Gateway API reference
Your applications send requests to the data plane, the part of Fabric AI Gateway that serves traffic. This page describes the endpoints that the data plane exposes: LLM endpoints, the MCP endpoint, REST passthrough, and the endpoints that the gateway answers itself, such as health checks. For the admin API that manages configuration, see Use the admin API.
Base URL
Every request goes to a route. A route’s URL is the data plane host followed by the route’s base path:
For a cloud tenant, GATEWAY_HOST has the form TENANT_NAME.dp.fabricgateway.ai. For a data plane that your organization runs, it’s the host that an admin set in Admin > Data plane. To copy a route’s URL, in the console sidebar, select LLMs, MCP servers, or Services, select the Routes tab, find the route, and select the copy icon in its row: Copy LLM base URL for an LLM route or Copy DP URL for other routes.
A request to a host that doesn’t belong to your organization gets 421. A path that no route serves gets 404.
Authentication
Send your gateway key in the fg-api-key header on every request. If the route uses JWT Auth, send Authorization: Bearer <token> instead. The gateway removes your gateway credential before it calls the upstream and adds the upstream’s own credential. For details, see Authenticate and send a request and Request and response headers.
LLM endpoints
An LLM route exposes the endpoints that you selected for it under Endpoints, appended to the route’s base URL. The endpoints you can select depend on the API that the route’s providers speak.
The request and response bodies are the provider’s own. The gateway works like this:
- No translation. The gateway sends an OpenAI-format request only to a provider that offers that OpenAI endpoint, and an Anthropic-format request only to an Anthropic-format endpoint. A request to an endpoint that no provider on the route offers gets
404unknown LLM endpoint. - The model comes from the request. The gateway reads
modelfrom the JSON body, or from the path for provider-native endpoints, to check it against the connection’s model filter and to route it. It forwards the body unchanged unless a plugin, such as the Adaptive Model Router, rewrites it. - Streaming is relayed as it arrives. Set
"stream": trueas you would with the provider. The gateway passes each server-sent event or AWS event-stream frame to you as soon as it’s complete. Before the first event reaches you, the gateway can still fail over to another provider. - Errors use the provider’s envelope. Most gateway errors on LLM routes use the OpenAI or Anthropic error shape, matching the endpoint you called. For the full list, see Gateway error codes.
On a route with several connections, a routing plugin such as the LLM Router chooses the connection. Without a routing plugin, name the connection in the x-gateway-service header, or the request gets 400.
Model-name routing
A route with the llm-model-router plugin serves many providers from one base URL. You name the model as <provider>/<model>, for example openai/gpt-4o-mini, or by an alias that your admin defines. On these routes:
GET /v1/modelslists the models you can call. It answers in OpenAI’s list format, or in Anthropic’s when you send theanthropic-versionheader.GET /v1/models/{model}returns one entry from that list, or404if the model isn’t on it.- The
x-fabric-modelresponse header names the provider and model that answered.
For details, see Route requests by model name.
MCP endpoint
An MCP route serves one MCP endpoint at its URL, using the Streamable HTTP transport. Point your MCP client at the route’s URL. For the steps, see Connect an MCP client.
The gateway speaks MCP protocol revisions 2026-07-28, 2025-11-25, 2025-06-18, 2025-03-26, and 2024-11-05. On 2026-07-28, each request carries its envelope in params._meta, and some JSON-RPC error codes differ from earlier revisions. For the codes, see Gateway error codes.
How the gateway answers the main methods:
initializereturns a session ID in theMcp-Session-Idheader. On a route with one MCP server, the result is the server’s owninitializeresult. On any other route, or when that server can’t be reached or needs an account you haven’t connected, the result is the gateway’s own: it advertises thetoolscapability withlistChangedand namesfabric-gatewayas the server.tools/listreturns one list built from every MCP server on the route. On a route with several connections, each tool name has a prefix that identifies its server, in the form<prefix>__<tool>. Tools that you have no access to are removed. A server that needs an account you haven’t connected appears as oneconnect_<service>tool. When the route uses Tool Search, the list is exactlysearch_tool,get_tool, andexecute_tool.tools/callcalls the tool on its server and returns the server’s result unchanged.
When a gateway error happens during an MCP call, the gateway usually answers with HTTP 200 and a JSON-RPC error. For the codes, see Gateway error codes.
REST passthrough
A REST route forwards requests to the API behind it. The gateway matches the request to a route by path, host, method, and any header conditions on the route, and then forwards it:
- Path. The upstream receives the request path, or a rewritten path if the route defines one, after the connection’s base path. The query string is passed unchanged.
- Method, headers, and body. Passed through, except for the changes listed in Request and response headers.
- Response. The upstream’s status, headers, and body are relayed unchanged, unless a response plugin changes them. Server-sent events and AWS event streams are passed on event by event.
The gateway doesn’t handle CORS and doesn’t add Access-Control-* headers. WebSocket upgrades don’t work through the gateway. For the steps to call a REST route, see Call a REST route.
Example requests
Each route type takes the same gateway key in the fg-api-key header. Replace GATEWAY_HOST, BASE_URL, ROUTE_URL, and GATEWAY_KEY.
LLM
MCP
REST
For the Anthropic Messages API and streaming, see Use the Anthropic Messages API.
Endpoints the gateway answers itself
The gateway answers these paths itself, before it matches any route. A route that you configure on one of these paths never receives traffic for it. Paths are compared exactly, so /healthz/ isn’t a gateway endpoint.
Only /healthz and /readyz answer on any hostname. Every other path in this table needs a hostname that belongs to your organization, and the gateway answers 421 for an unknown host. The gateway issues no tokens of its own, so GET /.well-known/openid-configuration and GET /auth/jwks return 404.
No plugins run on these endpoints, so rate limits and authentication plugins don’t apply to them.
Next steps
- Send your first request by following Authenticate and send a request.
- Check which endpoints each provider supports in Supported endpoints.
- Look up gateway errors in Gateway error codes.
- To connect your account to an MCP server, see Connect your accounts to MCP servers.

