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_KEYenvironment variable. Alternatively run/connectin OpenCode, enter thebeatriceprovider and paste the key. - The key of the
modelsblock (beatrice-flash) must be exactly the model id. - Then pick the model with
/models.