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

# OpenCode

> Install RedPill as a native OpenCode provider with automatic ACI verification.

OpenCode 1.18.24 or newer is recommended.

## Install

```bash theme={null}
opencode plugin opencode-provider-redpill --global
```

Restart OpenCode after installation. Omit `--global` to install the plugin for one project.

## Connect and choose a model

Use OpenCode's native TUI:

```text theme={null}
/connect
# select RedPill AI and enter your API key

/models
# search for redpill/ and choose a model
```

OpenCode persists the plugin configuration and key in its own stores. Do not add a separate
`provider.redpill` block.

For one process, set `REDPILL_AI_API_KEY` instead. OpenCode does not copy environment variables into
its auth store.

## Inspect ACI

Attestation and every response receipt are verified automatically. These commands inspect the same
provider state without changing enforcement:

```text theme={null}
/redpill-attestation
/redpill-receipts
/redpill-receipt [receipt-id]
/redpill-session <session-id>
```

OpenCode routes these commands through the read-only `redpill_aci_inspect` tool. It does not run a
second verifier or maintain a second credential store.

## Troubleshooting

| Symptom                           | Check                                                                                                      |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| RedPill is absent from `/connect` | Run `opencode debug config` and confirm `opencode-provider-redpill` is in `plugin`, then restart OpenCode. |
| No models appear                  | Run `opencode models redpill` and check the provider error.                                                |
| Authentication fails              | Reconnect with `/connect`, or confirm the process can read `REDPILL_AI_API_KEY`.                           |

## References

* [OpenCode providers](https://opencode.ai/docs/providers/)
* [OpenCode plugins](https://opencode.ai/docs/plugins/)
* [RedPill model catalog](/api-reference/models)
