Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.bettertoken.ai/llms.txt

Use this file to discover all available pages before exploring further.

After you configure the BetterToken Gateway in Claude Desktop, the following symptoms usually do not mean the API Key itself is invalid:
  • Cowork mode does not work
  • Code mode shows Claude Code process exited with code 1
  • The same API Key works in Claude Code CLI from a terminal
These issues usually come from two separate causes: the desktop Gateway auth scheme does not match the API Key group, or the bundled Claude Code version in Claude Desktop has not finished updating. If you have not configured the Gateway yet, start with Use BetterToken API in Claude Desktop.

Fix Cowork mode first

Root cause: Gateway auth scheme does not match the API Key group. In Claude Desktop Gateway settings, choose the auth scheme based on the API Key group:
  • If the API Key belongs to a Claude group, set Gateway auth scheme to x-api-key
  • If the API Key belongs to a Codex group, set Gateway auth scheme to bearer
After you select the correct scheme, Claude Desktop automatically fetches the available models for that group. If the auth scheme is wrong, Cowork mode may fail Gateway authentication.
1

Open third-party inference settings

In the macOS menu bar, choose DeveloperConfigure Third-Party Inference….
2

Change the auth scheme

Choose Gateway auth scheme based on the API Key group: use x-api-key for a Claude group and bearer for a Codex group.
3

Save the config

Click Apply locally to save the local Gateway config.
Cowork mode usually works again after this change.

Then fix Code mode exit errors

If Cowork works but Code mode, the </> tab, still shows Claude Code process exited with code 1, check whether Claude Desktop is still using an older bundled Claude Code version. Root cause: Claude Desktop may be downloading a newer Claude Code version in the background. Before the download finishes, Code mode can fall back to an older installed Claude Code version. That older version may not be compatible with third-party Gateway usage in Code mode, so the process exits immediately. How to fix it:
1

Wait for the newer Claude Code version to finish downloading

Keep Claude Desktop open for a while so the background Claude Code update can complete.
2

Fully quit Claude Desktop

Use Cmd+Q to fully quit the app. Do not only close the window.
3

Reopen and start a new Code session

Open Claude Desktop again, then go to Code mode and start a new session.
If logs show Claude Desktop falling back to an older Claude Code version, such as 2.1.111, while a newer version, such as 2.1.119, is not ready yet, wait for the newer version to finish downloading and then restart the app.

Quick reference

SymptomCommon root causeFix
Cowork mode does not workGateway auth scheme does not match the API Key groupUse x-api-key for a Claude group or bearer for a Codex group, then click Apply locally
Code mode shows Claude Code process exited with code 1Claude Desktop falls back to an older Claude Code versionWait for the newer version to finish downloading, fully quit with Cmd+Q, then reopen