Tool Integration

OpenCode

Configure OpenCode with @ai-sdk/openai-compatible, project opencode.json, and the Ling.AI /v1 baseURL.

Base https://api.vip.lingapi.ai/v1

Quick checklist

  1. Run opencode auth login, then choose /connect if your build exposes the browser connection flow.
  2. Create or update project opencode.json instead of relying on stale global examples.
  3. Use @ai-sdk/openai-compatible and set options.baseURL to https://api.vip.lingapi.ai/v1.
  4. 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.vip.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.vip.lingapi.ai/v1",
        "apiKey": "{env:LING_AI_API_KEY}"
      },
      "models": {
        "<model id from /v1/models>": {}
      }
    }
  }
}
File: opencode.json