/connect, then declaring BetterToken as an OpenAI-compatible provider in the config file and selecting a model ID from the Codex group.
Prerequisites
- BetterToken API Key (register here (
https://www.bettertoken.ai/register))
Install OpenCode
- curl
- npm
Setup
- Automatic setup
- Configure via CC Switch
- Manual setup
You can run the BetterToken automatic setup script directly. It only writes the BetterToken provider configuration and does not replace the installation prerequisites above. The script requires
Node.js. If you do not pass an API Key or model explicitly, the script prompts for them when the tool supports interactive input.Follow the step for your operating system. You only need one of them.Notes
- Use a Codex group model ID as the default model instead of fixed Claude model names
- BetterToken should currently use
@ai-sdk/openai-compatibleas the OpenAI-compatible provider adapter - If you use
/connect, you usually do not need to store the API key directly in the config file - OpenCode’s official docs treat
options.headersas optional extended configuration; BetterToken usually does not need extra headers