# opencode

Set up sivcloud in opencode: a ready-to-copy configuration snippet.

opencode uses the chat completions endpoint. The list of models and the endpoints each one opens is on the Models page in the console.

## Set up

**`opencode.jsonc`**

```json
{
  "$schema": "https://opencode.ai/config.json",
  "model": "sivcloud/deepseek-v4.1-flash",
  "providers": {
    "sivcloud": {
      "name": "sivcloud",
      "env": ["SIVCLOUD_API_KEY"],
      "package": "@opencode/ai/providers/openai-compatible",
      "settings": { "baseURL": "https://ai.sivcloud.com/v1" },
      "models": { "deepseek-v4.1-flash": { "name": "DeepSeek V4.1 Flash" } }
    }
  }
}
```

## Check

1. Save the configuration, then restart opencode if needed.
2. Send a short message. The usage shows on the [Usage](https://sivcloud.com/en/docs/console/usage/) page within moments.
3. Seeing `invalid_api_key`? Check the API key. Seeing `model_not_found`? Check the model id. Full list: [Error codes](https://sivcloud.com/en/docs/errors/).

The request format is explained on the [endpoint page](https://sivcloud.com/en/docs/chat-completions/). Never write the API key into a file that goes into a repository.
