Anthropic (Claude)
Anthropic Claude models via the Messages API — extended thinking, vision/PDF, tool use, prompt caching, and server tools.
Overview
Anthropic is an AI safety company building the Claude family of models, known for strong reasoning, long context, vision/PDF understanding, and a rich set of agentic tools.
Official Website: https://www.anthropic.com API Documentation: https://docs.anthropic.com
Key features
- Extended thinking — a configurable thinking budget for deeper reasoning
- Vision & PDF — analyze images and documents inline
- Tool use — function calling for agentic workflows
- Prompt caching — cache large, reused prompt prefixes to cut cost and latency
- Batch — high-volume asynchronous processing at a discount
- Server tools — built-in
web_search,web_fetch,code_execution,computer_use, and the MCP connector
Using Anthropic with Yunxin
Address Claude models by prefixing the model id with the anthropic slug — anthropic/<model> (for example anthropic/claude-...). The recommended way to call Claude is the Anthropic-native Messages API at POST /v1/messages, which preserves Claude-specific features. The anthropic-version header is accepted (e.g. anthropic-version: 2023-06-01).
You always use the same Yunxin endpoint with your sk- API key. With the Anthropic SDK, set base_url to https://api.yuhuanstudio.com (the SDK appends /v1/messages itself).
Usage example
import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ["YUNXIN_API_KEY"],
base_url="https://api.yuhuanstudio.com",
)
message = client.messages.create(
model="anthropic/claude-model-id",
max_tokens=1024,
messages=[
{"role": "user", "content": "Hello, Claude!"},
],
)
print(message.content[0].text)import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env.YUNXIN_API_KEY,
baseURL: "https://api.yuhuanstudio.com",
});
const message = await client.messages.create({
model: "anthropic/claude-model-id",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello, Claude!" }],
});
console.log(message.content[0].text);curl https://api.yuhuanstudio.com/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YUNXIN_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "anthropic/claude-model-id",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello, Claude!"}
]
}'Extended thinking
Enable a thinking budget for complex problems:
message = client.messages.create(
model="anthropic/claude-model-id",
max_tokens=2048,
thinking={"type": "enabled", "budget_tokens": 10000},
messages=[{"role": "user", "content": "Solve this step by step."}],
)See Reasoning for how thinking is surfaced across formats.
Available models
List the models currently available for this provider:
curl "https://api.yuhuanstudio.com/v1/models?provider=anthropic" \
-H "Authorization: Bearer $YUNXIN_API_KEY"Capabilities and pricing are per-model. Use the Models API to discover which Claude models are available and what each one supports.
Official resources
How is this guide?