- 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.
Base URL
The Gateway operator provides the base URL. Unless it gives you a custom domain, use:Authentication
Pass your federated API key in theAuthorization header using the Api-Key scheme, not Bearer:
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. ReplaceYOUR_API_KEY with that key, and your-org/your-model with the model slug the Gateway operator gave you.
- Python
- JavaScript
Install the OpenAI SDK:Make a chat completion request:
chat.py
Output
curl example
For raw HTTP usage:Model slug format
Use theyour-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.
Rate limits
The Gateway operator sets rate and usage limits for your federated key. If a request exceeds a limit, the gateway returns429 Too Many Requests. For more information on the limit shape, daily reset behavior, and 429 handling, see Rate and usage limits.