xmr4ai
opencode integration
Terminal coding agent. Talks to any OpenAI-compatible provider.
All integrationsSupported
opencode
Terminal coding agent. Talks to any OpenAI-compatible provider.
- Base URL
- https://xmr4ai.com/api/v1
- Config
- ~/.config/opencode/opencode.json
- Provider npm
- @ai-sdk/openai-compatible
Create a key
Mint one on the API keys page and name it opencode, so it can be revoked on its own if the machine it lives on is lost.Put the key in your environment
The config below reads it from there rather than holding the secret itself, so the file stays safe to commit to a repo.Register the provider
Add this to ~/.config/opencode/opencode.json for every project, or to opencode.json in a repo to scope it there. Models are declared explicitly — opencode cannot enumerate a custom provider’s catalogue, so anything you want to select has to be listed.Or hand the key to opencode directly
Instead of the environment variable, run /connect inside opencode, choose Other, enter the provider id xmr4ai, and paste the key. It is stored in opencode’s own credentials file rather than in the config you just edited — drop the apiKey line if you go this route.Run it
The model argument is the provider id, then the model id, separated by a slash. /models picks one interactively instead.
Things that bite here
- A coding agent fans out into many small calls, and the per-minute rate limit is shared with everything else on the account. The overview shows what is left in the current window.
- Only models that support tool calls can drive an agent loop. A model without tool support will answer, and then do nothing — the model catalogue marks which is which.
Finding model ids
Both configs above name models explicitly. The catalogue endpoint is the authority on what those ids are.