Skip to main content

OpenCode setup (Grok 4.5)

OpenCode supports custom OpenAI-compatible providers. Point baseURL at the gateway and use grok-4.5.

1. Set API key

2. Edit OpenCode config

Global config (recommended):
You can also place opencode.json in a project root (project keys override).
Notes:
  • model is providerID/modelID → arona/grok-4.5
  • options.baseURL must include /v1
  • Use {env:ARONA_API_KEY} so secrets stay out of git

Option B: /connect

  1. Define provider.arona (npm, baseURL, models)
  2. Run /connect if your version supports custom providers
  3. /models → arona/grok-4.5
Config file + env var is the most reliable path.

3. Verify

Notes

  • Include /v1 in baseURL
  • Model IDs must match GET /v1/models for your key
  • Never commit plaintext keys; use {env:...}
  • Optional: whitelist: ["grok-4.5"] on the provider

FAQ

/models has no arona

  • Check JSON path/syntax
  • Confirm npm is @ai-sdk/openai-compatible
  • Restart OpenCode

401 Unauthorized

  • ARONA_API_KEY exported in the current shell
  • Key complete and bound to the right group

Tools flaky

Use Chat Completions compatibility; if tools fail, test plain chat or switch groups.