Claude Code & Desktop

Claude Code and Desktop setup guide

Use your active Codex Pay balance with Anthropic's official Claude Code CLI, the Claude desktop app (Code mode only), and VS Code, Cursor, or JetBrains plugins. No Anthropic account sign-in is required.

1

Use your existing Codex Pay balance

No separate Claude subscription or Anthropic sign-in is needed. Copy your Base URL and Pay API Key from Dashboard β†’ Claude Code.

2

Pick Desktop, CLI, or an IDE plugin

Most users prefer the Claude desktop app (no terminal needed). Developers in terminals or servers can use Claude Code CLI or editor plugins.

3

Use Code mode, not ordinary Chat

In Claude Desktop, enable Developer mode on the Sign In screen, enter the Gateway URL & key, relaunch, and work inside the Code tab.

Supported clients: PhotonMark Claude routes accept only the official Claude Code clients (CLI, VS Code / Cursor, JetBrains, and Claude Desktop's Code mode). Ordinary Claude Desktop chat, third-party API aggregators/relay panels, and non-official clients or scripts are refused with HTTP 403/405. If a route is slow or unavailable, check the status page and switch to another available route.

Choose your setup path

Claude desktop app (Code mode)

Graphical app for macOS, Windows, and Linux (beta). Uses the built-in Developer gateway settings rather than CLI settings.json.

Desktop setup

Claude Code CLI (terminal)

For terminals and servers on macOS, Linux, WSL, and Windows. Configured once in ~/.claude/settings.json.

CLI setup

VS Code, Cursor & JetBrains

Works inside your editor and shares ~/.claude/settings.json with the CLI.

Editor plugin setup

CC Switch (one-click import)

Already use CC Switch? Import PhotonMark from the Dashboard in one click instead of editing settings.json.

CC Switch setup

Before you start & choosing a route

  • Codex Pay required: Claude routes use your Codex Pay balance and Pay API Key (from Dashboard β†’ Claude Code). Codex Link and Codex Boost cannot be used for Claude routes.
  • No Anthropic login required: Install the client and enter your PhotonMark Base URL and Pay API Key directly.
  • Keep the client updated: Older Claude Code releases (before 2.1.321) reject claude-fable-5-2 locally.
RouteBase URLNotes
Mixed (recommended Β· default) https://codex.photonmark.com/anthropic-mixed Opus 5.5, Sonnet 5.5, and Haiku 5.5 run on our self-managed line (prompt non-storage commitment); Fable 5.2 routes through a third-party supplier for lower cost (Fable on Mixed does not carry the self-managed prompt-non-storage commitment).
Self-managed (all-model privacy) https://codex.photonmark.com/anthropic All models including Fable 5.2 run on the self-managed line. Legacy /anthropic3 still points here temporarily for about one month.
Route 2 (third-party backup) https://codex.photonmark.com/anthropic2 Third-party supplier backup channel. Check the status page before switching.
Route 1 (third-party) https://codex.photonmark.com/anthropic1 Third-party channel (availability shown on the status page; no Haiku 5.5).

Exact per-model prices are on the pricing page, and live route availability is on the status page. Effort is capped across all routes (Fable: Medium; Opus and Sonnet: High), and fast mode (/fast) is not available.

1. Claude desktop app (Code mode only)

Important: The Claude desktop app does not read the CLI's ~/.claude/settings.json, and ordinary Desktop Chat is not supported. After saving the gateway settings below, make sure you switch to the Code tab (local coding session) rather than sending messages in the Chat tab, or the proxy will return HTTP 403.

01

Install the official Claude desktop app

Download and install the latest macOS, Windows, or Linux (beta) build from Downloads β†’ Claude desktop app. Launch the app and leave it on the initial Sign In screen β€” do not sign up or sign in with Anthropic.

02

Turn on Developer mode

On the initial Sign In screen (no Anthropic sign-in needed), open the menu button (☰ in the top left on Windows/Linux, or the top menu bar on macOS) and go to Help β†’ Troubleshooting β†’ Enable Developer Mode.... Confirm the prompt so the app restarts; after restart, a new Developer menu appears.

Opening Help β†’ Troubleshooting β†’ Enable Developer Mode directly from the Sign In screen.
Claude Desktop Sign In screen with the top-left menu open to Help, Troubleshooting, and Enable Developer Mode
03

Configure third-party inference (Gateway)

Open Developer β†’ Configure third-party inference, then fill in these fields under Connection:

  • Connection: choose Gateway.
  • Credential kind: choose Static API key.
  • Gateway base URL: copy your chosen route from Dashboard β†’ Claude Code, for example https://codex.photonmark.com/anthropic-mixed (or https://codex.photonmark.com/anthropic for the all-model self-managed line). Do not append /v1 or a trailing slash.
  • Gateway API key: paste your PhotonMark Pay API Key from Dashboard β†’ Claude Code.
  • Gateway auth scheme: choose bearer.
  • Artifact preview iframe origin: leave blank; keep Model discovery enabled.

You can click Test connection in the top right (our proxy answers Desktop's built-in gateway probe automatically), then save the settings for this computer and relaunch Claude Desktop.

Claude Desktop β†’ Configure third-party inference β†’ Connection example (/anthropic shown here; you can also use /anthropic-mixed or another open route, and enter your own Pay API Key).
Claude Desktop Configure third-party inference Connection dialog showing Gateway, Static API key, Gateway base URL, masked Gateway API key, bearer auth scheme, and Test connection button
04

Switch to the Code workspace and test

After relaunch, click the Code tab (not Chat), open a local project folder, select a supported model (such as Sonnet 5.5, Opus 5.5, or Fable 5.2), and send a short test prompt.

What the Desktop app saves (reference)
{
  "inferenceGatewayBaseUrl": "https://codex.photonmark.com/anthropic-mixed",
  "inferenceGatewayApiKey": "your Pay API Key",
  "modelDiscoveryEnabled": true,
  "inferenceProvider": "gateway",
  "inferenceCredentialKind": "static"
}

Switching routes or returning to an official Anthropic login: Reopen Developer β†’ Configure third-party inference at any time to change the Gateway base URL (for example to /anthropic or /anthropic2) or switch back to official Claude sign-in. Official Anthropic history and gateway sessions are kept separately.

2. Claude Code CLI (terminal)

01

Install the CLI

Use the official installer from Downloads β†’ Claude Code CLI (recommended because it updates itself automatically):

  • macOS / Linux / WSL: curl -fsSL https://claude.ai/install.sh | bash
  • Windows PowerShell: irm https://claude.ai/install.ps1 | iex

Open a new terminal and run claude --version to verify the install. On Windows, installing Git for Windows is recommended so Claude Code can run its Bash tool.

02

Write ~/.claude/settings.json

Create or edit the user-level settings file at ~/.claude/settings.json (Windows: C:\Users\your-username\.claude\settings.json; create the .claude folder if it does not exist yet). If the file already has an env block, merge the entries below into it, or copy the pre-filled block with your Pay API Key from Dashboard β†’ Claude Code:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://codex.photonmark.com/anthropic-mixed",
    "ANTHROPIC_AUTH_TOKEN": "your Pay API Key",
    "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "400000"
  }
}

