Configure Claude Code to use alternative AI model providers by setting up custom API endpoints and authentication...
This skill configures .claude/settings.local.json to use alternative AI model providers that offer Anthropic-compatible APIs. It guides the setup of custom base URLs, model selections, and API authentication for providers beyond the default Anthropic service.
Use this skill when users:
Read the provider configurations from references/providers.json to understand available providers, their base URLs, and supported models.
The JSON structure contains:
Use the AskUserQuestion tool to present available providers to the user. Structure the question as follows:
Question format:
After the user selects a provider, use AskUserQuestion again to let them choose a model from that provider's available models.
Question format:
Use AskUserQuestion to collect the API key for the selected provider.
Question format:
Important: If the user selects "Other" and provides a custom text input, that is their API key. If they choose "I'll add it manually later", use the placeholder "<YOUR_API_KEY_HERE>".
Read the existing .claude/settings.local.json file if it exists. If it doesn't exist, create a new one.
Update or create the configuration with the following structure:
{
"env": {
"ANTHROPIC_BASE_URL": "<selected provider's baseUrl>",
"ANTHROPIC_MODEL": "<selected model's id>",
"ANTHROPIC_AUTH_TOKEN": "<user's API key or placeholder>"
}
}
Important considerations:
After updating the configuration file, inform the user:
.claude/settings.local.json<YOUR_API_KEY_HERE> with their actual API keyTo add new model providers to this skill, edit references/providers.json and add a new provider object with the following structure:
{
"id": "unique-provider-id",
"name": "Display Name",
"description": "Brief description of the provider",
"baseUrl": "https://api.example.com/v1",
"models": [
{
"id": "model-identifier",
"name": "Model Display Name",
"description": "Brief description of the model"
}
]
}
Contains the configuration database for all supported model providers. This file includes:
This file should be read at the start of the workflow to populate the provider and model selection options.