# OpenCode (/docs/development/developer-tools/opencode)



`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 [#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 [#1-install-opencode]

Install OpenCode using your preferred installation method.

Examples:

```bash
brew install opencode
```

```bash
npm install -g opencode
```

2\. Prepare Authentication [#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 [#3-configure-the-provider]

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

Example configuration:

```json
{
  "$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 [#4-run-opencode]

Example:

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

5\. Check Model Availability First [#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:

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

Why This Is The Recommended Path [#why-this-is-the-recommended-path]

This gives OpenCode users:

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

Related Pages [#related-pages]

* [Developer Tools](/docs/development/developer-tools)
* [Use local models via API](/docs/development/use-local-models-via-api)
* [API Reference](/docs/api-reference)
