Anthropic Messages
Availability requirements
Section titled “Availability requirements”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.
Minimal request
Section titled “Minimal request”POST https://wudiapi.com/v1/messages
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."}]}'Differences from Chat Completions
Section titled “Differences from Chat Completions”| 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 osfrom 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.
