Claude Desktop custom API: connect a base URL and key
Claude Desktop is Anthropic's chat and cowork app. By default it talks to Anthropic's own API. If you want to run it against apillms instead - to use a different rate, prompt caching, or switch models - you point it at apillms' Anthropic-compatible endpoint and use your apillms key. This guide walks through the whole process: finding your key, setting the base URL, picking a model, testing the connection, and fixing common problems.
Before you start: find your key and base URLs
Every apillms account gets exactly one API key, created automatically when you sign up. You don't create new keys - you just view or roll (replace) the existing one from the API keys page in the console.
- Go to API keys and click Show key to reveal it.
- If you ever suspect the key has leaked, click Roll key. This disables the old key immediately and issues a new one - update every app using the old key afterward, including Claude Desktop.
The same page lists the two base URLs apillms exposes:
- Anthropic-compatible:
https://apillms.com(no/v1suffix) - OpenAI-compatible:
https://apillms.com/v1
Claude Desktop speaks Anthropic's API format, so you want the Anthropic-compatible base URL: https://apillms.com. Mixing these up - pointing Claude Desktop at the /v1 URL - is the single most common setup mistake, so note the difference before moving on.
Use the Claude Desktop integration guide
apillms has a dedicated setup guide for Claude Desktop at /integrations?app=desktop. It fills in your actual key in the example so you can copy values directly instead of hunting for placeholders. Open it alongside this post and copy:
- The base URL:
https://apillms.com - Your API key (already filled in on the guide)
The guide shows the exact fields Claude Desktop asks for and the values to paste into them. Follow those steps as given rather than guessing at a configuration method - the app's own settings screen is where the base URL and key go, and the guide walks you through it step by step.
If you also run Claude Code, note that its setup is separate: Claude Code is configured through the ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN environment variables, with its own one-line installer. See Set Up Claude Code with apillms in 5 Minutes for that setup, or Run Claude Code for less for a shorter version of the same steps. These are the Claude Code steps specifically, not instructions for Claude Desktop.
Pick a model
apillms serves multiple model families through the same endpoint, including Claude, GPT, Grok, DeepSeek and Kimi models. The full list with capability filters is on Models & API. For Claude Desktop you'll typically want a Claude model so behavior matches what the app expects, but nothing stops you from routing to another model id if your workflow needs it.
A few reference prices per 1M tokens on apillms, for context when choosing:
| Model | Input | Output | Cache read |
|---|---|---|---|
| claude-sonnet-5 | $0.274 | $1.37 | $0.046 |
| claude-opus-5-5 | $0.639 | $3.19 | $0.106 |
For comparison, OpenRouter lists Claude Sonnet 5 at $2 / $10 per 1M input/output tokens and Claude Opus 5.5 at $4 / $20. See the live numbers for every model, including GPT, Grok, DeepSeek and Kimi options, at /compare, or check current rates on /pricing.
To put the cache-read price in perspective: a single chat message with claude-sonnet-5 (1,000 input + 500 output tokens) costs about $0.002, so 1,000 such messages come to roughly $2.24. Prompt caching is on automatically with per-user cache keys, so if Claude Desktop sends repeated context (system prompt, earlier turns) across a conversation, those repeated tokens get billed at the much lower cache-read rate instead of the full input price - no extra setup required on your side.
Test the key before you rely on it
Don't just paste the key into Claude Desktop and hope. Use the Connect page in the console first - it lets you test your key directly and then opens the app guides, including the one for Claude Desktop. If the test on Connect succeeds, you know the key and base URL are valid before you touch the app's configuration.
You can also verify the key works from a terminal with a plain curl request against the Anthropic-compatible endpoint, using the same header format Claude Desktop uses internally:
curl https://apillms.com/v1/messages \
-H "x-api-key: your_apillms_key" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5",
"max_tokens": 100,
"messages": [{"role": "user", "content": "Say hello."}]
}'
A JSON response with a message back confirms both the key and the base URL are correct. If the test fails:
- Double-check you copied the full key with no extra spaces or line breaks.
- Confirm you're using the Anthropic-compatible base URL (
https://apillms.com), not the OpenAI-compatible one (https://apillms.com/v1). - Check your balance on Billing - a zero balance will also cause requests to fail. New accounts start with 50 free credits, which at $0.005 per credit is enough for a handful of test messages.
- If you rolled your key recently, make sure the old key isn't still saved anywhere else you've configured it.
Apply the config and verify in the app
Once the key tests fine on Connect (or via curl):
- Enter the base URL and key into Claude Desktop exactly as shown on the guide at /integrations?app=desktop.
- Fully quit Claude Desktop - closing the window alone often isn't enough, since many desktop apps keep running in the background or system tray.
- Relaunch the app so it picks up the new configuration.
- Start a new chat and send a short test message. If it responds, the connection is live.
If responses don't come through:
- Re-open the guide at /integrations?app=desktop and re-check every field against what's shown there - a single mistyped character in the base URL or key is the usual cause.
- Re-check for typos in the base URL - a missing
https://or a trailing slash can cause silent failures. - Try the curl test again with the same key to isolate whether the problem is the key/network or the Claude Desktop configuration itself.
- Confirm the key on API keys still matches what you entered - if you rolled the key since setting up Claude Desktop, you'll need to update it there.
Watch usage and spend
After you're connected, keep an eye on consumption from the console. The Billing page shows your credit packs, tokens-per-pack tables, and payment history. Credit packs on apillms are Starter $5 (1,000 credits), Builder $20 (4,200 credits), Pro $50 (11,000 credits) and Scale $100 (23,000 credits), and credits never expire, so there's no rush to use them before an app's "trial" window closes the way there can be with other tools.
For a per-request breakdown, the Usage page in the console shows activity by day (today / 7 / 30 days), by product, with filters by type and status, and an Export CSV option if you want to track spend outside the dashboard. Failed requests are never billed, so a connection error during setup won't cost you credits.
Takeaway
Connecting Claude Desktop to apillms comes down to three things: the Anthropic-compatible base URL (https://apillms.com), your one apillms key from API keys, and a quick test - via the Connect page or a curl request - before you touch the app. Follow the Claude Desktop guide for the exact fields and values, fully restart the app, and send a test message to confirm. If you also run Claude Code, that app uses a separate environment-variable setup - see Set Up Claude Code with apillms for that.
Try apillms
One API key for Claude, GPT, Grok, DeepSeek and Kimi. OpenAI- and Anthropic-compatible, prompt caching included, pay-as-you-go from $5 with PayPal or card. Credits never expire.
FAQ
Do I need a separate API key for Claude Desktop?
No. Your apillms account has exactly one API key, created automatically at sign-up. Use the same key for Claude Desktop, Claude Code, or any other app.
Which base URL does Claude Desktop need?
The Anthropic-compatible base URL, https://apillms.com, without a /v1 suffix. The OpenAI-compatible one at /v1 is for apps using the OpenAI API format.
How do I know the key works before configuring Claude Desktop?
Use the Connect page in the console - it tests your key directly and links out to the app-specific guides, including the one for Claude Desktop. You can also run a plain curl request against the Anthropic-compatible endpoint to confirm it independently.
Does Claude Desktop use the same environment variables as Claude Code?
No. Claude Code is configured through the ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN environment variables; Claude Desktop uses its own settings screen, with the exact fields shown on its integration guide at /integrations?app=desktop.