Documentation Index
Fetch the complete documentation index at: https://docs.llmeasy.ru/llms.txt
Use this file to discover all available pages before exploring further.
You can connect LLMEasy to OpenCode by first adding credentials with /connect, then declaring LLMEasy as an OpenAI-compatible provider in the config file and selecting a model ID from the Codex group.
Prerequisites
- LLMEasy API Key (register here (
https://www.llmeasy.ru/register))
Install OpenCode
curl -fsSL https://opencode.ai/install | bash
npm install -g opencode-ai
Setup
Automatic setup
Configure via CC Switch
Manual setup
You can run the LLMEasy automatic setup script directly. It only writes the LLMEasy provider configuration and does not replace the installation prerequisites above. The script requires Node.js. If you do not pass an API Key or model explicitly, the script prompts for them when the tool supports interactive input.Follow the step for your operating system. You only need one of them.If you use macOS / Linux
curl -fsSL https://www.llmeasy.ru/install-opencode-provider.sh | bash
If you use Windows
iwr https://www.llmeasy.ru/install-opencode-provider.ps1 -OutFile "$env:TEMP\install-opencode-provider.ps1"; powershell -ExecutionPolicy Bypass -File "$env:TEMP\install-opencode-provider.ps1"
Clear conflicting environment variables
unset OPENAI_API_KEY
unset OPENAI_BASE_URL
Add the LLMEasy credential with /connect first
Start OpenCode and run:In the wizard, choose Other and then:
- set the provider id to
llmeasy
- paste your LLMEasy API Key
OpenCode stores the credential in ~/.local/share/opencode/auth.json. Edit the OpenCode config file
You can use the global config at ~/.config/opencode/opencode.json or create opencode.json in your project root. The project config has higher precedence.{
"$schema": "https://opencode.ai/config.json",
"model": "llmeasy/YOUR_CODEX_MODEL_ID",
"provider": {
"llmeasy": {
"npm": "@ai-sdk/openai-compatible",
"name": "LLMEasy",
"options": {
"baseURL": "https://www.llmeasy.ru/v1"
},
"models": {
"YOUR_CODEX_MODEL_ID": {
"name": "YOUR_CODEX_MODEL_ID"
}
}
}
}
}
Replace YOUR_CODEX_MODEL_ID with a current Codex group model ID copied from the model plaza (https://www.llmeasy.ru/pricing). If you want to inline the API key, use this fallback format
{
"$schema": "https://opencode.ai/config.json",
"model": "llmeasy/YOUR_CODEX_MODEL_ID",
"provider": {
"llmeasy": {
"npm": "@ai-sdk/openai-compatible",
"name": "LLMEasy",
"options": {
"baseURL": "https://www.llmeasy.ru/v1",
"apiKey": "YOUR_API_KEY"
},
"models": {
"YOUR_CODEX_MODEL_ID": {
"name": "YOUR_CODEX_MODEL_ID"
}
}
}
}
}
This is a fallback. The /connect flow above is the preferred setup.Only use `options.headers` for provider-specific needs
OpenCode’s official docs support custom headers through provider.<id>.options.headers, but this is optional. You usually do not need an extra User-Agent when connecting LLMEasy.If you are also using Helicone, tenant routing, observability, or caching services, add the required headers based on those upstream services’ official docs.
Restart OpenCode
After updating the config file, quit the current OpenCode session and start it again.
Start OpenCode
cd /path/to/your/project
opencode
Notes
- Use a Codex group model ID as the default model instead of fixed Claude model names
- LLMEasy should currently use
@ai-sdk/openai-compatible as the OpenAI-compatible provider adapter
- If you use
/connect, you usually do not need to store the API key directly in the config file
- OpenCode’s official docs treat
options.headers as optional extended configuration; LLMEasy usually does not need extra headers