Configuring a Third-Party API in Claude Code

If you want to use a third-party API in Claude Code, you need to modify or create the settings.json configuration file.

After the configuration is complete, restart Claude Code for it to take effect.

Configuration File Location

  • MacOS / Linux: ~/.claude/settings.json

  • Windows: %userprofile%\.claude/settings.json

If this file does not exist, create it first; if it already exists, replace its original contents with the following:

{

  "env": {

    "ANTHROPIC_BASE_URL": "https://rehdasu.cn",

    "ANTHROPIC_AUTH_TOKEN": "sk-xxxxxxxxx",

    "ANTHROPIC_MODEL": "gpt-5.4-mini",

    "CLAUDE_CODE_ATTRIBUTION_HEADER": "0"

  },

  "alwaysThinkingEnabled": true,

  "effortLevel": "medium"

}

Configuration Notes

  • Change ANTHROPIC_AUTH_TOKEN to the real key you obtained from the platform.

  • Change ANTHROPIC_MODEL to the name of the model you want to use.

  • Change effortLevel to the reasoning strength you want to use.

  • The supported levels are: low, medium, and high.

  • Not all models support every level. For example, gpt-5.1-codex does not support high.

If you are not sure what to enter for now, you can keep these values first:

  • ANTHROPIC_MODEL = "gpt-5.4-mini"

  • effortLevel = "medium"

After Configuration Is Complete

After making the changes, restart Claude Code.

If it still does not take effect after restarting, check these items first:

  • Whether ANTHROPIC_BASE_URL is https://rehdasu.cn

  • Whether ANTHROPIC_AUTH_TOKEN is filled in correctly

  • Whether ANTHROPIC_MODEL matches the permissions of your key

  • Whether effortLevel is supported by the current model