Keep your Pay API Key out of shared repositories or public files. CLAUDE_CODE_AUTO_COMPACT_WINDOW is optional and recommended so long sessions compact near 400,000 tokens.

03

Start Claude Code and test

Open a new terminal inside your project folder, run claude, and send a short test prompt. Usage appears under Dashboard β†’ Usage & billing.

Optional: set up the CLI and plugins with CC Switch

CC Switch is a third-party open-source app that writes the Claude Code settings for you and lets you switch between providers. It configures the same ~/.claude/settings.json as step 2, so it covers the CLI and the editor plugins; for the Claude desktop app use the built-in gateway setting in step 1.

01

Install CC Switch (v4.0.10 or later)

  • Windows 10 or later: download the .msi installer from the latest release.
  • macOS 12 or later: brew install --cask cc-switch, or the .dmg from the same release page.
  • Linux: the .deb, .rpm or .AppImage from the same release page.

Claude Code itself must be installed first (step 2, "Install the CLI").

02

Import PhotonMark in one click

Open Dashboard β†’ Claude Code, pick a route, and click Import into CC Switch (Claude Code). Your browser asks to open CC Switch; check that the request URL is the route you picked, then click Import. The link is built in your browser with your Pay API Key and is not sent anywhere else.

Prefer to type it in? In CC Switch choose Claude Code, add a custom provider, enter the route URL from the Dashboard (for example https://codex.photonmark.com/anthropic-mixed) as the request URL and your Pay API Key as the API key. Do not pick another site's preset.

03

Switch to it and test

Click the switch button on the PhotonMark card so it shows as in use, restart Claude Code (or reload the editor window), and send a short test prompt.

Keep CC Switch in direct mode. Do not turn on its routing / local proxy mode for PhotonMark: our Claude routes accept only requests sent unchanged by the official Claude Code client, and requests relayed by a local proxy may be refused.

Codex Pay can be imported the same way from the Pay card in the Dashboard; see the CC Switch FAQ for Codex.

3. Editor plugins (VS Code, Cursor & JetBrains)

Complete CLI configuration (~/.claude/settings.json) first; editor plugins read the same configuration.

VS Code / Cursor

Install the official Claude Code extension from the Downloads page (requires VS Code 1.94+; in Cursor, search for Claude Code in Extensions). The extension reads ~/.claude/settings.json. If it still displays an Anthropic sign-in screen, turn on Disable Login Prompt in the Claude Code extension settings and reload the window.

JetBrains IDEs

For IntelliJ IDEA, PyCharm, WebStorm, GoLand, Android Studio, and other JetBrains IDEs. The plugin invokes the local claude command, so install and configure the Claude Code CLI first, install the plugin from the Downloads page, and restart the IDE.

Usage tips & troubleshooting

Claude Code usage tips

  • The context limit is about 1 million tokens, and requests fail near it. Use /compact before then, or /clear to start a new session.
  • Every turn sends the context again, so longer sessions cost more. Start a new session when you change task.
  • We suggest adding this entry to env in the command-line ~/.claude/settings.json (Windows: C:\Users\your-username\.claude\settings.json). Claude Code then compacts automatically as the context nears 400,000 tokens, which helps control the cost of long sessions:
    "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "400000"
  • Above 100,000 input tokens, Haiku 5.5 costs 5 times its standard rate.
  • A cancelled request may keep running upstream and is billed for its actual usage.

Common errors and fixes

Symptom / error What to check
HTTP 403 client_not_allowed You are either sending a message in Claude Desktop's ordinary Chat tab instead of the Code tab, or calling the route from an unsupported third-party client, curl, or Agent SDK script. Switch to Desktop's Code workspace or the official Claude Code CLI / IDE plugin.
HTTP 403 with Claude Code auto mode Claude Code auto mode's classifier requests are not supported on Claude routes. Turn off auto mode and confirm actions normally.
HTTP 402 / insufficient balance Check your Codex Pay balance in Dashboard. Requests require more than the $0.10 balance buffer plus active in-flight reserves; top up Pay and retry.
unrecognized_model for claude-fable-5-2 Your Claude Code client is out of date (CLI versions before 2.1.321 reject Fable 5.2 locally). Upgrade Claude Code or Claude Desktop to the latest release.
HTTP 429 too many active Claude sessions On the self-managed line each API key can have a limited number of Claude sessions active at once (4 by default) and a limited number of different sessions within 15 minutes (6 by default). A session stays active until about 3 minutes after its last request; every new window, /clear, or claude -p run starts another one, while subagents share the session they belong to. Continue in a session you used recently, or wait a few minutes before starting a new one. Refused requests are not charged.
Slow responses, 502, 503, or 429 Check the status page and switch your Base URL to another open route (for example between /anthropic-mixed, /anthropic, and /anthropic2). Avoid high-frequency parallel multi-agent bursts on the self-managed line.
Safety filter keeps blocking the same conversation In Claude Code, press Esc twice (or run /rewind) and restore the conversation only to before the blocked message, or run /clear to start fresh. See FAQ: safety filter.

Official Anthropic documentation: Claude Code setup, Connect Desktop app to an LLM gateway, and Claude Desktop third-party inference configuration.