Configuration
Set the following environment variables before running your agent:TypeScript Example
Install the SDK:Python Example
Install the SDK:Tip: The Agent SDK inherits all the same model override capabilities as Claude Code. You can use
ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL, and other environment variables to route your agent to different models on OpenRouter. See the Claude Code integration guide for more details.