Updated 2026-10-12

How to Fix "the supported api model names are deepseek-v4-pro or deepseek-v4-flash, but you passed gpt-5.6-sol"

This page decodes the error, gives the one-line fix for Codex CLI, Claude Code, and the OpenAI SDK, and covers every variant including `gpt-5.6-terra` and `gpt-6.1-sol`. It applies to any OpenAI-compatible gateway that serves DeepSeek V4 models — the fix does not require a new key, a new provider, or a support ticket.

1. What the error actually means

Nothing is wrong with your key or your endpoint — the request was rejected only because the model name you sent is not on this endpoint's allowlist. The message itself has three parts, and each one is useful:

The first half is the endpoint telling you its allowlist. The second half is the endpoint echoing back the `model` field it received from you. Your request authenticated successfully, reached a working DeepSeek V4-compatible gateway, and was rejected at model validation — before any tokens were generated or billed.

OpenAI-compatible gateways that front DeepSeek V4 models return this wording or something close to it: coding-plan providers, aggregator endpoints, and self-hosted LiteLLM-style proxies. The phrasing varies per gateway — this site's own gateway, for example, words the same rejection differently — but the diagnosis and the fix are identical.

A bad key produces a 401-style error; this is a 400-class invalid-model rejection. It usually happens for one of four reasons: you copied a config written for OpenAI or ChatGPT and changed the base URL and key but not the model name; your tool defaults to its built-in OpenAI model list and you never overrode the `model` field; you switched providers or relays but a saved profile or cached model list still carries the old name; or an environment variable exported in an old shell session is overriding your new config.

text
the supported api model names are deepseek-v4-pro or deepseek-v4-flash,
but you passed gpt-5.6-sol

2. The 30-second fix: change one line

Change the `model` field to one of the names the error itself lists — `deepseek-v4-pro` or `deepseek-v4-flash` — then restart your tool so the new configuration is picked up. In each major tool it is exactly one line:

If that already solves it, skip to section 9 to pick between Pro and Flash. If you want to confirm the diagnosis first, the next section has a one-request test.

text
# Codex CLI — ~/.codex/config.toml
model = "deepseek-v4-pro"   # was gpt-5.6-sol

# Claude Code
export ANTHROPIC_MODEL="deepseek-v4-pro"

# OpenAI SDK
client.chat.completions.create(model="deepseek-v4-pro", ...)

3. Confirm the fix with a single request

You can verify key, URL, and model name together with one curl call before touching any tool config. Replace `<base-url>` with the endpoint your key belongs to:

If that returns a completion, your key, URL, and model name are all correct, and the remaining work is only making your tool send the same name. The per-tool sections below show exactly where the old name hides.

bash
curl "<base-url>/chat/completions" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-pro",
    "messages": [{ "role": "user", "content": "ping" }]
  }'

4. Fix it in Codex CLI

Codex reads its model from `~/.codex/config.toml`. Set the top-level `model` to a DeepSeek name and make sure the provider block points at your DeepSeek-compatible endpoint:

Three Codex-specific places the old name can survive. Profiles: a `[profiles.<name>]` section can pin its own `model`, so if you launch with `codex --profile <name>`, check that profile too. Model catalogs: if your setup uses `model_catalog_json` or a cached catalog file, delete the stale catalog so it regenerates. Old terminals: start a fresh terminal after editing so nothing is inherited from the previous session.

toml
# ~/.codex/config.toml
model = "deepseek-v4-pro"          # was "gpt-5.6-sol"

[model_providers.deepseek]
name = "DeepSeek"
base_url = "https://<your-endpoint>/v1"
env_key = "DEEPSEEK_API_KEY"

5. Fix it in Claude Code

Claude Code picks models from environment variables. Set the main model and clear every default slot of leftover OpenAI-style names — Claude Code routes background calls through the default slots, so a GPT name left in one of them keeps triggering the error even after you fix the main variable:

Then restart the terminal (or re-source your shell profile) and confirm inside Claude Code with `/model`. If the error persists, grep your `.zshrc` or `.bashrc` for the old model name — a forgotten export there silently wins over your new settings.

bash
export ANTHROPIC_BASE_URL="https://<your-anthropic-compatible-endpoint>"
export ANTHROPIC_AUTH_TOKEN="<your-key>"

export ANTHROPIC_MODEL="deepseek-v4-pro"
export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-v4-pro"
export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-v4-pro"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4-flash"

6. Fix it in the OpenAI SDK (Python and Node)

In SDK code the model is just the `model` argument. It is commonly hardcoded, read from a `.env` file, or defaulted in a shared helper — search your project for the old name:

In Node the same change is `model: "deepseek-v4-pro"` in the `chat.completions.create` options. If the model name comes from an environment variable such as `OPENAI_MODEL`, update the variable's value — the code may be correct while the environment is stale.

python
from openai import OpenAI

client = OpenAI(
    api_key="<your-key>",
    base_url="https://<your-endpoint>/v1",
)

response = client.chat.completions.create(
    model="deepseek-v4-pro",              # was "gpt-5.6-sol"
    messages=[{"role": "user", "content": "ping"}],
)
print(response.choices[0].message.content)

7. Fix it in desktop and web apps

