CLAUDE_AI_ORIGIN

Updated by

CLAUDE_AI_ORIGIN is a Claude Code environment variable: Overrides the base URL for Claude AI authentication endpoints. This complements the existing CLAUDE_CODE_API_BASE_URL (which controls the inference endpoint) by allowing the OAuth/auth origin to be pointed elsewhere — useful for corporate environments with custom auth gateways, staging environments, or air-gapped…. Added in v2.1.84 and still present in v2.1.294. It is not in the official reference.

StatusPresent in v2.1.294
AddedAdded in v2.1.84
CategoryOther
Official docsNot listed

How to set it

For one session, export it in the shell that starts Claude Code:

export CLAUDE_AI_ORIGIN=<value>
claude

To apply it to every session, add it to the env object of a settings file:

// ~/.claude/settings.json
{
  "env": {
    "CLAUDE_AI_ORIGIN": "<value>"
  }
}

Release notes that mention it

Related variables

Frequently asked questions

What does CLAUDE_AI_ORIGIN do?

Overrides the base URL for Claude AI authentication endpoints. This complements the existing CLAUDE_CODE_API_BASE_URL (which controls the inference endpoint) by allowing the OAuth/auth origin to be pointed elsewhere — useful for corporate environments with custom auth gateways, staging environments, or air-gapped…

Which Claude Code version has CLAUDE_AI_ORIGIN?

Added in v2.1.84 and still present in v2.1.294.

How do I set CLAUDE_AI_ORIGIN?

Export it before starting Claude Code (export CLAUDE_AI_ORIGIN=value), or add it to the "env" object in ~/.claude/settings.json to apply it to every session.

All variables, searchable: Claude Code environment variables.