Configuration Generator
Generate the settings file content with your API credentials. Your keys never leave your browser.
The base URL of your OpenAI-compatible API endpoint
Your API key - stored locally, never sent to our servers
Model identifier (e.g., gpt-4o, llama-3.1-70b, claude-3.5-sonnet)
Generated Configuration
Add this to your settings file
{
"env": {
"CLAUDE_CODE_USE_OPENAI_COMPATIBLE": "1",
"OPENAI_COMPATIBLE_BASE_URL": "https://api.openai.com/v1",
"OPENAI_COMPATIBLE_API_KEY": "<your-api-key>",
"OPENAI_COMPATIBLE_MODEL": "gpt-4o"
}
}Or export as environment variables in your shell:
export CLAUDE_CODE_USE_OPENAI_COMPATIBLE=1
export OPENAI_COMPATIBLE_BASE_URL="https://api.openai.com/v1"
export OPENAI_COMPATIBLE_API_KEY="<your-api-key>"
export OPENAI_COMPATIBLE_MODEL="gpt-4o"How to Configure Claude Code for OpenAI-Compatible APIs
Claude Code CLI can be configured to work with any OpenAI-compatible API provider. This configuration generator helps you create the correct settings.json file with all required environment variables.
Required Environment Variables
- CLAUDE_CODE_USE_OPENAI_COMPATIBLE: Set to "true" to enable OpenAI-compatible mode
- OPENAI_COMPATIBLE_BASE_URL: The base URL of your API provider (e.g., https://openrouter.ai/api/v1)
- OPENAI_COMPATIBLE_API_KEY: Your API key from the provider
- OPENAI_COMPATIBLE_MODEL: The model identifier to use (e.g., anthropic/claude-3.5-sonnet)
Security Note
This configuration generator runs entirely in your browser. Your API keys and credentials are never sent to any server. Simply copy the generated configuration and paste it into your local settings file.