Use OpenCode with Steerwise
OpenCode adds Steerwise as an OpenAI-compatible provider at /v1/chat/completions.
- Needs: a Steerwise key
- Endpoint: POST /v1/chat/completions
Set it up
Replace <model id> with auto or any id from GET /v1/models, and YOUR_API_KEY with your key. The Console’s Connect your tool page fills these in for your key and plan.
Add to opencode.json in your project, or to ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"steerwise": {
"npm": "@ai-sdk/openai-compatible",
"name": "Steerwise",
"options": {
"baseURL": "https://api.steerwise.s3techpulse.com/v1",
"apiKey": "{env:STEERWISE_API_KEY}"
},
"models": {
"<model id>": {
"name": "<model id>"
}
}
}
}
}Then, in your shell:
export STEERWISE_API_KEY="YOUR_API_KEY"Check that it works
Send one short request with the same key. It costs a few tokens and shows up in the Console under Usage, with the model that answered and its cost.
curl https://api.steerwise.s3techpulse.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "auto", "max_tokens": 16, "messages": [{"role": "user", "content": "Say hi"}]}' Notes
- In OpenCode, pick the model as
steerwise/<model id>. - Confirm: the provider format above matches your OpenCode version.
If a request fails
The codes you are most likely to see while setting up:
| Status | Code | When |
|---|---|---|
| 401 | invalid_api_key | The key is malformed, unknown, revoked or expired. |
| 402 | insufficient_balance | The wallet balance is too low for this request. |
| 402 | spend_cap_reached | Spend has reached a daily or monthly cap of the key or the organisation, or the agent run’s cap. |
| 404 | model_not_found | No active model has that id. |
| 429 | rate_limit_exceeded | A per-minute request or token limit, or the limit on calls at once, of the organisation, user, key or model. |
Every code is on Errors and limits.