In apps such as Cherry Studio, LobeChat, or Cursor with a custom OpenAI-compatible provider, the model dropdown usually lists only the app's built-in providers. Add the DeepSeek model manually: open the provider or model settings for your custom endpoint, add a custom model, and type the name exactly — `deepseek-v4-pro` or `deepseek-v4-flash`. Model names are case-sensitive and must match character for character: no capitals, no trailing spaces.

Then delete or disable the stale `gpt-5.6-sol` entry so it stops being selected by default, start a new conversation, and select the DeepSeek model before sending.

8. What if the error says gpt-5.6-terra or gpt-6.1-sol?

`...but you passed gpt-5.6-terra` and `...but you passed gpt-6.1-sol` are the same failure with a different OpenAI model name in the `model` field. A newer release does not change the diagnosis — the endpoint still serves DeepSeek models only, and the name it lists in the error is the name to send. The fix is identical in every tool above.

Use one rule for every variant, including future ones and non-GPT names such as `claude-*` or `gemini-*`: the names in the first half of the error message are the valid model names for that endpoint; the name after "you passed" is only what you sent. Put a name from the first half into your `model` field and the error goes away.

9. Which model should you pass: deepseek-v4-pro or deepseek-v4-flash?

Both names fix the error, so pick by workload:

A practical default: start with `deepseek-v4-flash` for interactive loops where speed matters, and reach for `deepseek-v4-pro` when a task needs deeper reasoning or long-context coding work. For the full comparison, continue with `/guides/deepseek-v4-pro-vs-flash`, and check your provider's pricing page before committing to high volume. Whichever you choose, type the name exactly as the error lists it.

Both names fix the error; pick by workload
ModelBest forCharacter
deepseek-v4-proHard reasoning, long coding sessions, agentic multi-step workFlagship — strongest quality, priced accordingly
deepseek-v4-flashFast iteration, chat, high-volume and autocomplete-style trafficFast and low-cost

10. Changed the model name and still failing?

If the same request now fails differently, you have moved past the model-name problem and hit the next one. Debug in this order — each row eliminates one cause:

And the classic silent killer: environment variables exported in another shell, a Docker image built before the fix, or a tmux session older than your edit. When in doubt, restart everything once and retest.

Debug order — each row eliminates one cause
StepCheckIf you see thisWhat it means and what to do
1Resend one request with a model name from the error's own list (section 3)Same error againThe new name is not reaching the request — a profile, default slot, or env var is overriding it; rework the per-tool sections above
2Read the new error class401 / invalid keyAuthentication problem, not a model problem — re-copy the key and confirm it belongs to this endpoint
3Same check404 / not foundBase URL or path is wrong: a missing or extra `/v1`, or `/responses` against an endpoint that only exposes `/chat/completions`
4Compare the allowlist in the new error textA different model listYou are hitting a different gateway than you think — the allowlist identifies the endpoint you actually reached
5Check whose API you are onOfficial DeepSeek platform (`api.deepseek.com`)Its model names differ from relay allowlists (for example `deepseek-flash`); list the models your key can call instead of guessing
6Using a DeepSeek V4 Hub Coding Plan key—Accepted names are exactly four: `deepseek-flash` (default), `deepseek-v4-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-vision-exp`, served at `https://api.deepseekv4pro.com/v1`; the delivery page has the ready-made config for each tool

Sources

FAQ

the supported api model names are deepseek-v4-pro or deepseek-v4-flash, but you passed gpt-5.6-sol

Your key and endpoint are working; only the model name is wrong. Change the `model` field from `gpt-5.6-sol` to `deepseek-v4-pro` or `deepseek-v4-flash`, restart your tool, and resend — the configs above show the exact line for Codex CLI, Claude Code, and the OpenAI SDK.

the supported api model names are deepseek-v4-pro or deepseek-v4-flash, but you passed gpt-6.1-sol

Same diagnosis with a newer OpenAI model name (`gpt-5.6-terra` behaves the same way). The fix is identical: send a model name from the first half of the error.

Does this error mean my API key is broken?

No. The gateway authenticated your key and then rejected the request on the model field. A broken key returns a 401-style authentication error instead. Keep your key; change the model name.

Do I need to change my base URL?

No. If you received this exact error, your request already reached a working DeepSeek V4-compatible endpoint. Only the `model` field needs to change.

Can I still use gpt-5.6-sol somewhere?

Yes — on OpenAI's own endpoint with an OpenAI API key. Model names are per-endpoint, not universal. A DeepSeek-serving gateway will not accept OpenAI model names, and vice versa.

Why does my endpoint accept only two models when DeepSeek publishes more?

Gateways and relays configure their own allowlists. The names listed in the error message itself are the authoritative list for that endpoint. The official DeepSeek platform API uses a different, larger set of model names.

Will changing the model name cost me anything?

No. Requests rejected with this error fail model validation before any tokens are generated, so nothing was billed for the failed call.

The error looks alarming but says exactly what to do: your endpoint serves DeepSeek V4 models, and your request asked for an OpenAI one. Copy a name from the error's own list — `deepseek-v4-pro` for heavy work, `deepseek-v4-flash` for speed — set it everywhere your tool can inject a model name (config, profiles, default slots, environment variables), restart, and retest. The same rule covers every variant, including `gpt-5.6-terra` and `gpt-6.1-sol`. This page is maintained as new model-name variants appear — last updated October 12, 2026 by the DeepSeek V4 Hub editorial team.

Related model comparisons

Continue from this guide into structured DeepSeek-first comparison pages with model tables, routing advice, and pricing context.