Connect your AI tool.
Pick a tool, your operating system and a model. The steps and snippets below update to match.
Connect Claude Code CLI
Claude Code reads the base URL, key and model from its settings file, so it works without an Anthropic login.
-
Install Claude Code, then open a new terminal window.PowerShell
irm https://claude.ai/install.ps1 | iex
-
Create the file
%USERPROFILE%\.claude\settings.jsonwith this content. If the file already exists, add theenvblock to it. Note that the base URL has no/v1at the end.settings.json{ "env": { "ANTHROPIC_BASE_URL": "https://cheaptokens.pw", "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY", "ANTHROPIC_MODEL": "claude-sonnet-5-5", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5" } } -
Go to your project folder and start Claude Code. It skips the Anthropic login because the key is already set.PowerShell
claude
-
Type
/status. It should show https://cheaptokens.pw as the Anthropic base URL. Then send a message. -
Using the Claude Code extension for VS Code instead? Install it (
code --install-extension anthropic.claude-code), open the Command Palette, run Preferences: Open User Settings (JSON) and add this inside the outer braces:VS Code settings.json"claudeCode.environmentVariables": [ { "name": "ANTHROPIC_BASE_URL", "value": "https://cheaptokens.pw" }, { "name": "ANTHROPIC_AUTH_TOKEN", "value": "YOUR_API_KEY" }, { "name": "ANTHROPIC_MODEL", "value": "claude-sonnet-5-5" } ]
-
Install Claude Code, then open a new terminal window.Terminal
curl -fsSL https://claude.ai/install.sh | bash
-
Create the file
~/.claude/settings.jsonwith this content. If the file already exists, add theenvblock to it. Note that the base URL has no/v1at the end.settings.json{ "env": { "ANTHROPIC_BASE_URL": "https://cheaptokens.pw", "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY", "ANTHROPIC_MODEL": "claude-sonnet-5-5", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5" } } -
Go to your project folder and start Claude Code. It skips the Anthropic login because the key is already set.Terminal
claude
-
Type
/status. It should show https://cheaptokens.pw as the Anthropic base URL. Then send a message. -
Using the Claude Code extension for VS Code instead? Install it (
code --install-extension anthropic.claude-code), open the Command Palette, run Preferences: Open User Settings (JSON) and add this inside the outer braces:VS Code settings.json"claudeCode.environmentVariables": [ { "name": "ANTHROPIC_BASE_URL", "value": "https://cheaptokens.pw" }, { "name": "ANTHROPIC_AUTH_TOKEN", "value": "YOUR_API_KEY" }, { "name": "ANTHROPIC_MODEL", "value": "claude-sonnet-5-5" } ]
-
Install Claude Code, then open a new terminal window.Terminal
curl -fsSL https://claude.ai/install.sh | bash
-
Create the file
~/.claude/settings.jsonwith this content. If the file already exists, add theenvblock to it. Note that the base URL has no/v1at the end.settings.json{ "env": { "ANTHROPIC_BASE_URL": "https://cheaptokens.pw", "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY", "ANTHROPIC_MODEL": "claude-sonnet-5-5", "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5" } } -
Go to your project folder and start Claude Code. It skips the Anthropic login because the key is already set.Terminal
claude
-
Type
/status. It should show https://cheaptokens.pw as the Anthropic base URL. Then send a message. -
Using the Claude Code extension for VS Code instead? Install it (
code --install-extension anthropic.claude-code), open the Command Palette, run Preferences: Open User Settings (JSON) and add this inside the outer braces:VS Code settings.json"claudeCode.environmentVariables": [ { "name": "ANTHROPIC_BASE_URL", "value": "https://cheaptokens.pw" }, { "name": "ANTHROPIC_AUTH_TOKEN", "value": "YOUR_API_KEY" }, { "name": "ANTHROPIC_MODEL", "value": "claude-sonnet-5-5" } ]
- Already signed in to Claude Code with an Anthropic account? Type
/logoutonce so the two logins don't clash. - Switch model at any time with
/model claude-sonnet-5-5, or start withclaude --model claude-sonnet-5-5. ANTHROPIC_DEFAULT_HAIKU_MODELis the small model Claude Code uses for background jobs such as naming sessions.- For one terminal session only, you can set
ANTHROPIC_BASE_URLandANTHROPIC_AUTH_TOKENas environment variables instead of editing the file. - Don't put your key in a project's own
.claude/settings.json. That file is usually committed to git.
Connect Claude Desktop
Claude Desktop connects to CheapTokens in its third-party inference mode, which you switch on before signing in.
-
Install Claude Desktop from claude.com/download. Approve the administrator prompt during setup.
-
Open the app but don't sign in. In the ☰ menu on the sign-in screen, choose Help → Troubleshooting → Enable Developer Mode.
-
Open Developer → Configure Third-Party Inference… and fill in the Connection section. Note that the base URL has no
/v1at the end.Third-Party InferenceInference provider: Gateway Credential kind: Static API key Gateway base URL: https://cheaptokens.pw Gateway API key: YOUR_API_KEY Gateway auth scheme: Bearer
-
Add
claude-sonnet-5-5to the model list in the same window. The first model in the list is the default. -
Click Test connection, then Apply Changes → Save & Restart. On the sign-in screen, choose the third-party option.
-
Prefer a file? In the same window, choose Import configuration… and load a JSON file with this content:claude-desktop.json
{ "inferenceProvider": "gateway", "inferenceGatewayBaseUrl": "https://cheaptokens.pw", "inferenceGatewayApiKey": "YOUR_API_KEY", "inferenceGatewayAuthScheme": "bearer", "inferenceModels": ["claude-sonnet-5-5"] }
-
Install Claude Desktop from claude.com/download.
-
Open the app but don't sign in. In the menu bar, choose Help → Troubleshooting → Enable Developer Mode.
-
Open Developer → Configure Third-Party Inference… and fill in the Connection section. Note that the base URL has no
/v1at the end.Third-Party InferenceInference provider: Gateway Credential kind: Static API key Gateway base URL: https://cheaptokens.pw Gateway API key: YOUR_API_KEY Gateway auth scheme: Bearer
-
Add
claude-sonnet-5-5to the model list in the same window. The first model in the list is the default. -
Click Test connection, then Apply Changes → Save & Restart. On the sign-in screen, choose the third-party option.
-
Prefer a file? In the same window, choose Import configuration… and load a JSON file with this content:claude-desktop.json
{ "inferenceProvider": "gateway", "inferenceGatewayBaseUrl": "https://cheaptokens.pw", "inferenceGatewayApiKey": "YOUR_API_KEY", "inferenceGatewayAuthScheme": "bearer", "inferenceModels": ["claude-sonnet-5-5"] }
-
Install Claude Desktop for Linux (beta) by following Anthropic's Linux guide.
-
Open the app but don't sign in. In the ☰ menu on the sign-in screen, choose Help → Troubleshooting → Enable Developer Mode.
-
Open Developer → Configure Third-Party Inference… and fill in the Connection section. Note that the base URL has no
/v1at the end.Third-Party InferenceInference provider: Gateway Credential kind: Static API key Gateway base URL: https://cheaptokens.pw Gateway API key: YOUR_API_KEY Gateway auth scheme: Bearer
-
Add
claude-sonnet-5-5to the model list in the same window. The first model in the list is the default. -
Click Test connection, then Apply Changes → Save & Restart. On the sign-in screen, choose the third-party option.
-
Prefer a file? In the same window, choose Import configuration… and load a JSON file with this content:claude-desktop.json
{ "inferenceProvider": "gateway", "inferenceGatewayBaseUrl": "https://cheaptokens.pw", "inferenceGatewayApiKey": "YOUR_API_KEY", "inferenceGatewayAuthScheme": "bearer", "inferenceModels": ["claude-sonnet-5-5"] }
- This only works when you are not signed in with an Anthropic account. A signed-in app ignores custom base URLs.
- To go back to normal, choose the Anthropic sign-in option on the sign-in screen.
- If the Developer menu is gone after a restart, enable Developer Mode again.
- In this mode there are no Anthropic cloud sessions and no Remote Control.
- An exported or imported config file holds your key in plain text. Delete it after importing.
Connect Codex CLI
Codex needs a provider block in config.toml and your key in an environment variable.
-
Install Codex CLI, then open a new terminal window.PowerShell
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
-
Save your key as an environment variable. Close PowerShell and open it again so the new variables load.PowerShell
setx CHEAPTOKENS_API_KEY "YOUR_API_KEY"
-
Create the file
%USERPROFILE%\.codex\config.tomlwith this content. If the file already exists, put the first two lines at the very top and the rest at the end.config.tomlmodel = "gpt-6.2-sol" model_provider = "cheaptokens" [model_providers.cheaptokens] name = "CheapTokens" base_url = "https://cheaptokens.pw/v1" env_key = "CHEAPTOKENS_API_KEY" wire_api = "responses" requires_openai_auth = false
-
Go to your project folder, start Codex and send a message.PowerShell
codex
-
Install Codex CLI, then open a new terminal window.Terminal
curl -fsSL https://chatgpt.com/codex/install.sh | sh
-
Save your key as an environment variable. The last line reloads your shell settings, so the variables work straight away.Terminal
echo 'export CHEAPTOKENS_API_KEY="YOUR_API_KEY"' >> ~/.zshrc source ~/.zshrc
-
Create the file
~/.codex/config.tomlwith this content. If the file already exists, put the first two lines at the very top and the rest at the end.config.tomlmodel = "gpt-6.2-sol" model_provider = "cheaptokens" [model_providers.cheaptokens] name = "CheapTokens" base_url = "https://cheaptokens.pw/v1" env_key = "CHEAPTOKENS_API_KEY" wire_api = "responses" requires_openai_auth = false
-
Go to your project folder, start Codex and send a message.Terminal
codex
-
Install Codex CLI, then open a new terminal window.Terminal
curl -fsSL https://chatgpt.com/codex/install.sh | sh
-
Save your key as an environment variable. The last line reloads your shell settings, so the variables work straight away.Terminal
echo 'export CHEAPTOKENS_API_KEY="YOUR_API_KEY"' >> ~/.bashrc source ~/.bashrc
-
Create the file
~/.codex/config.tomlwith this content. If the file already exists, put the first two lines at the very top and the rest at the end.config.tomlmodel = "gpt-6.2-sol" model_provider = "cheaptokens" [model_providers.cheaptokens] name = "CheapTokens" base_url = "https://cheaptokens.pw/v1" env_key = "CHEAPTOKENS_API_KEY" wire_api = "responses" requires_openai_auth = false
-
Go to your project folder, start Codex and send a message.Terminal
codex
- Codex only speaks the OpenAI Responses format, so it works with the models in the list on this page, not with every model.
- Codex may warn that it has no metadata for a custom model. The model still works.
- The Codex extension for VS Code (
code --install-extension openai.chatgpt) reads the sameconfig.toml. Start VS Code from a terminal that has the key variable, or restart your computer after setting it. - Switch model with
codex --model gpt-6.2-solor/modelinside Codex. - Provider settings only work in the config file in your home folder, not in a project's
.codexfolder.
Connect Codex App
The Codex desktop app shares config.toml with Codex CLI. Add the provider there and restart the app.
-
Install the Codex app from chatgpt.com/download. It is also in the Microsoft Store.
-
Save your key as an environment variable. Close PowerShell and open it again so the new variables load.PowerShell
setx CHEAPTOKENS_API_KEY "YOUR_API_KEY"
-
Create the file
%USERPROFILE%\.codex\config.tomlwith this content. The app and Codex CLI share this file. If it already exists, put the first two lines at the very top and the rest at the end.config.tomlmodel = "gpt-6.2-sol" model_provider = "cheaptokens" [model_providers.cheaptokens] name = "CheapTokens" base_url = "https://cheaptokens.pw/v1" env_key = "CHEAPTOKENS_API_KEY" wire_api = "responses" requires_openai_auth = false
-
Quit the Codex app completely and open it again. On the sign-in screen you can skip the ChatGPT login.
-
Start a new chat and send a message. To check the provider, open Settings → Model Providers: CheapTokens should be the current one.
-
Install the Codex app from chatgpt.com/download.
-
Save your key where desktop apps can read it. Apps opened from the Dock don't see variables from your shell settings, so use
launchctl. Run it again after you restart your Mac.Terminallaunchctl setenv CHEAPTOKENS_API_KEY "YOUR_API_KEY"
-
Create the file
~/.codex/config.tomlwith this content. The app and Codex CLI share this file. If it already exists, put the first two lines at the very top and the rest at the end.config.tomlmodel = "gpt-6.2-sol" model_provider = "cheaptokens" [model_providers.cheaptokens] name = "CheapTokens" base_url = "https://cheaptokens.pw/v1" env_key = "CHEAPTOKENS_API_KEY" wire_api = "responses" requires_openai_auth = false
-
Quit the Codex app completely and open it again. On the sign-in screen you can skip the ChatGPT login.
-
Start a new chat and send a message. To check the provider, open Settings → Model Providers: CheapTokens should be the current one.
-
The Codex desktop app is available for Windows and macOS. On Linux, use Codex CLI instead: it uses the same settings.
- You can also add the provider in the app: Settings → Model Providers → Add → Gateway or custom provider. Enter the base URL https://cheaptokens.pw/v1 and
CHEAPTOKENS_API_KEYas the API key environment variable, then turn on Set as current provider. - Codex only speaks the OpenAI Responses format, so it works with the models in the list on this page, not with every model.
- Without a ChatGPT login, cloud tasks and some plugins are not available.
- If the app can't find your key, the environment variable isn't visible to it. Set it again and restart the app.
Connect Cursor
Cursor can send its chat requests to any OpenAI-compatible API through the base URL override in its model settings.
-
Install Cursor from cursor.com/download and sign in to your Cursor account.
-
Open Cursor Settings → Models and expand API Keys.
-
Turn on OpenAI API Key and paste your CheapTokens key. Turn on Override OpenAI Base URL and enter the base URL.Cursor Settings → Models
OpenAI API Key: YOUR_API_KEY Override OpenAI Base URL: https://cheaptokens.pw/v1
-
Click + Add model, type
claude-sonnet-5-5and switch it on. Then click Verify. -
Pick
claude-sonnet-5-5in the model selector of the chat and send a message.
-
Install Cursor from cursor.com/download and sign in to your Cursor account.
-
Open Cursor Settings → Models and expand API Keys.
-
Turn on OpenAI API Key and paste your CheapTokens key. Turn on Override OpenAI Base URL and enter the base URL.Cursor Settings → Models
OpenAI API Key: YOUR_API_KEY Override OpenAI Base URL: https://cheaptokens.pw/v1
-
Click + Add model, type
claude-sonnet-5-5and switch it on. Then click Verify. -
Pick
claude-sonnet-5-5in the model selector of the chat and send a message.
-
Install Cursor from cursor.com/download and sign in to your Cursor account.
-
Open Cursor Settings → Models and expand API Keys.
-
Turn on OpenAI API Key and paste your CheapTokens key. Turn on Override OpenAI Base URL and enter the base URL.Cursor Settings → Models
OpenAI API Key: YOUR_API_KEY Override OpenAI Base URL: https://cheaptokens.pw/v1
-
Click + Add model, type
claude-sonnet-5-5and switch it on. Then click Verify. -
Pick
claude-sonnet-5-5in the model selector of the chat and send a message.
- You need a paid Cursor plan to use your own API key.
- Custom keys work for chat models only. Tab completion always uses Cursor's own models.
- The override is global: while it is on, Cursor's built-in GPT models are also sent to CheapTokens. Switch it off to use them again.
- Cursor sends requests through its own servers first, so it only works with the public CheapTokens address, not a local one.
- Cursor's settings screen changes often. If the names differ in your version, look for the OpenAI key and base URL fields under Models.
Connect VS Code
VS Code's built-in chat accepts your own models through a custom endpoint, with no extra extension.
-
Install VS Code if you don't have it. These steps use the chat that is built in.
-
Open the Command Palette (
Ctrl+Shift+P, orCmd+Shift+Pon macOS) and run Chat: Manage Language Models. -
Click Add Models → Custom Endpoint. Name the group
CheapTokens, paste your API key when asked, and choose Chat Completions as the API type. -
VS Code opens the file
chatLanguageModels.json. Make the CheapTokens entry look like this and save. Keep theapiKeyline that VS Code wrote for you.chatLanguageModels.json[ { "name": "CheapTokens", "vendor": "customendpoint", "apiKey": "${input:cheaptokensApiKey}", "apiType": "chat-completions", "models": [ { "id": "claude-sonnet-5-5", "name": "claude-sonnet-5-5", "url": "https://cheaptokens.pw/v1/chat/completions", "toolCalling": true, "vision": true, "maxInputTokens": 200000, "maxOutputTokens": 8192 } ] } ] -
Open the Chat view, pick
claude-sonnet-5-5in the model picker and send a message. Restart VS Code if the model isn't listed.
-
Install VS Code if you don't have it. These steps use the chat that is built in.
-
Open the Command Palette (
Ctrl+Shift+P, orCmd+Shift+Pon macOS) and run Chat: Manage Language Models. -
Click Add Models → Custom Endpoint. Name the group
CheapTokens, paste your API key when asked, and choose Chat Completions as the API type. -
VS Code opens the file
chatLanguageModels.json. Make the CheapTokens entry look like this and save. Keep theapiKeyline that VS Code wrote for you.chatLanguageModels.json[ { "name": "CheapTokens", "vendor": "customendpoint", "apiKey": "${input:cheaptokensApiKey}", "apiType": "chat-completions", "models": [ { "id": "claude-sonnet-5-5", "name": "claude-sonnet-5-5", "url": "https://cheaptokens.pw/v1/chat/completions", "toolCalling": true, "vision": true, "maxInputTokens": 200000, "maxOutputTokens": 8192 } ] } ] -
Open the Chat view, pick
claude-sonnet-5-5in the model picker and send a message. Restart VS Code if the model isn't listed.
-
Install VS Code if you don't have it. These steps use the chat that is built in.
-
Open the Command Palette (
Ctrl+Shift+P, orCmd+Shift+Pon macOS) and run Chat: Manage Language Models. -
Click Add Models → Custom Endpoint. Name the group
CheapTokens, paste your API key when asked, and choose Chat Completions as the API type. -
VS Code opens the file
chatLanguageModels.json. Make the CheapTokens entry look like this and save. Keep theapiKeyline that VS Code wrote for you.chatLanguageModels.json[ { "name": "CheapTokens", "vendor": "customendpoint", "apiKey": "${input:cheaptokensApiKey}", "apiType": "chat-completions", "models": [ { "id": "claude-sonnet-5-5", "name": "claude-sonnet-5-5", "url": "https://cheaptokens.pw/v1/chat/completions", "toolCalling": true, "vision": true, "maxInputTokens": 200000, "maxOutputTokens": 8192 } ] } ] -
Open the Chat view, pick
claude-sonnet-5-5in the model picker and send a message. Restart VS Code if the model isn't listed.
- Other ways to use CheapTokens in VS Code: the Claude Code, Codex, Cline, Roo Code and Continue extensions each have their own guide.
- A model needs
"toolCalling": trueto show up in agent mode. - Inline code completions can't use your own models. Only chat and agent mode can.
- To add more models, repeat the block inside
modelswith another model ID. - On a company GitHub Copilot plan, an administrator has to allow your own model keys first.
Connect Cline
Cline talks to any OpenAI-compatible API, so it only needs the base URL, your key and a model ID.
-
Install the Cline extension. In VS Code open Extensions (
Ctrl+Shift+X, orCmd+Shift+Xon macOS) and search for it, or run this in a terminal:Terminalcode --install-extension saoudrizwan.claude-dev
-
Open the Cline panel from the VS Code side bar and click the gear icon to open its settings.
-
Set API Provider to
OpenAI Compatible, then fill in these fields:Cline settingsBase URL: https://cheaptokens.pw/v1 API Key: YOUR_API_KEY Model ID: claude-sonnet-5-5
-
Under Model Configuration, set Context Window to
200000and Max Output Tokens to8192. Cline can't look these up for a custom model. -
Click Verify, then Done, and give Cline a task.
-
Install the Cline extension. In VS Code open Extensions (
Ctrl+Shift+X, orCmd+Shift+Xon macOS) and search for it, or run this in a terminal:Terminalcode --install-extension saoudrizwan.claude-dev
-
Open the Cline panel from the VS Code side bar and click the gear icon to open its settings.
-
Set API Provider to
OpenAI Compatible, then fill in these fields:Cline settingsBase URL: https://cheaptokens.pw/v1 API Key: YOUR_API_KEY Model ID: claude-sonnet-5-5
-
Under Model Configuration, set Context Window to
200000and Max Output Tokens to8192. Cline can't look these up for a custom model. -
Click Verify, then Done, and give Cline a task.
-
Install the Cline extension. In VS Code open Extensions (
Ctrl+Shift+X, orCmd+Shift+Xon macOS) and search for it, or run this in a terminal:Terminalcode --install-extension saoudrizwan.claude-dev
-
Open the Cline panel from the VS Code side bar and click the gear icon to open its settings.
-
Set API Provider to
OpenAI Compatible, then fill in these fields:Cline settingsBase URL: https://cheaptokens.pw/v1 API Key: YOUR_API_KEY Model ID: claude-sonnet-5-5
-
Under Model Configuration, set Context Window to
200000and Max Output Tokens to8192. Cline can't look these up for a custom model. -
Click Verify, then Done, and give Cline a task.
- In JetBrains IDEs, install Cline from the plugin marketplace. The settings are the same.
- Cline needs a model that supports tool calling. If a model replies but never edits files, try another one.
- You can set different models for Plan and Act mode in the same settings screen.
Connect Roo Code
Roo Code talks to any OpenAI-compatible API, so it only needs the base URL, your key and a model ID.
-
Install the Roo Code extension. In VS Code open Extensions (
Ctrl+Shift+X, orCmd+Shift+Xon macOS) and search for it, or run this in a terminal:Terminalcode --install-extension RooVeterinaryInc.roo-cline
-
Open the Roo Code panel from the VS Code side bar and click the gear icon to open its settings.
-
Set API Provider to
OpenAI Compatible, then fill in these fields:Roo Code settingsBase URL: https://cheaptokens.pw/v1 API Key: YOUR_API_KEY Model: claude-sonnet-5-5
-
Under Model Configuration, set Context Window to
200000and Max Output Tokens to8192. Roo Code can't look these up for a custom model. -
Click Save, then Done, and send a message in the Roo Code panel.
-
Install the Roo Code extension. In VS Code open Extensions (
Ctrl+Shift+X, orCmd+Shift+Xon macOS) and search for it, or run this in a terminal:Terminalcode --install-extension RooVeterinaryInc.roo-cline
-
Open the Roo Code panel from the VS Code side bar and click the gear icon to open its settings.
-
Set API Provider to
OpenAI Compatible, then fill in these fields:Roo Code settingsBase URL: https://cheaptokens.pw/v1 API Key: YOUR_API_KEY Model: claude-sonnet-5-5
-
Under Model Configuration, set Context Window to
200000and Max Output Tokens to8192. Roo Code can't look these up for a custom model. -
Click Save, then Done, and send a message in the Roo Code panel.
-
Install the Roo Code extension. In VS Code open Extensions (
Ctrl+Shift+X, orCmd+Shift+Xon macOS) and search for it, or run this in a terminal:Terminalcode --install-extension RooVeterinaryInc.roo-cline
-
Open the Roo Code panel from the VS Code side bar and click the gear icon to open its settings.
-
Set API Provider to
OpenAI Compatible, then fill in these fields:Roo Code settingsBase URL: https://cheaptokens.pw/v1 API Key: YOUR_API_KEY Model: claude-sonnet-5-5
-
Under Model Configuration, set Context Window to
200000and Max Output Tokens to8192. Roo Code can't look these up for a custom model. -
Click Save, then Done, and send a message in the Roo Code panel.
- Roo Code was shut down by its makers on 15 May 2026 and gets no more updates. The last version still installs and works. Its community successor is Zoo Code (
code --install-extension ZooCodeOrganization.zoo-code), which has the same settings screen. - Roo Code needs a model that supports tool calling. If a model replies but never edits files, try another one.
Connect Continue
Continue reads its models from one YAML file. Add CheapTokens there as an OpenAI-type provider.
-
Install the Continue extension. In VS Code open Extensions (
Ctrl+Shift+X, orCmd+Shift+Xon macOS) and search for it, or run this in a terminal:Terminalcode --install-extension Continue.continue
-
Open the Continue config file. In the Continue panel, open the configs dropdown above the chat box and click the cog next to Local Config. The file is
%USERPROFILE%\.continue\config.yaml. -
Replace its contents with this and save. Continue reloads the file on save.config.yaml
name: CheapTokens version: 0.0.1 schema: v1 models: - name: CheapTokens claude-sonnet-5-5 provider: openai model: claude-sonnet-5-5 apiBase: https://cheaptokens.pw/v1 apiKey: YOUR_API_KEY roles: [chat, edit, apply] capabilities: [tool_use] defaultCompletionOptions: contextLength: 200000 maxTokens: 8192 -
Pick CheapTokens claude-sonnet-5-5 in the model dropdown under the chat box and send a message.
-
Install the Continue extension. In VS Code open Extensions (
Ctrl+Shift+X, orCmd+Shift+Xon macOS) and search for it, or run this in a terminal:Terminalcode --install-extension Continue.continue
-
Open the Continue config file. In the Continue panel, open the configs dropdown above the chat box and click the cog next to Local Config. The file is
~/.continue/config.yaml. -
Replace its contents with this and save. Continue reloads the file on save.config.yaml
name: CheapTokens version: 0.0.1 schema: v1 models: - name: CheapTokens claude-sonnet-5-5 provider: openai model: claude-sonnet-5-5 apiBase: https://cheaptokens.pw/v1 apiKey: YOUR_API_KEY roles: [chat, edit, apply] capabilities: [tool_use] defaultCompletionOptions: contextLength: 200000 maxTokens: 8192 -
Pick CheapTokens claude-sonnet-5-5 in the model dropdown under the chat box and send a message.
-
Install the Continue extension. In VS Code open Extensions (
Ctrl+Shift+X, orCmd+Shift+Xon macOS) and search for it, or run this in a terminal:Terminalcode --install-extension Continue.continue
-
Open the Continue config file. In the Continue panel, open the configs dropdown above the chat box and click the cog next to Local Config. The file is
~/.continue/config.yaml. -
Replace its contents with this and save. Continue reloads the file on save.config.yaml
name: CheapTokens version: 0.0.1 schema: v1 models: - name: CheapTokens claude-sonnet-5-5 provider: openai model: claude-sonnet-5-5 apiBase: https://cheaptokens.pw/v1 apiKey: YOUR_API_KEY roles: [chat, edit, apply] capabilities: [tool_use] defaultCompletionOptions: contextLength: 200000 maxTokens: 8192 -
Pick CheapTokens claude-sonnet-5-5 in the model dropdown under the chat box and send a message.
- In JetBrains IDEs, install the Continue plugin from the plugin marketplace instead. The config file is the same.
capabilities: [tool_use]lets Agent mode work with a model Continue doesn't recognise. Addimage_inputfor models that read images.- To add more models, repeat the block under
models:with another model ID. - Autocomplete needs its own entry with
roles: [autocomplete]. A small, cheap model works best there.
Connect OpenCode
OpenCode needs a provider block in opencode.json and your key in an environment variable.
-
Install OpenCode with npm. You need Node.js first.PowerShell
npm install -g @opencode/cli
-
Save your key as an environment variable. Close PowerShell and open it again so the new variables load.PowerShell
setx CHEAPTOKENS_API_KEY "YOUR_API_KEY"
-
Create the file
%USERPROFILE%\.config\opencode\opencode.jsonwith this content. To use it for one project only, save it asopencode.jsonin that project's folder instead.opencode.json{ "$schema": "https://opencode.ai/config.json", "model": "cheaptokens/claude-sonnet-5-5", "provider": { "cheaptokens": { "npm": "@ai-sdk/openai-compatible", "name": "CheapTokens", "options": { "baseURL": "https://cheaptokens.pw/v1", "apiKey": "{env:CHEAPTOKENS_API_KEY}" }, "models": { "claude-sonnet-5-5": { "name": "claude-sonnet-5-5", "limit": { "context": 200000, "output": 8192 } } } } } } -
Run
opencodein your project folder. Type/modelsto confirm CheapTokens is selected, then send a message.
-
Install OpenCode.Terminal
curl -fsSL https://opencode.ai/v2/install | bash
-
Save your key as an environment variable. The last line reloads your shell settings, so the variables work straight away.Terminal
echo 'export CHEAPTOKENS_API_KEY="YOUR_API_KEY"' >> ~/.zshrc source ~/.zshrc
-
Create the file
~/.config/opencode/opencode.jsonwith this content. To use it for one project only, save it asopencode.jsonin that project's folder instead.opencode.json{ "$schema": "https://opencode.ai/config.json", "model": "cheaptokens/claude-sonnet-5-5", "provider": { "cheaptokens": { "npm": "@ai-sdk/openai-compatible", "name": "CheapTokens", "options": { "baseURL": "https://cheaptokens.pw/v1", "apiKey": "{env:CHEAPTOKENS_API_KEY}" }, "models": { "claude-sonnet-5-5": { "name": "claude-sonnet-5-5", "limit": { "context": 200000, "output": 8192 } } } } } } -
Run
opencodein your project folder. Type/modelsto confirm CheapTokens is selected, then send a message.
-
Install OpenCode.Terminal
curl -fsSL https://opencode.ai/v2/install | bash
-
Save your key as an environment variable. The last line reloads your shell settings, so the variables work straight away.Terminal
echo 'export CHEAPTOKENS_API_KEY="YOUR_API_KEY"' >> ~/.bashrc source ~/.bashrc
-
Create the file
~/.config/opencode/opencode.jsonwith this content. To use it for one project only, save it asopencode.jsonin that project's folder instead.opencode.json{ "$schema": "https://opencode.ai/config.json", "model": "cheaptokens/claude-sonnet-5-5", "provider": { "cheaptokens": { "npm": "@ai-sdk/openai-compatible", "name": "CheapTokens", "options": { "baseURL": "https://cheaptokens.pw/v1", "apiKey": "{env:CHEAPTOKENS_API_KEY}" }, "models": { "claude-sonnet-5-5": { "name": "claude-sonnet-5-5", "limit": { "context": 200000, "output": 8192 } } } } } } -
Run
opencodein your project folder. Type/modelsto confirm CheapTokens is selected, then send a message.
- This config uses OpenCode's classic format, which both the current (V2) and older versions read.
- List every model you want under
models. Pick between them inside OpenCode with/models. - OpenCode needs a model that supports tool calling.
Connect OpenClaw
OpenClaw takes a custom provider in openclaw.json. The default model must point at that provider.
-
Install OpenClaw. The installer also sets up Node.js if it is missing, then walks you through onboarding.PowerShell
iwr -useb https://openclaw.ai/install.ps1 | iex
-
Save your key as an environment variable. Close PowerShell and open it again so the new variables load.PowerShell
setx CHEAPTOKENS_API_KEY "YOUR_API_KEY"
-
Open
%USERPROFILE%\.openclaw\openclaw.jsonand add the provider and default model. If the file already hasagentsormodelssections, merge these keys into them.openclaw.json{ agents: { defaults: { model: { primary: "cheaptokens/claude-sonnet-5-5" }, }, }, models: { mode: "merge", providers: { cheaptokens: { baseUrl: "https://cheaptokens.pw/v1", apiKey: "${CHEAPTOKENS_API_KEY}", api: "openai-completions", models: [ { id: "claude-sonnet-5-5", name: "claude-sonnet-5-5", contextWindow: 200000, maxTokens: 8192 }, ], }, }, }, } -
Restart the gateway and check that the model is listed.PowerShell
openclaw gateway restart openclaw models list
-
Send your agent a message. To switch model later, run
openclaw models set cheaptokens/claude-sonnet-5-5or type/modelin a chat.
-
Install OpenClaw. The installer also sets up Node.js if it is missing, then walks you through onboarding.Terminal
curl -fsSL https://openclaw.ai/install.sh | bash
-
Save your key as an environment variable. The last line reloads your shell settings, so the variables work straight away.Terminal
echo 'export CHEAPTOKENS_API_KEY="YOUR_API_KEY"' >> ~/.zshrc source ~/.zshrc
-
Open
~/.openclaw/openclaw.jsonand add the provider and default model. If the file already hasagentsormodelssections, merge these keys into them.openclaw.json{ agents: { defaults: { model: { primary: "cheaptokens/claude-sonnet-5-5" }, }, }, models: { mode: "merge", providers: { cheaptokens: { baseUrl: "https://cheaptokens.pw/v1", apiKey: "${CHEAPTOKENS_API_KEY}", api: "openai-completions", models: [ { id: "claude-sonnet-5-5", name: "claude-sonnet-5-5", contextWindow: 200000, maxTokens: 8192 }, ], }, }, }, } -
Restart the gateway and check that the model is listed.Terminal
openclaw gateway restart openclaw models list
-
Send your agent a message. To switch model later, run
openclaw models set cheaptokens/claude-sonnet-5-5or type/modelin a chat.
-
Install OpenClaw. The installer also sets up Node.js if it is missing, then walks you through onboarding.Terminal
curl -fsSL https://openclaw.ai/install.sh | bash
-
Save your key as an environment variable. The last line reloads your shell settings, so the variables work straight away.Terminal
echo 'export CHEAPTOKENS_API_KEY="YOUR_API_KEY"' >> ~/.bashrc source ~/.bashrc
-
Open
~/.openclaw/openclaw.jsonand add the provider and default model. If the file already hasagentsormodelssections, merge these keys into them.openclaw.json{ agents: { defaults: { model: { primary: "cheaptokens/claude-sonnet-5-5" }, }, }, models: { mode: "merge", providers: { cheaptokens: { baseUrl: "https://cheaptokens.pw/v1", apiKey: "${CHEAPTOKENS_API_KEY}", api: "openai-completions", models: [ { id: "claude-sonnet-5-5", name: "claude-sonnet-5-5", contextWindow: 200000, maxTokens: 8192 }, ], }, }, }, } -
Restart the gateway and check that the model is listed.Terminal
openclaw gateway restart openclaw models list
-
Send your agent a message. To switch model later, run
openclaw models set cheaptokens/claude-sonnet-5-5or type/modelin a chat.
- The default model only works if the same model ID is also listed under the provider's
models. openclaw models statusshows which model and provider are active.openclaw doctorchecks the whole install.
Connect Hermes
Hermes Agent has a built-in custom endpoint option: give it the base URL, your key and a model ID.
-
Install Hermes Agent, then open a new terminal window so the
hermescommand is found.PowerShelliex (irm https://hermes-agent.nousresearch.com/install.ps1)
-
Run the model setup and choose Custom endpoint.PowerShell
hermes model
-
Enter these values when asked:hermes model
API base URL: https://cheaptokens.pw/v1 API key: YOUR_API_KEY Model name: claude-sonnet-5-5
-
Or skip the last two steps and edit
%USERPROFILE%\.hermes\config.yamlyourself:config.yamlmodel: default: claude-sonnet-5-5 provider: custom base_url: https://cheaptokens.pw/v1 api_key: YOUR_API_KEY context_length: 200000
-
Run
hermesand send a message.hermes doctorchecks the setup if something looks wrong.
-
Install Hermes Agent, then open a new terminal window so the
hermescommand is found.Terminalcurl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
-
Run the model setup and choose Custom endpoint.Terminal
hermes model
-
Enter these values when asked:hermes model
API base URL: https://cheaptokens.pw/v1 API key: YOUR_API_KEY Model name: claude-sonnet-5-5
-
Or skip the last two steps and edit
~/.hermes/config.yamlyourself:config.yamlmodel: default: claude-sonnet-5-5 provider: custom base_url: https://cheaptokens.pw/v1 api_key: YOUR_API_KEY context_length: 200000
-
Run
hermesand send a message.hermes doctorchecks the setup if something looks wrong.
-
Install Hermes Agent, then open a new terminal window so the
hermescommand is found.Terminalcurl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
-
Run the model setup and choose Custom endpoint.Terminal
hermes model
-
Enter these values when asked:hermes model
API base URL: https://cheaptokens.pw/v1 API key: YOUR_API_KEY Model name: claude-sonnet-5-5
-
Or skip the last two steps and edit
~/.hermes/config.yamlyourself:config.yamlmodel: default: claude-sonnet-5-5 provider: custom base_url: https://cheaptokens.pw/v1 api_key: YOUR_API_KEY context_length: 200000
-
Run
hermesand send a message.hermes doctorchecks the setup if something looks wrong.
- Hermes refuses models with less than 64,000 tokens of context.
context_length: 200000tells it the size for a model it doesn't know. - To switch model inside a session, type
/model custom:claude-sonnet-5-5. - Hermes needs a model that supports tool calling.
Connect DSH Desktop
DSH Desktop accepts any OpenAI-compatible API as a custom model provider, set up in its settings screen.
-
Download and install DSH Desktop (DeepSeek Harness) from DeepSeek: dsh-latest-windows-x64.exe.
-
Open Settings → Models and click Add model provider. Switch the card to Custom model API.
-
Fill in the provider. The provider ID can't be changed later.Custom model API
Provider ID: cheaptokens Display name: CheapTokens Base URL: https://cheaptokens.pw/v1 API protocol: OpenAI Chat Completions API key: YOUR_API_KEY
-
Under Models, click Fetch available models to load the list, or add
deepseek-v4-proby hand. Click Save. -
Choose a workspace folder, pick
deepseek-v4-proin the model picker of the message box, and send a message.
-
Download and install DSH Desktop (DeepSeek Harness) from DeepSeek: dsh-latest-macos-arm64.dmg. The macOS build is for Apple silicon.
-
Open Settings → Models and click Add model provider. Switch the card to Custom model API.
-
Fill in the provider. The provider ID can't be changed later.Custom model API
Provider ID: cheaptokens Display name: CheapTokens Base URL: https://cheaptokens.pw/v1 API protocol: OpenAI Chat Completions API key: YOUR_API_KEY
-
Under Models, click Fetch available models to load the list, or add
deepseek-v4-proby hand. Click Save. -
Choose a workspace folder, pick
deepseek-v4-proin the model picker of the message box, and send a message.
-
There is no official DSH Desktop build for Linux. Run the same interface in your browser instead. You need Node.js. It opens at
http://127.0.0.1:3080.Terminalnpx @deepseek-ai/dsh web
-
Open Settings → Models and click Add model provider. Switch the card to Custom model API.
-
Fill in the provider. The provider ID can't be changed later.Custom model API
Provider ID: cheaptokens Display name: CheapTokens Base URL: https://cheaptokens.pw/v1 API protocol: OpenAI Chat Completions API key: YOUR_API_KEY
-
Under Models, click Fetch available models to load the list, or add
deepseek-v4-proby hand. Click Save. -
Choose a workspace folder, pick
deepseek-v4-proin the model picker of the message box, and send a message.
- DeepSeek Harness is a developer preview, so screens and names can change between versions.
- Several unofficial apps are also called DSH Desktop. These steps are for the official one from DeepSeek. The community builds wrap the same interface, so the settings should match.
- Your key is stored on your computer and isn't shown again after you save it.
Connect Aider
Aider reads the base URL and key from two environment variables. Prefix the model ID with openai/.
-
Install aider, then open a new terminal window.PowerShell
powershell -ExecutionPolicy ByPass -c "irm https://aider.chat/install.ps1 | iex"
-
Save the base URL and your key as environment variables. Close PowerShell and open it again so the new variables load.PowerShell
setx OPENAI_API_BASE "https://cheaptokens.pw/v1" setx OPENAI_API_KEY "YOUR_API_KEY"
-
Go to your project folder and start aider. Keep the
openai/prefix in front of the model ID: it tells aider to use the OpenAI format.PowerShellaider --model openai/claude-sonnet-5-5 --weak-model openai/claude-sonnet-5-5 --no-show-model-warnings
-
To avoid typing the options each time, save them in a file named
.aider.conf.ymlin your home folder or project:.aider.conf.ymlmodel: openai/claude-sonnet-5-5 weak-model: openai/claude-sonnet-5-5 openai-api-base: https://cheaptokens.pw/v1 openai-api-key: YOUR_API_KEY show-model-warnings: false edit-format: diff
-
Install aider, then open a new terminal window.Terminal
curl -LsSf https://aider.chat/install.sh | sh
-
Save the base URL and your key as environment variables. The last line reloads your shell settings, so the variables work straight away.Terminal
echo 'export OPENAI_API_BASE="https://cheaptokens.pw/v1"' >> ~/.zshrc echo 'export OPENAI_API_KEY="YOUR_API_KEY"' >> ~/.zshrc source ~/.zshrc
-
Go to your project folder and start aider. Keep the
openai/prefix in front of the model ID: it tells aider to use the OpenAI format.Terminalaider --model openai/claude-sonnet-5-5 --weak-model openai/claude-sonnet-5-5 --no-show-model-warnings
-
To avoid typing the options each time, save them in a file named
.aider.conf.ymlin your home folder or project:.aider.conf.ymlmodel: openai/claude-sonnet-5-5 weak-model: openai/claude-sonnet-5-5 openai-api-base: https://cheaptokens.pw/v1 openai-api-key: YOUR_API_KEY show-model-warnings: false edit-format: diff
-
Install aider, then open a new terminal window.Terminal
curl -LsSf https://aider.chat/install.sh | sh
-
Save the base URL and your key as environment variables. The last line reloads your shell settings, so the variables work straight away.Terminal
echo 'export OPENAI_API_BASE="https://cheaptokens.pw/v1"' >> ~/.bashrc echo 'export OPENAI_API_KEY="YOUR_API_KEY"' >> ~/.bashrc source ~/.bashrc
-
Go to your project folder and start aider. Keep the
openai/prefix in front of the model ID: it tells aider to use the OpenAI format.Terminalaider --model openai/claude-sonnet-5-5 --weak-model openai/claude-sonnet-5-5 --no-show-model-warnings
-
To avoid typing the options each time, save them in a file named
.aider.conf.ymlin your home folder or project:.aider.conf.ymlmodel: openai/claude-sonnet-5-5 weak-model: openai/claude-sonnet-5-5 openai-api-base: https://cheaptokens.pw/v1 openai-api-key: YOUR_API_KEY show-model-warnings: false edit-format: diff
--weak-modelsets the model aider uses for commit messages. Without it, aider may pick a model that CheapTokens doesn't have.- Aider doesn't know the size or price of custom models, so it shows a warning.
--no-show-model-warningshides it. Billing is unaffected. edit-format: diffmakes edits faster and cheaper on large files. Remove it if a model struggles to produce diffs.- You can also install aider with Python:
python -m pip install aider-install, thenaider-install.