BEATRICE Docs
Sections

OpenCode

OpenCode accepts OpenAI-compatible providers through @ai-sdk/openai-compatible. Add Beatrice to opencode.json (in the project, or in the global configuration):

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "beatrice": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Beatrice",
      "options": {
        "baseURL": "https://api.beatriceai.it/v1",
        "apiKey": "{env:BEATRICE_API_KEY}"
      },
      "models": {
        "beatrice-flash": {
          "name": "Beatrice Flash",
          "limit": { "context": 262144, "output": 32768 }
        }
      }
    }
  }
}
  • The key comes from the BEATRICE_API_KEY environment variable. Alternatively run /connect in OpenCode, enter the beatrice provider and paste the key.
  • The key of the models block (beatrice-flash) must be exactly the model id.
  • Then pick the model with /models.

l'amor che move il sole e l'altre stelle