Skip to main content
The official Anthropic SDK can point to OpenPAI simply by overriding base_url.

Python

Node.js / TypeScript

Streaming

Tool calling

Thinking mode

Prompt caching

See Cache billing.

Vision

Notes

  • OpenPAI also supports calling Claude via the OpenAI-compatible protocol (/v1/chat/completions), but if your code already uses the Anthropic SDK, overriding base_url is the lowest-change option.
  • The anthropic-version header is added automatically by the SDK; you don’t need to specify it manually.
  • The upstream official Anthropic API isn’t open to all regions yet — OpenPAI provides stable access.