Basic call
UsePOST /v1/messages with an anthropic-messages model. Supply x-api-key, anthropic-version, and an explicit max_tokens limit.
For the Python example, first run python -m pip install anthropic. The SDK Base URL is the gateway root without the final /v1.
Streaming and tools
Setstream: true for native Messages events; the Anthropic SDK’s messages.stream exposes text output. Tool calling and multimodal input require compatible models and channels. Do not parse OpenAI events as Messages events.
POST /v1/messages/count_tokens requires the channel’s count_tokens capability. Token counting has no generation charge and does not guarantee admission of a subsequent request.