Claude Code Windows: Install With PowerShell and a Base URL
Claude Code Windows setup runs in PowerShell: one installer command writes the base URL and API key into settings.json, and a single key then reaches many text and code models. The base URL stays without /v1, and a quota check confirms the key still has tokens.
Installing Claude Code on Windows is one PowerShell command that writes the base URL and API key into settings.json, followed by a first session and a quota check to confirm the setup.
What you need before installing Claude Code on Windows
Claude Code reads its configuration from a file, not from a menu inside an app. On Windows that file is %USERPROFILE%\.claude\settings.json, and the values inside it are used every time Claude Code starts from PowerShell. If Claude Code isn't installed on the machine yet, follow the official instructions at docs.anthropic.com until the command runs.
Have the TokenomixAI API key ready in the sk-tkx-... format. No account or credit card is needed: a package is bought on the website and the key is sent after payment, by QRIS or USDT. One key reaches many text and code models, and the models to choose from are listed in the docs.
Models that accept images as input are still text and code models. This gateway doesn't generate images, video or audio, so a Claude Code session returns text and code only.
How to install Claude Code on Windows with PowerShell
The TokenomixAI installer script for Claude Code does one job: it writes ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN into the env block of settings.json. Run the command below in PowerShell, then paste the API key when the script asks for it.
irm https://tokenomixai.com/install/claude.ps1 | iexThe script keeps the other settings already in that file, including entries unrelated to the gateway, and it makes a backup before the file is changed. The key goes into the local config file only; it is never put in a URL.
When settings.json is managed separately, for example through dotfiles, fill the env block by hand in the shape below.
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.tokenomixai.com",
"ANTHROPIC_AUTH_TOKEN": "sk-tkx-..."
}
}| Option | Good fit when |
|---|---|
| One-command installer | Speed matters and JSON should stay untouched |
| Manual env block | settings.json is already managed by hand or through dotfiles |
Details about file locations and script behaviour are in docs.
The Claude Code base URL on Windows stays without /v1
Claude Code adds the /v1/messages path to the base URL itself. ANTHROPIC_BASE_URL therefore has to be https://api.tokenomixai.com alone, with no /v1 at the end. If /v1 is included, requests go to the wrong path and the session fails to start.
ANTHROPIC_AUTH_TOKEN holds the sk-tkx-... key. Both values are read at every Claude Code start, so they don't need to be set again each time PowerShell opens. A longer explanation of this variable pair is in Anthropic Base URL and Auth Token.
The gateway logs request metadata only: model, token count, time and status. Prompt contents and completions are not stored.
Check that Claude Code runs on Windows
When the script finishes, these steps confirm the configuration instead of leaving it to guesswork.
- Close the old PowerShell window and open a new one so the environment is read again.
- Start Claude Code from the project folder and ask for something small, such as a summary of one file.
- A reply without a 401 or 404 status means the base URL and token are correct.
- Open
%USERPROFILE%\.claude\settings.jsonand confirmANTHROPIC_BASE_URLdoes not end in/v1.
A 401 status means the key is wrong or was cut short when pasted, and that case is covered in 401 API Key Error. A 404 usually means the base URL still carries /v1 or has a trailing space. An empty reply points at the config file rather than at the model.
Check remaining quota and what error 429 means
TokenomixAI quota is counted in tokens, not in time windows, so there is no 5-hour limit. The key keeps working while tokens remain and before it expires. A rate limit does apply: 600 requests per minute per account, shared by all keys on that account, and the API returns 429 with Retry-After above it.
curl https://api.tokenomixai.com/v1/quota -H "Authorization: Bearer sk-tkx-..."The response returns status (active or exhausted), remainingTokens, maxTokens, usagePercent, expiresAt, and low, which is true at 10 percent or less remaining. Each field is explained in Check API Quota.
A 429 from Claude Code means the 600 requests per minute line was crossed. Wait for the seconds given in the Retry-After header, then send the request again. When status is already exhausted, add tokens on the website before the next session; a top-up adds to the remaining tokens and the key stays the same.
Restore the previous settings on Windows
To put Claude Code back on its earlier configuration, run the restore command. The script returns settings.json from the backup made during installation.
$env:RESTORE="1"; irm https://tokenomixai.com/install/claude.ps1 | iexAfter the restore, open a new PowerShell window and confirm the previous values are back. If gateway values are still present, open %USERPROFILE%\.claude\settings.json and delete the two lines that are no longer used.
Frequently asked questions
Can the same API key be used for Claude Code and other tools?
Yes. One sk-tkx-... key reaches many text and code models, so it works in Claude Code, OpenCode, Cursor and scripts that accept a base URL. Each tool needs the base URL written in the format that tool expects, and Claude Code is the one that takes it without /v1.
Why does Claude Code return a 429 on Windows?
The account rate limit is 600 requests per minute, shared by every key on that account. Wait for the seconds in the Retry-After header, then repeat the request. If the quota endpoint reports status as exhausted, add tokens on the website before the next session.
Are prompts stored by the gateway?
Only request metadata is logged: model, token count, time and status. Prompt contents and completion text are not stored.
Which model IDs work with Claude Code on Windows?
The catalog, context sizes and model IDs live on the docs page at tokenomixai.com/docs, and they change over time. Check there rather than hardcoding a name in scripts or notes.
Does the installer replace existing Claude Code settings?
No. It only adds or updates the env block and leaves other settings in place, and a backup is made before the edit. Running the restore command puts the previous file back.