What is Anthropic Native Format?
Samurai AI supports two API formats side-by-side:
If you already use the official
anthropic Python or TypeScript SDK — or call api.anthropic.com directly — you can switch to Samurai AI by changing one line: the base_url.
Base URL for Anthropic format:
https://www.samuraiapi.in/apiThe Anthropic SDK appends /v1/messages automatically. Do not include it in the base URL.Supported Claude Models
Key Differences from OpenAI Format
1. System prompt is a top-level field
2. max_tokens is required
The Anthropic API always requires max_tokens. There is no default.
3. Response is a Message object, not a ChatCompletion
4. Tool definitions use input_schema instead of parameters
5. Auth header is x-api-key
Quick Start
SDK Installation
Authentication
Use your Samurai AI API key in thex-api-key header. The same key works for both OpenAI-compatible and Anthropic-native endpoints.
anthropic-version: 2023-06-01 header is required by the official SDK — Samurai AI accepts it and forwards it as needed.
Rate Limits & Quotas
Anthropic-format requests use the same quotas and rate limits as OpenAI-format requests. Your plan limits apply across both endpoints.Next Steps
Messages API
Full reference for the
/v1/messages endpoint — parameters, streaming, tool use, vision.Function Calling
Tool use with the OpenAI-compatible format (also works with Claude models).