Contenox

Claude coding agent on Windows: API key setup

Updated

Anthropic (Claude)

To run a Claude coding agent on Windows, open the Code tab in Claude Desktop, use the Claude Code extension in your editor, or run claude in PowerShell. A personal subscription, a team seat and a Console API key are different billing choices. In Contenox Harness, choose Anthropic to connect a key for the built-in agent. Choose Agents → Claude Code to run the external agent. Claude Code overview

Use Claude with your agent#

Agent Supported? How Note
Claude Code Yes Open the Code tab in Claude Desktop, the IDE extension, or run claude. A Claude subscription or an invited team seat uses its own allowance. Console or cloud credentials bill the associated account.
Codex CLI No Codex talks to custom providers through the OpenAI Responses API only. Anthropic’s OpenAI compatibility covers Chat Completions, and is meant for testing.
OpenCode Yes, API key /connect → Anthropic → paste a Console key Max, Ultra and Team include monthly API credits for this.
Contenox Harness Yes Backends → Providers → Anthropic takes a Console API key. Agents → Claude Code installs the external agent. The external agent offers Console sign-in by default. Personal subscription sign-in is an optional unofficial setting.

Can I use my Claude Pro or Max subscription?#

Your options depend on the application and on which account should pay for the work.

  • In Claude Code. Sign in with your plan. Usage counts against the plan’s limits.
  • In a host app. Anthropic distinguishes a customer signing in to its unmodified Claude Code binary from a third-party application routing requests with subscription credentials. Contenox Harness labels subscription sign-in for its external agent unofficial and ships it switched off. Anthropic’s credential-use terms · Contenox Harness setup
  • Through the monthly API credits. Max, Ultra and Team plans now include API credits every month: $100 on Max, $200 on Ultra, up to $500 pooled on Team. Link a Claude Console organization under Settings → Billing → API credits on claude.ai (on Team, Organization settings → Billing), create an API key there, and use it in any agent, OpenCode included. The credits don’t roll over, and they don’t cover Claude Code itself. Pro, Free and Enterprise plans don’t get them.

The plugin trap: there are third-party plugins that make OpenCode and other tools sign in with a Claude plan directly. Anthropic’s terms forbid routing requests through Free, Pro, Max or Ultra plan credentials in other developers’ products, and Anthropic says it may enforce this without notice. You risk the account the plan is on.

The free Claude.ai plan does not include Claude Code.

A case for a second provider: on 12 June 2026, Anthropic’s statement said a US export-control directive required suspending all access to Fable 5 and Mythos 5 by foreign nationals. Complying meant switching both models off for every customer, while other Claude models kept working. Anthropic’s later post reports the controls lifted on 30 June. The same event is retold in Shouldn’t AI Move From Cloud to Local Compute? as the reason a connected second provider is worth having: access to one model can end overnight for reasons unrelated to the account holder.

Claude Code on Windows#

Claude Desktop. Install the desktop app, sign in, open Code, select a local project folder and start a session. The Code tab lets you review diffs, edit files and run work in parallel. On a current unmanaged installation, the sign-in screen also offers Use your Claude API account for a Console login or API key. An organization can restrict this option. Desktop walkthrough · API account sign-in

Editor and cloud. Use the VS Code extension or JetBrains integration to work in an open repository. To leave a task running when you close your laptop, start a cloud session in the browser or from the Code tab on mobile. Cloud sessions require an eligible plan or seat and, in a managed workspace, permission to start them. Supported interfaces · Cloud sessions

Install the CLI#

Install from PowerShell, no admin rights needed:

irm https://claude.ai/install.ps1 | iex
claude --version

macOS, Linux or WSL:

curl -fsSL https://claude.ai/install.sh | bash

winget install Anthropic.ClaudeCode and brew install --cask claude-code work too, but don’t update themselves.

Run claude in your project folder and sign in in the browser with your Claude plan or a Console account. To use an API key instead, set it before you start. PowerShell:

