Download the library
Use SambaNova APIs with the Anthropic client library
Configure the Anthropic client to use SambaNova by settingbase_url and api_key.
Don’t have a SambaNova API key? Get one from the API keys page.
model to a SambaNova model identifier when calling the API (see the supported models page).
Alternatively, set the environment variables:
Messages API
SambaNova exposes aPOST /v1/messages endpoint compatible with the Anthropic Messages API standard, in addition to the Chat Completions and Responses endpoints. For full request/response details, examples for tool calling, streaming, thinking, and multi-turn conversations, see the Messages API page.
Count tokens
SambaNova also exposes aPOST /v1/messages/count_tokens endpoint compatible with the Anthropic token-counting API. Use it to estimate the token cost of a request before sending it.

