Choose how to start
Choose a dedicated deployment when you need another model, dedicated GPUs, or control over hardware and scaling.
Supported models
A model slug identifies the hosted model, such aszai-org/GLM-5.3. Set the request’s model field to the exact slug from the table, then run inference.
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
The language models in this table 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 on supported 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. For synchronous Model API requests, Baseten doesn’t store inputs or outputs under its zero data retention policy. For queued execution, use async inference with a dedicated deployment and review its input-retention behavior.Run inference
SetBASETEN_API_KEY to your API key. If you need to create a key, follow the quickstart. Requests use the model’s token pricing.
Generated text can vary. The cURL responses are excerpts; ... marks omitted fields.
To use another model, replace zai-org/GLM-5.3 with its slug.
Use the OpenAI SDK
Set the OpenAI client’s base URL tohttps://inference.baseten.co/v1 and pass your Baseten API key. Choose the API format your application uses, then select a language. The CLI sends Chat Completions requests.
- Chat Completions
- Responses
- Baseten CLI
- Python
- JavaScript
- cURL
These examples require the
openai package (pip install openai).To call a model with the Chat Completions API:Save the following code as chat.py, then run python chat.py:choices[0].message.content in the JSON response.For more information, see the Chat Completions API reference.Use the Anthropic SDK
Anthropic Messages API support is in beta. Behavior may change before general availability. For production workloads, use the OpenAI Chat Completions API.
https://inference.baseten.co/v1/messages. Set the Anthropic SDK’s base URL to https://inference.baseten.co. The SDK sends x-api-key by default; override its default headers to send your Baseten API key in Authorization.
Messages requests require max_tokens. These examples allow up to 4,096 output tokens, including reasoning and the final answer.
- Python
- JavaScript
- cURL
These examples require the
anthropic package (pip install anthropic).To call a model with the Messages API:Save the following code as messages.py, then run python messages.py:content blocks with type: "text".
For related requests, use a stable session affinity ID to improve cache reuse. Session affinity controls routing; continue to send the conversation history with each request.
For more information, see the Messages API reference.
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, run the following command. Replace zai-org/GLM-5.3 with the model’s slug:
Migrate
To connect an existing application to Model APIs:- Replace your provider’s key with a Baseten API key.
-
Configure your client’s base URL and authentication for its API format:
-
Set
modelto a supported slug and check its feature support and reasoning controls. - Send a test request using the matching Chat Completions, Responses, or Messages example. Check the answer and token usage before switching your application’s traffic.
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.
Next steps
Use models in coding agents
Call Model APIs from Pi, Droid, or OpenCode, or connect Claude Code and Codex CLI with Baseten Switch.
Reasoning
Control extended thinking for complex tasks.
Vision
Send images and videos alongside text.
Web search
Search the web during a Model API response.
Pricing and limits
Review pricing, rate limits, budgets, and usage tracking.
API reference
Review Chat Completions parameters.