AI coding agent cho terminal
OpenCode
> Cấu hình OpenCode qua @ai-sdk/openai-compatible để gọi các model của ProxyLLM.
[INFO]Provider
Dùng một provider OpenAI-compatible duy nhất cho toàn bộ model GPT và Claude Opus.
//Điều kiện tiên quyết
- OpenCode đã cài đặt:
npm install -g opencode-ai - API key ProxyLLM (lấy tại đây)
//Mở file config OpenCode
shellbash
# Project-level config
touch opencode.json
# Or global
code ~/.config/opencode/opencode.json//Cấu hình provider
opencode.jsonjson
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"proxyllm": {
"name": "ProxyLLM",
"npm": "@ai-sdk/openai-compatible",
"options": {
"apiKey": "your-proxyllm-api-key",
"baseURL": "https://api.proxyllm.eu/v1"
}
}
}
}//Khai báo mô hình
opencode.jsonjson
{
"provider": {
"proxyllm": {
"name": "ProxyLLM",
"npm": "@ai-sdk/openai-compatible",
"options": {
"apiKey": "your-proxyllm-api-key",
"baseURL": "https://api.proxyllm.eu/v1"
},
"models": {
"gpt-6-astra": {
"name": "GPT 6 Astra",
"limit": { "context": 1000000, "output": 64000 },
"tool_call": true
},
"gpt-6.1-sol": {
"name": "GPT 6.1 Sol",
"limit": { "context": 1050000, "output": 64000 },
"tool_call": true
},
"gpt-6-sol": {
"name": "GPT 6 Sol",
"limit": { "context": 1000000, "output": 64000 },
"tool_call": true
},
"gpt-6-luna": {
"name": "GPT 6 Luna",
"limit": { "context": 1000000, "output": 64000 },
"tool_call": true
},
"gpt-5.6-sol": {
"name": "GPT 5.6 Sol",
"limit": { "context": 200000, "output": 64000 },
"tool_call": true
},
"claude-opus-5-5": {
"name": "Claude Opus 5.5",
"limit": { "context": 1000000, "output": 64000 },
"tool_call": true
},
"claude-opus-5": {
"name": "Claude Opus 5",
"limit": { "context": 200000, "output": 64000 },
"tool_call": true
},
"claude-opus-4-7": {
"name": "Claude Opus 4.7",
"limit": { "context": 200000, "output": 64000 },
"tool_call": true
},
"claude-opus-4-6": {
"name": "Claude Opus 4.6",
"limit": { "context": 200000, "output": 64000 },
"tool_call": true
},
"gpt-5.5": {
"name": "GPT-5.5",
"limit": { "context": 200000, "output": 64000 },
"tool_call": true
}
}
}
},
"defaultModel": "claude-opus-5"
}