gradiated

Use Gradiated with OpenCode

Add Gradiated as an OpenCode provider. Your current provider and default model stay unchanged.

Set up automatically

Run the Gradiated wizard:

npx -y @gradiated/wizard --agent opencode

The wizard adds the provider and available models to your user configuration. It preserves your default model and writes a backup before it changes the file.

Start OpenCode after the wizard finishes:

opencode

Run /models and choose Gradiated when you want to switch models.

Set up manually

Set your Gradiated API key in the shell that starts OpenCode:

export GRADIATED_API_KEY="grad_..."

Add Gradiated to opencode.json

Add this provider to your project or user configuration. Keep the API key in the environment.

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "gradiated": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Gradiated",
      "options": {
        "baseURL": "https://api.gradiated.com",
        "apiKey": "{env:GRADIATED_API_KEY}"
      },
      "models": {
        "YOUR_MODEL_ID": {
          "name": "Your model name"
        }
      }
    }
  }
}

Replace YOUR_MODEL_ID with an ID from models and pricing.

The adapter adds the Chat Completions path, so baseURL stays https://api.gradiated.com.

Select the model

Start OpenCode and run:

/models

Choose the Gradiated provider and model.

Add model limits when needed

Add the model context and output limits when you want OpenCode to enforce them:

{
  "models": {
    "YOUR_MODEL_ID": {
      "name": "Your model name",
      "limit": {
        "context": 128000,
        "output": 4096
      }
    }
  }
}

Use the limits from the selected model.

Troubleshooting

  • Check that GRADIATED_API_KEY is set in the same shell that starts OpenCode.
  • Check that baseURL is https://api.gradiated.com.
  • Check that the model ID matches the catalog response.
  • Check that the workspace has billing capacity.
  • Run opencode auth list if OpenCode reports a provider authentication error.

Uninstall

Run the uninstall command:

npx -y @gradiated/wizard uninstall

Select OpenCode. The wizard removes the provider and stored credential. It keeps a timestamped backup.

OpenCode's provider documentation covers custom provider settings and the /models command.