← All applications · Connect apps section on /docs
OpenAIManual setup
OpenCode
OpenCode: hướng dẫn cấu hình khóa API, model và nhà cung cấp trong terminal.
Published instructions · App version: unverified
Chat, ping, invoke and content-generation examples may send real billable requests. Check the model, balance, rate and minimum before running them. GET /v1/models checks authentication and the catalogue only. Set up environment variables safely
Base URL to paste
OpenAI SDKs generally use a URL ending in /v1; Anthropic SDKs use the root URL. Avoid adding /v1 twice. Protocol compatibility does not guarantee every provider feature.
https://apistack.vn/v1Prerequisites
- Cài opencode
- API key
Recommended model: gpt-5.6-sol
Quick way — command / config
export API_KEY="sk-stk-..."Where to place file / fill Settings
Filemacos
~/.config/opencode/opencode.json
Sao lưu file; ghép provider.API Stack và model như mẫu. Đặt API_KEY trong môi trường tiến trình OpenCode.
Filelinux
~/.config/opencode/opencode.json
Giống macOS.
Filewindows
%USERPROFILE%\.config\opencode\opencode.json
Tạo .config\opencode nếu thiếu; lưu opencode.json. Đặt $env:API_KEY trước khi mở OpenCode.
Verify connection
- Chạy opencode models "API Stack" để kiểm tra model; chọn API Stack/gpt-5.6-sol trước khi chat thử có tính phí.
Troubleshooting
| Symptom | Reason | How to handle |
|---|---|---|
| 404 | baseURL thiếu /v1. | https://apistack.vn/v1 |
Notes
- Có thể dùng opencode.json tại gốc dự án; file dự án ghi đè cấu hình global. Đường dẫn khác cần OPENCODE_CONFIG.