Skip to content

Anthropic Messages

Choose a model and route that support Messages. An OpenAI-compatible model entry is not automatically an Anthropic Messages endpoint. The example uses claude-haiku-5-5, marked for this protocol in the public catalog; permissions and current availability still apply.

POST https://wudiapi.com/v1/messages

Terminal window
curl https://wudiapi.com/v1/messages \
-H "x-api-key: $WUDI_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model":"claude-haiku-5-5","max_tokens":256,"messages":[{"role":"user","content":"Hello. Briefly describe your capabilities."}]}'
Setting Messages
System instructions Top-level system
Output limit Required max_tokens
Content Array of content blocks
Stop condition stop_reason
Authentication x-api-key; some clients use Bearer
SDK base address https://wudiapi.com

Python example:

import os
from anthropic import Anthropic
client = Anthropic(api_key=os.environ["WUDI_API_KEY"], base_url="https://wudiapi.com")
message = client.messages.create(
model="claude-haiku-5-5", max_tokens=256,
system="Answer concisely.",
messages=[{"role":"user","content":"Explain recursion."}],
)
for block in message.content:
if block.type == "text":
print(block.text)

Read text blocks from the returned content array. Tools, thinking settings, beta headers and image input require compatible model and route support; test plain text before enabling them. See Claude Code for client setup and troubleshooting for errors.