$env:ANTHROPIC_API_KEY = "your-key-here"
claude

macOS or Linux:

export ANTHROPIC_API_KEY=your-key-here
claude

Claude Code asks once whether to use the key.

The key-wins trap: if ANTHROPIC_API_KEY is set, Claude Code uses it instead of your subscription once you approve it, and bills the key. Remove the variable to go back to the plan, and run /status to see which one is active.

Anthropic recommends Git for Windows so Claude Code can run Bash commands; without it, it runs commands through PowerShell. Sandboxed command execution needs WSL 2. See Anthropic’s setup guide.

On AWS, Google Cloud or Azure, Claude Code can also run through Amazon Bedrock, Google Cloud’s Agent Platform (Vertex AI) or Microsoft Foundry, billed to that account.

OpenCode#

OpenCode offers a desktop app and a terminal client. For the terminal flow, install the current CLI for your platform and run opencode in your project. In /connect, select Anthropic and enter a Claude Console API key, then choose a Claude model in /models. OpenCode downloads · Connect a provider

Which Claude model should I pick?#

Anthropic’s models overview suggests starting with Claude Opus 5.5 for most work, and describes it as built for long-running agentic coding. Claude Sonnet 5.5 is faster and cheaper, and handles routine edits well. Claude Fable 5.2 is for demanding reasoning and long-running tasks. Claude Haiku 5.5 suits quick, simple jobs more than multi-file changes.

How API billing works#

You pay per token: everything the agent sends (your files, the conversation, tool results) and everything the model writes. Agent sessions resend a lot of context, so long sessions in large projects cost more than chat.

Anthropic places new accounts on a usage tier with a monthly spend cap, and you can set a lower limit yourself on the Billing page in the Claude Console. Current prices and limits are on Anthropic’s pricing and rate limits pages.

Common errors#

  • 401: the key is wrong, revoked or expired. Create a new one in the Console.
  • 429 rate_limit_error: you hit a per-minute rate limit. Wait and try again. If the message says your organization crossed its monthly usage threshold, you reached your tier’s spend cap, and retrying will not help until it resets or you request a higher tier on the Rate limits page in the Console.
  • 400 “You have reached your specified API usage limits”: a spend limit you set yourself. Raise it on the Billing page.
  • 402 billing_error: check your payment details in the Console.
  • 529 overloaded_error: Anthropic is under heavy load. Try again shortly, or switch to another provider.

Contenox Harness#

Contenox Harness runs on Windows, macOS and Linux and gives you two ways to use Claude.

Run the external Claude Code agent. Open Agents and install Claude Code. Have Node.js 22 or newer and npm on the computer. The standard sign-in uses your Anthropic Console account and its billing. If you specifically want the personal subscription option, read the warning in Settings → Unofficial sign-ins → Allow unofficial sign-ins before enabling it. That option lets the agent use your existing Claude sign-in. Return to Agents, check the agent’s sign-in status, and start a chat with it.

Contenox Harness runs Claude Code in a sandbox, and the chat’s permission set decides what it may do without asking. Two things to know:

  • Writes are limited to the chat’s project folder and Claude Code’s own settings folder.
  • File reads on Windows. The external agent can read files accessible to the Windows account running Contenox Harness. For guidance on separating secrets from a project, see Keep secrets away from AI agents.

With an API key, including one paid by your plan’s monthly API credits:

  1. Open Backends → Providers and, under Recommended, choose Anthropic.
  2. Select Create key, create a key in the Claude Console and copy it.
  3. Paste it into API Key, select Connect and wait for Connected.
  4. Pick a Claude model in the Model chip on the message box.

To keep the key out of the app, enter ANTHROPIC_API_KEY under Advanced in Environment variable name, set it with setx ANTHROPIC_API_KEY "your-key-here", and reopen Contenox Harness. Key rejected means a 401; use Replace to paste a new key.