Skip to content

Feature Request: Support custom API endpoint / base URL for Claude Code #483

Description

@nicola2241426

Feature Request: Custom API Endpoint Support

Summary

Please add support for custom API endpoints (base URL) to enable using Claude Code with alternative API providers, such as Zhipu AI's Anthropic-compatible API in China.

Problem

Currently, Claudian appears to hardcode the official Anthropic API endpoint (https://api.anthropic.com). This prevents users from using alternative API providers that offer Anthropic-compatible interfaces.

Use Case:

  • Users in China need to use domestic API providers (like Zhipu AI) due to network restrictions
  • Users who want to use alternative API providers for cost or privacy reasons
  • Users whose Anthropic accounts may be disabled but have valid alternative API keys

Environment Configuration Attempted

I've configured the following in ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_API_KEY": "user_api_key",
    "ANTHROPIC_AUTH_TOKEN": "user_api_key", 
    "ANTHROPIC_BASE_URL": "https://open.bigmodel.cn/api/anthropic",
    "ANTHROPIC_ORGANIZATION_ID": ""
  }
}

And verified the alternative API works correctly:

  • ✅ Direct API calls to the custom endpoint work
  • ✅ Anthropic-compatible interface tests pass
  • ❌ Claudian still returns "This organization has been disabled" error

Suggested Solutions

Option 1: Add plugin setting for custom base URL
Add a configuration option in Claudian's settings panel:

{
  "claudeCodeBaseUrl": "https://api.anthropic.com" // default
}

Option 2: Respect environment variables
Ensure Claudian properly passes through ANTHROPIC_BASE_URL environment variable to the Claude Code CLI process.

Option 3: Support custom Claude Code CLI arguments
Allow users to specify additional CLI arguments when launching Claude Code.

Verification

I can provide test credentials for the alternative API provider if needed for testing.

Additional Context

  • Claudian version: 2.0.2
  • macOS: Darwin 25.3.0
  • Claude Code CLI installed and working

Thank you for developing this excellent plugin! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions