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.com",
"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.com, 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.com"
},
"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.comDo not use https://api.lmuai.com/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.com - 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:
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 upClaude Code extension (VS Code / Cursor / Trae / Antigravity)
Download VS Code, install the Claude Code extension, and connect it to the LMU AI API — a full walkthrough that shares one settings.json with the CLI.
Codex CLI (Mac/Linux)
Install and configure the Codex CLI on Mac / Linux to connect to the LMU AI API, including how to enable the 1M-token long context in config.toml.