Model APIs
Messages
Create Anthropic Messages API requests against Baseten Model APIs.
POST
Python
Model APIs accept requests in the Anthropic Messages API format at
https://inference.baseten.co/v1/messages. Messages also supports server-side tool execution for web search and page fetching.
Call with the Anthropic SDK
The Anthropic SDK sends the API key asx-api-key by default. Baseten reads Authorization, so override default_headers when creating the client:
- Python
- cURL
messages.py
Authorizations
Pass your Baseten API key. Clients automatically send Authorization: Bearer <key>. Direct callers can also use Authorization: Api-Key <key>; both schemes are accepted. The Anthropic SDK's default x-api-key header is not accepted; override default_headers to send Authorization instead.
Body
application/json
Request body for creating a message.
Response
Successful response
The message response returned by the model.