Supported models
Choose a model below, then run inference with its slug.Context and output limits can differ from a model’s advertised maximum. Use the limits in this table when configuring requests. The
/v1/models catalog can report different values from the limits enforced by the endpoint.Feature support
All Model APIs support tool calling. All except Muse Spark Open support structured outputs and JSON mode. The table lists model-specific support for reasoning, vision, and sampling parameters. Muse Spark Open also supports audio input. Web search is available in early access on enabled workspaces and models.Defaults and limitations
Muse Spark Open acceptslogprobs and top_logprobs but ignores them and returns no log probabilities. It supports one response per prompt; n greater than 1 returns HTTP 400. Neither seed nor temperature: 0 guarantees reproducible output.
Regions and compliance
Model APIs use a shared endpoint, and the regions serving a model can change. If your workloads must stay in specific regions, contact support to confirm model availability and enable a Model APIs compliance policy. The policy restricts which deployments can serve your requests. Availability depends on the model having capacity in an allowed region. See Secure model inference for data privacy and compliance policies.Run inference
Choose the OpenAI Chat Completions API or the Anthropic Messages API, then set the base URL, API key, and model slug.Use the OpenAI SDK
The OpenAI Chat Completions API is available athttps://inference.baseten.co/v1/chat/completions.
- Python
- JavaScript
- cURL
- Baseten CLI
To call a model with the Chat Completions API:
chat_completions.py
x-session-affinity value for related requests to improve cached input tokens reuse.
We recommend at most ~60 requests/min sent via the same session.
Use the Anthropic SDK
The Anthropic Messages API is available athttps://inference.baseten.co/v1/messages.
Anthropic Messages API support is in beta. Behavior may change before general availability. For production workloads, use the OpenAI Chat Completions API.
x-api-key by default. Baseten reads Authorization, so override default_headers as shown.
- Python
- JavaScript
- cURL
To call a model with the Messages API:
messages_api.py
List available models
List the current model catalog and metadata, including pricing, context windows, and supported features, withbaseten model-api list or the /v1/models REST endpoint:
baseten model-api describe:
Migrate
To migrate to Baseten, change the base URL, API key, and model name.- OpenAI SDK
- Anthropic SDK
To migrate from the OpenAI SDK:
- Replace your OpenAI API key with a Baseten API key.
- Change the base URL to
https://inference.baseten.co/v1. - Update the model name to a Baseten model slug.
migrate.py
Handle errors
Model API requests can return the following HTTP error codes:
HTTP error responses include a JSON body with details about the failure. Once streaming starts, a request can fail without a new HTTP status or an error object. See streaming completion markers and recovery.
Use bounded retries with backoff and jitter for transient failures. See Inference errors for causes and recommended responses by status code.