DEV Community

Adela for BetterToken.ai

Posted on Edited on Originally published at bettertoken.ai

Configure Kilo Code with a Custom API: First Request

Kilo Code can connect through its built-in OpenAI Compatible provider. You need a current extension, your own API Key, a Base URL, and the current Model ID. Restart the extension after setup, send a short request, then check the model, status, and Token usage in the Dashboard.

Want to repeat this setup in your project? Create a BetterToken account

For BetterToken, begin with the documented Base URL. For another provider, do not remove /v1/chat/completions automatically: check its current Provider API and URL contract first.

Keep the current Kilo Code instructions open while configuring it. This article leaves the Model ID as a placeholder because available models and groups can change.

What to prepare

  • installed VS Code;
  • current Kilo Code extension from the official source;
  • own API Key BetterToken;
  • current Model ID from model catalog;
  • an empty or test directory where it is safe to execute the first request.

BetterToken is responsible for the Endpoint API. Availability of the Kilo Code website, VS Code Marketplace, downloads and updates depends on third party services.

Regional availability note

From Russia, the BetterToken API endpoint can be reached without a VPN. This is not a promise of availability on Marketplace or other third-party sites.

1. Install Kilo Code

Open Extensions in VS Code, find the official Kilo Code card, and install the current version. If Marketplace is unavailable, use only an alternative listed in the current Kilo Code documentation; do not use unofficial VSIX mirrors.

2. Create an API Key

Login to your BetterToken Workspace and create a separate Key for the test. Do not paste it into a prompt, issue, screenshot, or repository file. In the Kilo Code interface, the key is stored as the credential of the selected provider.

Before setting up, check if there are any old OPENAI_API_KEY and OPENAI_BASE_URL from another service in your environment. Do not log their values. If a variable conflicts with a Kilo Code setting, remove it only from the profile or shell file where it was intentionally set.

3. Add OpenAI-compatible provider

Open the Kilo Code guide in BetterToken Docs and follow its current provider setup through the first request. Choose OpenAI Compatible, use your own API Key, and take the Base URL and exact Model ID from that page. Save and restart the extension; fields and models can change, so this article does not copy the whole UI.

4. Execute the first request

Open an empty test directory and submit a request without access to important files:

Return only JSON: {"tool":"kilo-code","sum":4}. Do not modify files.
Enter fullscreen mode Exit fullscreen mode

Such a test is easier to check than a general “write some code” request. Successful connection is confirmed by four signs:

  • Kilo Code returned valid JSON;
  • the extension used the selected Model ID;
  • the BetterToken Dashboard shows an entry with a successful status;
  • the entry shows input, output, applicable cache Tokens, and the corresponding charge.

Use the Dashboard for request metadata and Token usage. It does not store the full prompt or response text.

Frequent errors

401 or Unauthorized

Re-copy the API Key from your Workspace and remove any stray spaces. Make sure that the field contains the BetterToken Key and not the key of another service. Do not transfer the secret to the configuration file for diagnostic purposes.

404

Check Base URL:

https://www.bettertoken.ai/v1
Enter fullscreen mode Exit fullscreen mode

For BetterToken, start with the documented Base URL above. If another full path is entered, first check the selected Provider API and current BetterToken contract: Kilo Code accepts a full endpoint URL, so a suffix alone does not prove an error.

model not found

Copy the exact Model ID from the current catalog. A model name in an article, old screenshot, or someone else's configuration may not match the current identifier.

Settings not applied

Save the provider, run Developer: Reload Window, and open a new Kilo Code session. Then check for old OPENAI_API_KEY and OPENAI_BASE_URL variables without printing their values to a public log.

Where is the support boundary?

This scheme tests the model API through the OpenAI-compatible provider. It does not endorse the availability of all Kilo Code features, third party Marketplaces, accounts, MCP servers, or updates. If the first short request passes, but a separate extension function fails, diagnose it as a separate layer.

To reconfigure, use Kilo Code page in BetterToken Docs: there are current fields, Base URL and provider restrictions.


Originally published on the BetterToken blog.

BetterToken provides pay-as-you-go access to AI model APIs through
OpenAI-compatible and Anthropic-compatible endpoints — useful if you are wiring
Claude Code, Codex, or your own tooling to a custom base URL.
See the docs to get started.

Top comments (0)