Docs pages

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:

json, 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:

bash
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.

bash
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:

Common errors
StatusCodeWhen
401invalid_api_keyThe key is malformed, unknown, revoked or expired.
402insufficient_balanceThe wallet balance is too low for this request.
402spend_cap_reachedSpend has reached a daily or monthly cap of the key or the organisation, or the agent run’s cap.
404model_not_foundNo active model has that id.
429rate_limit_exceededA 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.