Routescope APIRoutescope API
Client Tool Setup

Connect OpenCode to Routescope

Add Routescope as a custom provider in OpenCode Desktop with your API Key and model.

Connect OpenCode to Routescope so you can chat and code in OpenCode using your Routescope quota.

This guide is written for first-time setup. Everything is done by clicking and filling in forms. No coding or command line is required. The process takes about five minutes.

Last updated: 2026-07-13

What You Need to Do

  1. Get a Routescope secret that starts with sk-.
  2. Install OpenCode Desktop.
  3. Enter the secret in OpenCode and choose a model.

Before You Start: Prepare Two Things

Keep these two values nearby before opening OpenCode.

1. Routescope Secret (API Key)

This secret is the passcode OpenCode uses to call models through Routescope.

  1. Open a browser and sign in to the Routescope console.
  2. In the left menu, open Token Management.
  3. Click Add Token.
  4. Use any token name you can recognize, such as OpenCode.
  5. For first-time setup, keep quota, allowed models, and expiration at their defaults.
  6. Click Save.
  7. Back in the token list, click Copy Access Code on that token.

You will copy a string that starts with sk-, for example:

sk-xxxxxxxxxxxxxxxx

Save the whole string, including the sk- prefix. Do not remove any characters.

Protect your secret

This secret is like a password. Do not send it to others or include it in screenshots, chats, or public documents.

2. An Available Model Name (Model ID)

The model ID is the AI model you want to use, such as gpt-5.4. It must be a model that is actually enabled for your account.

  1. Open Routescope Model Plaza.
  2. Find a model that your token can use.
  3. Copy the full Model ID. Copy the ID, not the display name.

Step 1: Install OpenCode Desktop

If OpenCode is not installed yet:

  1. Visit the OpenCode website.
  2. Find the Download entry and choose the version for your computer, such as Windows or macOS.
  3. Install it like a normal desktop app.
  4. Open OpenCode after installation.

Step 2: Open Settings

  1. In OpenCode, look at the lower-left corner of the window.
  2. Click the settings button, usually shown as a gear icon.

Step 3: Find Providers and Add One

A provider means "which AI service this is". You will add a provider for Routescope.

  1. In settings, click Providers in the left menu.
  2. If you do not see Custom Provider directly, click See more providers at the bottom.
  3. Find Custom or Custom Provider, then click Connect.

Step 4: Enter Routescope Values

A form appears. Fill it in as follows:

FieldValuePlain explanation
Provider IDroutescopeInternal provider code; use lowercase English
Display nameRoutescopeOnly affects the name shown in the UI
Base URLhttps://api.routescope.ai/v1Routescope endpoint; it must end with /v1
API KeyYour sk-... secretPaste the full secret from preparation
Model IDFor example gpt-5.4Replace with the real model enabled for your account
Model display nameFor example GPT-5.4Only affects how the model appears in the UI

Click Save after filling the form.

The two most common mistakes:

  • Base URL must end with /v1. https://api.routescope.ai will not work, and .../v1/v1 will not work either.
  • Model ID must exactly match the model enabled in Routescope. Do not invent one and do not use only the display name.

Step 5: Confirm It Is Really Connected

Asking the AI to say "I am connected to Routescope" is not enough. It may only repeat your words. Confirm it this way:

  1. In OpenCode, send a normal message, for example:

    First reply "OpenCode is connected to Routescope", then list the top-level directory of the current project.
  2. After receiving a response, return to the Routescope console.

  3. Open Operation Records or Call Records.

  4. Check whether a new record appears from the same time, whether the status is successful, and whether billing looks normal.

OpenCode is truly connected only when OpenCode replies normally and Routescope shows the corresponding successful record.

Troubleshooting

401 or 403

This is usually a secret or permission issue. Check: the secret is complete, the sk- prefix is present, the Base URL includes /v1, the model is allowed by the token, and the token is not expired or out of quota.

Cannot Find the Model I Added

Go back to Settings -> Providers and confirm the custom provider was saved. Then check that the model ID exactly matches the one in the Routescope console.

Which Base URL Should I Use?

Use https://api.routescope.ai/v1. Do not use only https://api.routescope.ai, and do not duplicate /v1 into .../v1/v1.

Still Stuck

Do not keep guessing. Send support a screenshot of the step where you are stuck, with the secret masked.

References

Last updated on