Tool Integration
OpenCode
Configure OpenCode with @ai-sdk/openai-compatible, project opencode.json, and the Ling.AI /v1 baseURL.
Base
https://api.lingapi.ai/v1
Quick checklist
- Run opencode auth login, then choose /connect if your build exposes the browser connection flow.
- Create or update project opencode.json instead of relying on stale global examples.
- Use @ai-sdk/openai-compatible and set options.baseURL to https://api.lingapi.ai/v1.
- Verify the configured model id exists in /v1/models before using agent mode.
Current provider shape
OpenCode uses AI SDK provider packages. For Ling.AI, use @ai-sdk/openai-compatible and baseURL; do not use old OpenAI-only snippets unless your version documents that path.
CC Switch
OpenCode can also be configured from the OpenCode tool page in CC Switch with base URL https://api.lingapi.ai/v1 and a model id from /v1/models. Restart OpenCode after switching providers.
Validation
Run a short read-only command, then check Ling.AI usage and billing records before enabling write actions.
Example
Example
{
"provider": {
"lingai": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ling.AI",
"options": {
"baseURL": "https://api.lingapi.ai/v1",
"apiKey": "{env:LING_AI_API_KEY}"
},
"models": {
"<model id from /v1/models>": {}
}
}
}
}
File: opencode.json