Configure GPT models in Claude Code
Use GPT models (e.g. gpt-5.6-sol) in Claude Code via the LMU AI API: plan prerequisites, the settings.json config, and switching with /model.
Claude Code can call GPT models through the LMU AI API, for example gpt-5.6-sol, gpt-5.6-terra, and gpt-5.5.
Prerequisites
You need to meet one of the following:
- Have subscribed to a GPT plan
- Use pay-as-you-go billing and have selected the GPT group in the LMU AI console
If your current plan or group doesn't include GPT models, you may still get a no-permission or model-unavailable error even after configuring.
Config file location
Claude Code's config file is settings.json.
~/.claude/settings.jsonC:\Users\YourUsername\.claude\settings.jsonOption 1 — Full config (recommended)
The full config maps Claude Code's internal Opus / Sonnet / Haiku default models to GPT models. Once configured, launching Claude Code uses the corresponding GPT model by default.
Open settings.json in a text editor and add the following (replace the key with your own LMU AI API Key):
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-your-lmu-ai-api-key",
"ANTHROPIC_BASE_URL": "https://api.lmuai.ai",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-5.4",
"ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME": "gpt-5.4",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "gpt-5.6-sol",
"ANTHROPIC_DEFAULT_OPUS_MODEL_NAME": "gpt-5.6-sol",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-5.5",
"ANTHROPIC_DEFAULT_SONNET_MODEL_NAME": "gpt-5.5"
},
"skipDangerousModePermissionPrompt": true,
"model": "opus"
}Field reference:
| Field | Description |
|---|---|
ANTHROPIC_AUTH_TOKEN | The LMU AI API Key — enter your own sk- key |
ANTHROPIC_BASE_URL | The LMU AI API address; for Claude Code, use https://api.lmuai.ai, without /v1 |
ANTHROPIC_DEFAULT_OPUS_MODEL / ANTHROPIC_DEFAULT_OPUS_MODEL_NAME | Maps Claude Code's Opus default model to gpt-5.6-sol |
ANTHROPIC_DEFAULT_SONNET_MODEL / ANTHROPIC_DEFAULT_SONNET_MODEL_NAME | Maps the Sonnet default model to gpt-5.5 |
ANTHROPIC_DEFAULT_HAIKU_MODEL / ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME | Maps the Haiku default model to gpt-5.4 |
model | The model tier selected when Claude Code launches; here it's opus, which maps to gpt-5.6-sol above |
Model mapping
With the full config above:
- Selecting
opusin Claude Code → actually callsgpt-5.6-sol - Selecting
sonnetin Claude Code → actually callsgpt-5.5 - Selecting
haikuin Claude Code → actually callsgpt-5.4
Option 2 — Minimal config
If you just want to configure the key and Base URL first, you can use the minimal config:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-your-lmu-ai-api-key",
"ANTHROPIC_BASE_URL": "https://api.lmuai.ai"
},
"skipDangerousModePermissionPrompt": true,
"model": "opus"
}The minimal config doesn't map opus to gpt-5.6-sol ahead of time. After launching Claude Code, run this manually in Claude Code:
/model gpt-5.6-solThe current session then switches to gpt-5.6-sol.
When to use the minimal config?
If you often switch between different GPT models, use the minimal config and specify one with /model <model-name> after each launch, e.g. /model gpt-5.6-sol.
If you want gpt-5.6-sol to be the default on every launch, use the full config above.
Common issues
Should the Base URL include /v1?
Claude Code connects to the LMU AI API using the Anthropic protocol, so use:
https://api.lmuai.aiDo not use https://api.lmuai.ai/v1.
Can I just set model to gpt-5.6-sol?
We recommend one of two approaches instead:
- Use the full config, mapping
ANTHROPIC_DEFAULT_OPUS_MODELtogpt-5.6-soland keeping"model": "opus" - Use the minimal config and run
/model gpt-5.6-solafter launch
Both fit Claude Code's model-tier configuration approach better, and make switching and reverting clearer.
What if it still doesn't work after configuring?
Check the following:
- Whether the API Key is a key generated in the LMU AI console
- Whether
ANTHROPIC_BASE_URLishttps://api.lmuai.ai - Whether you've subscribed to a GPT plan, or, on pay-as-you-go, selected the GPT group
- Whether the model name is spelled correctly, e.g.
gpt-5.6-sol
To see the currently supported models, check the Model Gallery.
Last updated:
Still have questions? Ask in the LMU AI Community (in Chinese) and sign in with your console account.
Get an LMU AI key and start using Claude, Codex and more
Free sign-up, flexible plans, one key across Claude Code, Codex CLI, Cursor, VS Code, OpenCode, Cherry Studio and other AI tools.
Sign up