Endpoint

The Anthropic SDK appends /v1/... paths, so the base URL should usually end at /anthropic.

Python

JavaScript

Supported Route Groups

ModRouter’s Anthropic integration includes:
  • POST /anthropic/v1/messages
  • POST /anthropic/v1/complete
  • GET /anthropic/v1/models
  • POST /anthropic/v1/messages/count_tokens
  • Anthropic file routes
  • Anthropic message batch routes
The route converts Anthropic request and response shapes. It is not an OpenAI endpoint; do not point Anthropic SDK examples at /openai.

Custom Headers

Use SDK-supported header options for ModRouter virtual keys or routing metadata:

Non-Anthropic Models

ModRouter can route Anthropic-format requests to other providers when converters and model capability allow it. For agent workloads, choose models with strong tool-calling support.