Skip to main content
Triw implements the Anthropic Messages API. Use the official anthropic SDK, or any client that targets /v1/messages.

Install

Configure

Unlike the OpenAI SDK, the Anthropic SDK does not append /v1 for you — pass the host only.

Authentication details

  • x-api-key: sk-... is accepted on Anthropic routes.
  • Authorization: Bearer sk-... also works — useful when a tool only exposes one auth style.
  • Keep the anthropic-version header. Triw forwards it; the upstream channel decides whether it matters.

Token counting

Streaming and tools

stream: true works; events arrive in Anthropic’s SSE format (message_start, content_block_delta, message_stop). Tool use (tools, tool_choice) is passed through unchanged.

Using Claude models from an OpenAI-style client

You can also call Claude models through /v1/chat/completions, since Triw translates between formats. Pick one style per integration; mixing both in one codebase doubles the number of response parsers you maintain.