What is Anthropic Native Format?
Samurai AI supports two API formats side-by-side:| Format | Endpoint | Auth Header | SDK |
|---|---|---|---|
| OpenAI-compatible | POST /v1/chat/completions | Authorization: Bearer sk-... | openai |
| Anthropic-native | POST /v1/messages | x-api-key: sk-... | anthropic |
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
| Model ID | Context | Best For |
|---|---|---|
claude-opus-4-5 | 200K | Complex analysis, research, long documents |
claude-sonnet-4-5 | 200K | Balanced performance, most tasks |
claude-3-5-sonnet-20241022 | 200K | Coding, reasoning, instruction-following |
claude-3-5-haiku-20241022 | 200K | Fast, low-latency responses |
claude-3-opus-20240229 | 200K | Deep reasoning, nuanced writing |
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.| Plan | Requests/min | Notes |
|---|---|---|
| Free | 10 RPM | Shared across all endpoints |
| Starter | 60 RPM | — |
| Pro | 200 RPM | — |
| Enterprise | Custom | Contact us |
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).