With Private AI Proxy
- Install Private AI Proxy, choose a Phala profile, sign in, and turn on Protected.
- On the Agents screen, connect OpenCode.
- Restart OpenCode.
~/.config/opencode/opencode.json with an agent-scoped token for its local API, and
restores the file when you disconnect or stop Protected.
From the CLI, the same connection is:
Without the Proxy
Create a key under Private AI → API Keys in the Phala dashboard. Export your Phala API key, then add a custom provider toopencode.json in your project:
opencode.json
/models, and select the Phala model. The key is read from the process
environment. For another model, use its ID and limits from the model catalog.
This path does not verify attestation locally; use Private AI Proxy or the TypeScript ACI Verifier. Every model on this endpoint runs in a TEE.
Check the Connection
Run/models and confirm a phala/ model is selected, then run one bounded tool task.

