SPACE ROUTER · OpenCode
OpenCode + Space Router
Install OpenCode and add named Space Router providers, with separate keys for separate model families.
Before you start
| Field | Value | Check |
|---|---|---|
| Supported setup | Windows; macOS | Choose the matching OS installer; keep your current configuration backup |
| Account | A Space Router account and matching group credit/subscription | The app’s own login and the router API key are separate |
Download stages are shown in the terminal. Direct downloads show a progress bar or received bytes; package managers use their own output. A percentage may be unavailable. Keep the terminal open until the final installation and connection results.
Space Router one-click scripts report INSTALLATION separately from CONNECTION. DONE means the app or command was checked; VERIFIED means the stated response test passed. SKIPPED / NOT CONFIGURED needs the connection steps. FAILED / INCOMPLETE needs the displayed error fixed. A CLI test does not verify a desktop app or editor panel.
Model examples and placeholders must be replaced with IDs allowed by your key’s group. You can install the app first, then create the key before the connection steps.
When this tool uses your Space Router endpoint and key, its model requests use your Space Router balance or eligible subscription. App sign-in, app subscriptions and cloud-only features are separate. Confirm the actual route in usage history after testing.
1 · One-click installation
The one-command installer installs and checks OpenCode only. It preserves your providers and project settings. Add the Space Router credential and provider in the connection steps below.
The installer installs and verifies OpenCode. It leaves connection setup to the steps below and preserves current configuration.
Windows
Open the PowerShell app: press the Windows key, type PowerShell, and open it. Copy the command below, paste it into PowerShell, then press Enter.
irm https://stationine.com/setup-opencode.ps1 | iexOpen PowerShell from the Windows Start menu. Paste the command, press Enter, and leave the window open until it finishes.
macOS
Open the Terminal app: press Command + Space, type Terminal, and open it. Copy the command below, paste it into Terminal, then press Return.
bash -c 'script=$(curl -fL --progress-bar https://stationine.com/setup-opencode.sh) && test -n "$script" && bash -c "$script"'Open Terminal from Spotlight (Command + Space). Paste the command and press Return.
Finish only when INSTALLATION: DONE appears with a verified version. CONNECTION: NOT CONFIGURED means continue to section 3; it is not a connection failure.
opencode --versionDesktop app (optional)
Windows
Open the official OpenCode downloads page. Choose Windows x64 or ARM64 to match your device, run the installer and open a test project folder.
macOS
Choose the Apple Silicon or Intel package on OpenCode downloads. Install and open it as instructed. If Homebrew is already installed, the official desktop option is:
brew install --cask opencode-desktop2 · Create your API key
Sign in to Space Router
Open space.stationine.com and sign in to your own account. Confirm you have usable credit or an eligible subscription before testing.Create a dedicated API key
Open API Keys → Create API Key. Name the key after this tool. Select Claude / Anthropic, GPT / OpenAI, or another purchased group; use the groups actually available to your account. A key for a different model family is not interchangeable.Copy the full key and the model ID
Save the full key in your password manager. Copy one exact model ID allowed by that key’s group from Available Channels. Keep any limits or expiry you need. A model shown in an app’s public list may not belong to your key.Keep the key private
Paste the key only into your own app or local credential store. Do not include it in shared screenshots, project files, import links or support messages. For two purchased groups, create two separate keys.

