Skip to main content
The organization that configures Gateway resources and issues federated keys is the Gateway operator. If you have a federated key, use this guide to call the models that key grants access to through Baseten Frontier Gateway. Choose the credentials and URL for the call path:
  • Frontier Gateway calls use a federated API key with the gateway URL.
  • Shared Model API calls use a Baseten workspace API key with https://inference.baseten.co/v1.
  • Dedicated calls use a Baseten workspace API key with the model-specific deployment URL.
This guide covers the Frontier Gateway path. The gateway is OpenAI-compatible, so any OpenAI SDK or HTTP client works with two changes: the base URL and the auth header.
The gateway accepts the OpenAI Chat Completions API. Configure your client with the Gateway base URL and federated API key.

Base URL

The Gateway operator provides the base URL. Unless it gives you a custom domain, use:
Use a custom domain only when the Gateway operator provides one; the request shape is the same.

Authentication

Pass your federated API key in the Authorization header using the Api-Key scheme, not Bearer:
If your client defaults to Authorization: Bearer ..., override it. Federated keys sent as Bearer tokens are rejected. The organization that issued your key manages its rotation and limits through Baseten’s federated key management. Treat the key like any other API secret: store it in an environment variable or secret manager, never in source control.

OpenAI SDK example

Make a chat completion request with the federated key the Gateway operator gave you. Replace YOUR_API_KEY with that key, and your-org/your-model with the model slug the Gateway operator gave you.
Install the OpenAI SDK:
Make a chat completion request:
chat.py
The response follows the standard OpenAI Chat Completions schema:
Output

curl example

For raw HTTP usage:

Model slug format

Use the your-org/your-model format (for example, acme/llama-3-70b). Pass the slug as the model parameter on every request. The Gateway operator tells you which slug or slugs your key has access to; a single key can be authorized for one or more models.

Streaming, structured outputs, and tool calling

Frontier Gateway forwards OpenAI-compatible parameters supported by the target. Ask the Gateway operator which features each slug supports. For Baseten-hosted targets, use these guides:
  • For more information on streaming responses, see Streaming.
  • For more information on JSON-schema and structured generation, see Structured outputs.
  • For more information on tool calling and function definitions, see Function calling.
For third-party or custom targets, consult the relevant upstream provider or server documentation for supported features.

Rate limits

The Gateway operator sets rate and usage limits for your federated key. If a request exceeds a limit, the gateway returns 429 Too Many Requests. For more information on the limit shape, daily reset behavior, and 429 handling, see Rate and usage limits.

Manage access for callers

If you’re the Gateway operator rather than a developer consuming a key, the Frontier Gateway overview covers group and key management, rate limits, and billing webhooks.