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
- Get a Routescope secret that starts with
sk-. - Install OpenCode Desktop.
- 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.
- Open a browser and sign in to the Routescope console.
- In the left menu, open Token Management.
- Click Add Token.
- Use any token name you can recognize, such as
OpenCode. - For first-time setup, keep quota, allowed models, and expiration at their defaults.
- Click Save.
- Back in the token list, click Copy Access Code on that token.
You will copy a string that starts with sk-, for example:
sk-xxxxxxxxxxxxxxxxSave 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.
- Open Routescope Model Plaza.
- Find a model that your token can use.
- Copy the full Model ID. Copy the ID, not the display name.
Step 1: Install OpenCode Desktop
If OpenCode is not installed yet:
- Visit the OpenCode website.
- Find the Download entry and choose the version for your computer, such as Windows or macOS.
- Install it like a normal desktop app.
- Open OpenCode after installation.
Step 2: Open Settings
- In OpenCode, look at the lower-left corner of the window.
- 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.
- In settings, click Providers in the left menu.
- If you do not see Custom Provider directly, click See more providers at the bottom.
- Find Custom or Custom Provider, then click Connect.
Step 4: Enter Routescope Values
A form appears. Fill it in as follows:
| Field | Value | Plain explanation |
|---|---|---|
| Provider ID | routescope | Internal provider code; use lowercase English |
| Display name | Routescope | Only affects the name shown in the UI |
| Base URL | https://api.routescope.ai/v1 | Routescope endpoint; it must end with /v1 |
| API Key | Your sk-... secret | Paste the full secret from preparation |
| Model ID | For example gpt-5.4 | Replace with the real model enabled for your account |
| Model display name | For example GPT-5.4 | Only 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.aiwill not work, and.../v1/v1will 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:
-
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. -
After receiving a response, return to the Routescope console.
-
Open Operation Records or Call Records.
-
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
Connect VS Code to Routescope (Cline Example)
Install Cline in VS Code and connect it to Routescope through OpenAI Compatible settings.
Route Simple Tasks to Qwen / DeepSeek to Reduce Costs
Choose Qwen or DeepSeek in your request or client for summarization, classification, rewriting, and other simple tasks.