Expand description
OpenCode Go provider.
OpenCode Go exposes both OpenAI-compatible chat completions and
Anthropic-compatible messages. The app-facing model id keeps the
documented opencode-go/ prefix; the request body uses the raw
OpenCode Go model id.
Structs§
- Open
Code GoClient - Concrete OpenCode Go API client.
Enums§
- Endpoint
Family - Endpoint family used by a model.
Constants§
- ANTHROPIC_
VERSION - Required Anthropic version header value for
/messages. - API_
KEY_ ENV - Environment variable name for the OpenCode Go API key.
- BASE_
URL - OpenCode Go base URL.
- DEFAULT_
RECOMMENDED_ MAX_ TOKENS - MODEL_
PREFIX - User/config-facing model id prefix.
Functions§
- endpoint_
family - Resolve the endpoint family for a raw OpenCode Go model id.
- error_
message - Convert an OpenCode Go error into a human-readable failure string.
- is_
model_ id - Whether
modelis an OpenCode Go model id. - is_
retryable_ error - known_
models - Current OpenCode Go models from the public docs and live model list.
- model_
picker_ items - model_
status - probe_
api_ key - raw_
model_ id - Strip
opencode-go/from a model id. - recommended_
max_ tokens_ for_ model - validate_
api_ key - Try to validate an OpenCode Go API key with a lightweight model-list request.
Type Aliases§
- Model
Info - Model metadata currently returned by OpenCode Go.
- Models
Response - OpenAI-compatible model list response from
GET /models.