API GuideGetting StartedClient Setup
OpenCode Setup
Connect OpenCode to Tokenfly
Installation
npm install -g opencode-aiCheck the Version
After installation, run the following command to confirm the version:
opencode --versionStart OpenCode
Type the following command and press Enter to open OpenCode:
opencodeEnd the Current Session
Press Ctrl+x within an OpenCode session to end the current session.
To start a new session, run the start command again:
opencodeConfigure opencode.jsonc / opencode.json
The default installation path is:
C:\Users\<current Windows user>\.config\opencodeEdit the opencode.jsonc or opencode.json file with the following content:
{
"$schema": "https://opencode.ai/config.json",
"model": "hosted_vllm/gpt-5.4",
"provider": {
"hosted_vllm": {
"npm": "@ai-sdk/openai-compatible",
"name": "Hosted vLLM",
"options": {
"apiKey": "sk-.......",
"baseURL": "https://tokenfly.com/v1"
},
"models": {
"gpt-5.4": {
"name": "gpt-5.4"
}
}
}
}
}Configuration Reference
| Field | Description |
|---|---|
apiKey | Paste the key created on the platform |
baseURL | Request address |
models | Model name, case-sensitive |
How is this guide?