TokenOff
Open-Source Models

OpenCode

Use TokenOff open-source model service in OpenCode Agent.

Download OpenCode from the OpenCode website. You can choose:

  • OpenCode CLI
  • OpenCode Desktop

You can use TokenOff's open-source model service as follows.

Get API Key

Go to the API Keys page to create your API key.

Configuration

  • Add a custom Provider

    Create an opencode.jsonc file in the user's ~/.config/opencode directory with the following content:

    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
          "tokenoff": {
              "npm": "@ai-sdk/openai-compatible",
              "name": "Tokenoff",
              "options": {
                  "baseURL": "https://tokenoff.com/api/v1"
              },
              "models": {
                  "deepseek-v4.1-flash": {
                      "name": "DeepSeek-V4.1-Flash"
                  }
              }
          }
      }
    }

    models defines the list of models you want to use, and each key is the model id.

    OpenCode's settings page also provides an entry for adding a custom model provider, but in testing (version 2.0.28) it reports an error when adding. We recommend this configuration method instead.

    You can add multiple providers; just make sure the key and name do not conflict.

  • Then open OpenCode, start a new session, type /connect in the input box, and select the provider you added above (e.g. tokenoff) in the popup window. Enter your API key on the page that opens.

    This needs to be done once for each provider.

  • After OpenCode shows that the connection succeeded, you can see the models you added in the session's model list.

Contact Us

If you encounter any issues while using TokenOff: