Skip to content
Sign Up Free
Coding and development

Roo Code setup: API key, Base URL, and models

Install Roo Code, configure the BetterToken Base URL and API key, choose an available model, and troubleshoot common errors. Practical guidance.

To connect Roo Code to BetterToken, prepare an API key, enter the Base URL shown below, and choose a current Model ID from the model plaza.

Key settings

FieldValue
API KeyBetterToken API key
Base URLhttps://bettertoken.ai/v1
ModelA current Model ID from the model plaza

Prerequisites

Sign up and get a BetterToken API Key

Already have an account? Sign in, top up, then create a key in the console.

Additional requirements

  • VS Code installed

Install

Install Roo Code

Open VS Code, search for Roo Code in the extensions marketplace, and install it.

Manual setup

Complete this setup in the Roo Code settings UI. You do not need to edit a configuration file.

FieldValue
API KeyBetterToken API key
Base URLhttps://bettertoken.ai/v1
ModelA current Model ID from the model plaza

Setup

Clear conflicting environment variables

Terminal window
unset OPENAI_API_KEY
unset OPENAI_BASE_URL

Open Roo Code settings

Open the Roo Code Settings panel.

Configure the API provider

Fill in:

  • API Provider → OpenAI Compatible
  • Base URL → https://bettertoken.ai/v1
  • API Key → your BetterToken API Key
  • Model → a model ID copied from the model plaza

Only configure extra headers when the official docs explicitly require them

The official Roo Code material we checked focuses on OpenAI-compatible or custom API setup, but it does not treat an extra User-Agent as a required BetterToken step.

If you are also using a custom gateway, tenant routing, observability, or caching layer, add headers only according to that upstream service’s official docs.

Save and start using it

Click Save and Done, then select the configured model.

Restart Roo Code

After saving the config, restart VS Code or reload the Roo Code extension before selecting the configured model.

Verify the connection

Send a short test prompt. If the tool returns a response without an authentication or Model ID error, the connection works. Fully restart the tool after changing its configuration.

Then ask Roo Code to read one project file and summarize it. Confirm that it executes the file-reading tool and uses the result; a text reply alone does not verify agent tool use.

Switch models

Open the model selector or change the Model field in the configuration. Use the exact Model ID from the model plaza, then restart the current session.

Common errors

ErrorWhat to check
401 or UnauthorizedCheck the BetterToken API key and remove leading or trailing spaces.
404Check the Base URL and do not append a specific endpoint path.
model not foundCopy a current Model ID from the model plaza.
Changes do not applySave the configuration and fully restart the tool.

Technical details

Protocol, endpoint, and internal provider fields

This setup uses https://bettertoken.ai/v1. The tool appends the OpenAI-compatible endpoint path. Do not add /chat/completions or /responses unless a specific field explicitly requires it.