Skip to main content
Myrouter provides API services compatible with the Anthropic SDK, making it easy to integrate into your existing applications. If you have already developed applications using the Anthropic SDK, you only need to replace the base URL and API Key with the Myrouter API address and API Key. Please refer to the integration guide below.

Supported Models

Currently, only the following models provide Anthropic SDK compatibility support:

Quick Start

1. Install the Anthropic SDK

2. Initialize the Client

The Anthropic SDK will attempt to retrieve the API Key and base URL from the environment variables ANTHROPIC_API_KEY and ANTHROPIC_BASE_URL respectively. You can also specify them through parameters when initializing the client.
  • Setting via environment variables
  • Setting parameters when initializing the Anthropic client

3. Call the API