OpenCode

Configure OpenCode to use BullSequana AI from terminal-first development workflows.

Agentic Friendly

OpenCode should also be connected to BullSequana AI through the CoreAI API.

Even though internal platform components may use LiteLLM behind the scenes, the recommended developer integration path is the stable BullSequana API endpoint.

What To Use

Use:

  • API type: OpenAI-compatible
  • base URL: https://llm-backend.<platform-domain>/v1
  • token: JWT or sk-bsq-... API key

Do not configure OpenCode against an internal LiteLLM endpoint as the default developer path.

1. Install OpenCode

Install OpenCode using your preferred installation method.

Examples:

brew install opencode
npm install -g opencode

2. Prepare Authentication

Use either:

  • a JWT bearer token
  • a BullSequana AI API key

For most persistent local tool configurations, API keys are usually more practical.

3. Configure the Provider

Create or edit ~/.config/opencode/opencode.json.

Example configuration:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "bsqai": {
      "name": "BullSequana AI",
      "api": "openai",
      "options": {
        "baseURL": "https://llm-backend.<platform-domain>/v1",
        "apiKey": "sk-bsq-v1-..."
      },
      "models": {
        "<model-name-from-/v1/models>": {
          "name": "<model-name-from-/v1/models>"
        }
      }
    }
  }
}

4. Run OpenCode

Example:

opencode --provider bsqai --model <model-name-from-/v1/models>

5. Check Model Availability First

Available models are also visible in the CoreAI Portal.

If you want the API-level source of truth for the current environment, use:

curl "https://llm-backend.<platform-domain>/v1/models" \
  -H "Authorization: Bearer <your-token>"

This gives OpenCode users:

  • a stable API contract
  • consistent authentication
  • environment portability across clusters
  • less coupling to internal platform implementation details

On this page