Migrate
From Anthropic
Move an Anthropic Messages client to plaingateway.
Change two settings and the model ID:
| Setting | Before | After |
|---|---|---|
| Base URL | https://api.anthropic.com |
https://api.plaingateway.com/api |
| Key | sk-ant-... |
sk-pg-v1-... |
| Model | claude-haiku-5-5 |
a served model ID, such as openai/gpt-5.6-luna |
python
import os from anthropic import Anthropic client = Anthropic(base_url="https://api.plaingateway.com/api", api_key=os.environ["PLAINGATEWAY_API_KEY"])
The SDK appends /v1/messages. The key works as x-api-key or Authorization: Bearer.
Responses, streams and errors keep Anthropic's shape. anthropic-version and anthropic-beta reach Anthropic hosts.
The model must be one an AI provider key serves; today no key serves an anthropic/ model, and the gateway translates the request for a model on a non-Anthropic host. thinking and cache_control need a model on an Anthropic host. Claude Code has its own page: Claude Code.