Skip to main content
Model APIs provide instant access to high-performance LLMs through endpoints that are compatible with both the OpenAI Chat Completions API and the Anthropic Messages API (beta). Point your existing OpenAI or Anthropic SDK at Baseten’s inference endpoint and start making calls, no model deployment required. Unlike dedicated deployments, where you’d configure hardware, engines, and scaling yourself, Model APIs run on shared infrastructure that Baseten manages. You get a fixed set of popular models with optimized serving out of the box. When you need a model that isn’t in the supported list, or want dedicated GPUs with custom scaling, deploy your own with Truss.

Supported models

Run inference against any Model API to get started.
Context and output limits reflect Baseten’s live serving configuration, which can differ from a model’s advertised native maximum. We extend limits as they meet our performance bar; this table and /v1/models always reflect what’s currently served.

Pricing

Model APIs bill per million tokens. For current per-model rates, see the Model APIs pricing page. Cached input tokens are prompt tokens served from the KV cache, billed at a discounted rate. Every request participates in caching automatically, with no flags or opt-in steps.

Feature support

All models support tool calling (also known as function calling), structured outputs, and JSON mode. See the table below for per-model coverage of reasoning, vision, and audio. For reasoning-specific configuration, see Reasoning. For image and video inputs, see Vision. For audio inputs, see Audio.
GLM models, Nemotron Super, and Nemotron Ultra also support top_p and top_k sampling parameters.

Run inference

Model APIs support both OpenAI’s Chat Completions and Anthropic’s Messages APIs. Set your base URL, API key, and model name to start making requests.

Use the OpenAI SDK

Call supported models using the OpenAI Chat Completions API at https://inference.baseten.co/v1/chat/completions.
To call a model with the Chat Completions API:
chat_completions.py
Replace the model slug with any model from the supported models table.

Use the Anthropic SDK

Call supported models using the Anthropic Messages API at https://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.
To call a model with the Messages API:
messages_api.py
The Anthropic SDK sends the API key as x-api-key by default. Baseten reads Authorization, so override default_headers as shown.

List available models

Query the /v1/models endpoint for the current list of models with metadata including pricing, context windows, and supported features:
Request

Migrate

To migrate to Baseten, change the base URL, API key, and model name.
To migrate from the OpenAI SDK:
  1. Replace your OpenAI API key with a Baseten API key.
  2. Change the base URL to https://inference.baseten.co/v1.
  3. Update the model name to a Baseten model slug.
migrate.py

Handle errors

Model APIs return standard HTTP error codes: Each error response includes a JSON body with details about the issue and suggested resolutions.

Next steps

Reasoning

Control extended thinking for complex tasks

Vision

Send images and videos alongside text

Audio

Send audio alongside text

Rate limits

Understand and configure rate limits

API reference

Complete parameter documentation