Clarification on Using ANTHROPIC_BASE_URL for Custom Models and Adapters

Status Fixed / completed
Maintainer reply ✓ Yes — ant-kurt
Activity 5 comments · opened Aug 12, 2025 · closed Aug 12, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator) responded on this thread — see the highlighted reply below.

I am seeking clarification regarding Anthropic's Commercial Terms of Service and Usage Policy.

Specifically, is it permissible under Anthropic's ToS to:

  1. Use the ANTHROPIC_BASE_URL environment variable (as documented here: https://docs.anthropic.com/en/docs/claude-code/llm-gateway) to route SDK/API requests to custom models or endpoints that are not Anthropic's official models?
  2. Publish adapters or code on GitHub that enables others to use ANTHROPIC_BASE_URL to connect to non-Anthropic models or endpoints?

Are there any restrictions or implications under Anthropic's Terms of Service for these activities?

Thank you for clarifying whether this usage is compliant with Anthropic's policies.

View original on GitHub ↗

5 Comments

nikhil-pandey · 1 year ago

Also, what kind of data is collected by Anthropic other than the three listed here (Statsig, Sentry, Bug reports)?

Will setting ANTHROPIC_BASE_URL to a private endpoint and CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 ensure that Anthropic does not collect any data? Is there anything else not listed here that is collected?

ant-kurt collaborator · 1 year ago

Currently, using Claude Code with non-Anthropic models is unsupported.

ant-kurt collaborator · 1 year ago

Take a look at https://docs.anthropic.com/en/docs/claude-code/data-usage#telemetry-services for information about other flags that may be relevant for data collection.

nikhil-pandey · 1 year ago

@ant-kurt Yep, I understand it’s unsupported out of the box — but you already provide the ANTHROPIC_BASE_URL env var that’s intended for using a gateway service like LiteLLM.

My question here is about permissible use under the ToS, since Claude Code itself isn’t open source:
If I build a custom adapter and point ANTHROPIC_BASE_URL to a gateway HTTP endpoint that routes to a different model, would that be considered a violation of Anthropic’s Terms of Service?

I’m not asking for technical support — just clarity on whether this scenario is allowed or prohibited from a policy perspective.

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.