> ## Documentation Index
> Fetch the complete documentation index at: https://bianxieai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenCode

> Add an OpenAI-compatible provider to OpenCode

## Configure

Add an OpenAI-compatible provider in OpenCode. Set `baseURL` to `https://api.bianxie.ai/v1`, use `BIANXIE_API_KEY` for the API key environment variable, and select `your-model`.

```bash theme={null}
export BIANXIE_API_KEY="API_KEY"
```

Configuration formats vary by OpenCode version. Prefer the **OpenAI Compatible** provider instead of a preset with a fixed official URL.

Restart OpenCode and confirm the provider appears in the model picker. Ask it to read one file before testing edits. If the provider is absent, validate JSON/JSONC syntax. For `401`, confirm the launching shell can read the variable; for `404`, check `/v1`; for tool errors, use a tool-capable model.
