Skip to main content

Module opencode_zen

Module opencode_zen 

Source
Expand description

OpenCode Zen provider.

OpenCode Zen exposes an OpenAI-compatible chat-completions route. The app-facing model id keeps the documented opencode/ prefix; requests use the raw Zen model id.

Structs§

OpenCodeZenClient
Concrete OpenCode Zen API client.

Enums§

EndpointFamily
Endpoint family selected by the OpenCode Zen model id.

Constants§

API_KEY_ENV
Environment variable name for the OpenCode Zen API key.
BASE_URL
OpenCode Zen base URL.
CHAT_COMPLETIONS_URL
OpenCode Zen chat-completions endpoint.
DEFAULT_RECOMMENDED_MAX_TOKENS
MODELS_URL
OpenCode Zen model-discovery endpoint.
MODEL_PREFIX
User/config-facing model id prefix.

Functions§

endpoint_family
Select the documented OpenCode Zen endpoint for a raw model id.
error_message
Convert an OpenCode Zen error into a human-readable failure string.
is_model_id
Whether model is an OpenCode Zen model id.
is_retryable_error
known_models
Current OpenCode Zen models from public docs.
model_picker_items
model_status
probe_api_key
raw_model_id
Strip opencode/ from a model id.
reasoning_options
Return the verified reasoning choices for one Zen model.
validate_api_key
Try to validate an OpenCode Zen API key with a lightweight model-list request.

Type Aliases§

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