3 · Connect Space Router
Quick start: Terminal
Start in your test folder
Runopencode. If a previous setup already created a Space Router provider, run/modelsand select its model; you can skip the manual credential and JSON steps.Add a custom credential
For manual setup, run/connect→ Other. Use provider IDspace-router-gptand paste your GPT-group key. This stores the credential; it does not define the endpoint or models yet.
Define the provider and default model
Back up ~/.config/opencode/opencode.json in your Windows or Mac home. Merge the following with existing settings. Replace both model placeholders with the same allowed ID; keep the provider ID identical to the credential you added.
{
"$schema": "https://opencode.ai/config.json",
"model": "space-router-gpt/YOUR_GPT_MODEL_ID",
"provider": {
"space-router-gpt": {
"npm": "@ai-sdk/openai-compatible",
"name": "Space Router GPT",
"options": {
"baseURL": "https://space.stationine.com/v1"
},
"models": {
"YOUR_GPT_MODEL_ID": {
"name": "Space Router GPT model"
}
}
}
}
}A project-level opencode.json can override the user defaults. The top-level model combines provider ID and exact model ID. Keep the real key in OpenCode’s local credential store; you do not need to put it in this JSON.
| Field | Value | Check |
|---|---|---|
| Chat Completions | @ai-sdk/openai-compatible | https://space.stationine.com/v1 |
| Responses, when supported by your selected model | @ai-sdk/openai | https://space.stationine.com/v1 |
| Claude Messages | @ai-sdk/anthropic | This adapter expects https://space.stationine.com/v1; use a separate Claude provider/key/model |
Quick start: Desktop
Open the same project and configuration
After saving the terminal/custom-provider setup, fully quit OpenCode Desktop and reopen your test folder. The desktop and terminal share the local configuration and credential store.Choose the Space Router model
Use the session model picker or Choose model in the command palette. Select Space Router GPT and the exact model you configured. Built-in OpenRouter is a different provider.If the model is absent
Check the provider ID, model map and active project config, then restart the app. In terminal,opencode auth listchecks stored provider identities; it does not test a model response.
4 · Verify a real response
Reopen the client
Save your settings, fully quit the app and reopen it. Start a new conversation. Select the Space Router provider and the exact model allowed by your key; do not leave the previous provider selected.Ask a small, checkable question
SendWhat is 17 plus 25? Reply with just the number.Expect a complete reply of42. This uses your account credit at the selected model’s normal rate. A speed check or HTTP 200 alone is not enough.Match the usage record
Open Space Router’s usage history. Match the request time, model and API key with this test. A client reply plus the matching record is stronger evidence than an “installed” or “connected” label.
Before using the agent in a real project, create a scratch folder with a harmless README and ask it to read and summarize that file. Check the proposed tool action before allowing it. Model text output alone does not establish tool-calling support.
Troubleshooting
| Symptom | What to check |
|---|---|
| 401 / 403 | Check the full key, its enabled/expiry/IP settings, and group permission. Re-paste privately; do not publish the key. |
| 404 / model not found | Match the API format, base URL and exact model ID. Do not add /v1 twice or enter a full request path into a base-URL field. |
| 429 / credit or quota error | Check account credit, key quota and rate/concurrency limits. Repeated retries do not add balance or remove a limit. |
| Timeout / incomplete reply | Check the network and channel status. Keep the time and request ID for support; do not treat a partially received reply as a successful test. |
| Still uses the previous provider | Reopen the client, start a new conversation, and check its selected provider and any environment/config overrides. Restore a backup instead of deleting the whole configuration. |
| Provider missing from /models | Check JSON syntax, the active config file, model-map keys and environment variables; reopen OpenCode. |
If you need help, send the app version, operating system, model ID, timestamp and request ID to Space Router support. Redact keys and private project content.
A saved /connect credential is not enough: the same provider ID must exist in opencode.json with a model map. A project config, enabled_providers or disabled_providers setting may hide an otherwise valid provider. Restart the desktop app after changes.
Backup, update and recovery
Before editing an existing setup, copy ~/.config/opencode/opencode.json to a private backup. Keep the original provider name and model selection so you can return to them. Do not put credential backups in a project repository.
To recover, close the client, restore the specific file or select the previous provider, then reopen it. Keep conversations and other unrelated settings. Revoke an exposed key in Space Router and create a replacement only if it was actually exposed.
Use the application’s normal update flow. Recheck the provider selection and one real response after an update; do not rerun several installers together when one is still active.