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:
- 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?
- 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.
5 Comments
Also, what kind of data is collected by Anthropic other than the three listed here (Statsig, Sentry, Bug reports)?
Will setting
ANTHROPIC_BASE_URLto a private endpoint andCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1ensure that Anthropic does not collect any data? Is there anything else not listed here that is collected?Currently, using Claude Code with non-Anthropic models is unsupported.
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.
@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.
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.