Skip to main content

Module go

Module go 

Source
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§

OpenCodeGoClient
Concrete OpenCode Go API client.

Enums§

EndpointFamily
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 model is 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§

ModelInfo
Model metadata currently returned by OpenCode Go.
ModelsResponse
OpenAI-compatible model list response from GET /models.