Coding agents

Use TokenRex with OpenCode

Use TokenRex as a custom OpenAI-compatible provider in OpenCode.

Before you start

  • A TokenRex API key
  • A version of the app that accepts a custom OpenAI-compatible base URL

Step-by-step setup

  1. 1

    Open your opencode.json configuration file.

  2. 2

    Add a custom OpenAI-compatible provider named TokenRex.

  3. 3

    Set its baseURL to https://tokenrex.ai/api/public/v1, add your key, and register an exact model ID.

  4. 4

    Open /models inside OpenCode and choose the TokenRex model.

Verify the connection

Start a short chat, then confirm the request appears in your TokenRex Dashboard with the model ID you selected.