# How to run Claude Code on GLM, DeepSeek, or Kimi (/blog/claude-code-with-other-models)

Point Claude Code at OhMyGPT, list the models that accept the Anthropic Messages protocol, and switch between them without changing the Claude Code setup.

Claude Code sends every request in the Anthropic Messages format. If a model accepts that format, Claude Code can use it. On OhMyGPT, GLM, DeepSeek, Kimi, and GPT models accept it, so you can change the model and keep your Claude Code setup.

You need Claude Code and an [OhMyGPT API key](https://www.ohmygpt.com/keys).

## Connect Claude Code [#connect-claude-code]

Set two variables in the shell that starts Claude Code, and then choose a model with a third one:

```bash
export ANTHROPIC_BASE_URL="https://api.ohmygpt.com"
export ANTHROPIC_AUTH_TOKEN="$OHMYGPT_API_KEY"
export ANTHROPIC_MODEL="zhipu/glm-5.3"
claude
```

Do not add `/v1` to the base URL. Claude Code adds `/v1/messages` itself, and a second `/v1` makes every request return `404`.

To check the connection, run `/status` in Claude Code. The **Anthropic base URL** line shows `https://api.ohmygpt.com`.

## Test without paying for tokens [#test-without-paying-for-tokens]

The model `ohmygpt/mock` is free. It is available after you top up your account for the first time. Start Claude Code on it to test the key, the base URL, and one tool call:

```bash
claude --model ohmygpt/mock
```

## Find a model that works [#find-a-model-that-works]

The catalog changes often, so list the models instead of copying IDs from an article. This command prints each available model that accepts the Messages format:

```bash
curl -s https://api.ohmygpt.com/v1/models \
	| jq -r '.data[] | select(.available and any(.protocols[]?; .id == "anthropic-messages")) | .id'
```

On 22 November 2026, the command printed 151 IDs. Four of them are:

| Model ID | Context window in tokens |
|---|---|
| `zhipu/glm-5.3` | 1,048,576 |
| `moonshot/kimi-k3.1-pro` | 1,048,576 |
| `deepseek/deepseek-v4.1-flash-1017` | 1,000,000 |
| `anthropic/claude-sonnet-5-5` | 1,000,000 |

The [Models](https://www.ohmygpt.com/models) page shows the price of each model, and the [Rankings](https://www.ohmygpt.com/rankings) page compares their capability scores.

## Switch models during a session [#switch-models-during-a-session]

Type `/model` and a model ID:

```text
/model moonshot/kimi-k3.1-pro
```

Claude Code also runs background work, such as session titles, on a Haiku-class model. If you want that work on another model, set it before you start Claude Code:

```bash
export ANTHROPIC_DEFAULT_HAIKU_MODEL="zhipu/glm-5.3"
```

Stay on one model within a long task. Each model keeps its own prompt cache, so the first request after a switch reads nothing from the cache. [How to cut agent costs with prompt caching](/blog/prompt-caching-costs) shows the numbers.

## Let omgvibe set the variables [#let-omgvibe-set-the-variables]

[omgvibe](https://github.com/DogeNet-LLC/omgvibe) is our open-source command-line tool. It starts Claude Code with the key, the endpoint, and the model for that session only. It does not edit the Claude Code configuration files.

```bash
npm install -g omgvibe
ov claude --model zhipu/glm-5.3
```

omgvibe needs Node.js 20.12 or newer. The same command starts Codex (`ov codex`) and opencode (`ov opencode`).

## Know the limits [#know-the-limits]

Claude Code is built for Claude models. Other models run its tools, but prompts that Anthropic tuned for Claude can produce different results on them. Compare models on one real task from your repository before you move a team.

If a request fails, the [Claude Code guide](/docs/code-cli/claude-code#troubleshooting) lists each error with its cause and its fix.
