# Set ANTHROPIC_API_KEY to your AIWave key before running this example.
from anthropic import Anthropic
client = Anthropic(base_url="https://aiwave.live")
message = client.messages.create(model="claude-haiku-4-5-20251001", max_tokens=64, messages=[{"role": "user", "content": "Reply with exactly: OK"}])
print(message.content[0].text)Choose the route before you change the model.
AIWave keeps one key, one USD balance, and one domain. It does not pretend that OpenAI and Anthropic use the same wire protocol.
Model-family request contract
A shared account removes commercial re-integration. The request and response shape still follows the model family.
| Family | Recommended route and client | Output limit | Sampling fields | Streaming response | Last verified |
|---|---|---|---|---|---|
| Chinese models | /v1/chat/completionsOpenAI-compatible client | max_tokens in current quickstart examples; verify model-specific exceptions | temperature and top_p are model-specific | OpenAI-compatible SSE chunks on documented routes | 2026-09-24 tool-call matrix; streaming coverage remains partial |
| GPT | /v1/chat/completionsExisting OpenAI client | Use max_completion_tokens when the model rejects max_tokens; current GPT route applies its verified parameter rule | Do not force a non-default value unless the selected model accepts it | OpenAI-compatible shape; streaming not separately certified for every GPT model | 2026-09-28 |
| Claude | /v1/messagesAnthropic SDK or native HTTP | max_tokens | The verified route removes deprecated temperature and top_p fields before upstream delivery | Anthropic event stream; Chatbox path verified, every native event type not yet certified | 2026-10-01 |
A Claude request sent to /v1/chat/completions can be accepted and billed, but it returns an Anthropic envelope. No OpenAI choices field is present, so an OpenAI SDK parser fails. Use /v1/messages instead.
Claude: keep the account, use the native client.
The key, balance, and domain stay the same. Only the protocol-specific client changes.
# Export AIWAVE_API_KEY in your shell before running this request.
curl https://aiwave.live/v1/messages \
-H "x-api-key: $AIWAVE_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-haiku-4-5-20251001","max_tokens":64,"messages":[{"role":"user","content":"Reply with exactly: OK"}]}'Examples use placeholders. Controlled route verification is recorded separately; never paste a real key into shared code or screenshots.
Known failure modes
Match the symptom before changing credentials or routes.
| Symptom | Cause | Fix |
|---|---|---|
OpenAI client reports a missing choices field for Claude | The Claude route returned its native Anthropic envelope | Use the Anthropic SDK or POST /v1/messages |
max_tokens is unsupported on a GPT model | The model expects max_completion_tokens | Send max_completion_tokens; retain the upstream error body when reporting a recurrence |
Claude reports that temperature or top_p is deprecated | The model requires those fields to be omitted | The verified AIWave Claude route removes both fields; if the error returns, keep the request ID and contact support |
| A stream parser receives unfamiliar event types | An Anthropic event stream was parsed as OpenAI SSE chunks | Use the matching Anthropic stream iterator for Claude |
Start with the quickstart, copy the exact fields from client setup, then compare the returned shape with this matrix.