Automatically populate models from Tailscale Aperture.
Configure the Aperture base URL using one of these methods (in order of precedence):
{
"plugins": [
["opencode-plugin-tsaperture"]
]
}export APERTURE_BASE_URL="http://ai.my-tailnet.ts.net"Create aperture.json in the opencode config directory:
macOS:
~/Library/Application\ Support/opencode/aperture.jsonLinux:
~/.config/opencode/aperture.jsonWindows:
%APPDATA%\opencode\aperture.json
Contents:
{
"baseUrl": "http://ai.my-tailnet.ts.net",
"apiKey": ""
}apiKey is optional. Set it when your Aperture endpoint requires bearer auth. If omitted, the plugin passes an empty key to the generated providers.
The plugin reads Aperture provider compatibility metadata and registers each provider with the matching OpenCode provider package and endpoint. It supports OpenAI Responses and Chat Completions, Anthropic Messages, Google Vertex, Amazon Bedrock, and Gemini Generate Content routes.
The plugin enriches Aperture's /v1/models response with the same Models.dev catalog OpenCode uses. When a discovered model matches a catalog provider/model ID, the generated OpenCode config includes the catalog's family, release date, cost, modalities, reasoning/tool/temperature support, interleaved reasoning field, variants, and accurate limit.context, limit.input, and limit.output values.
Important: For full provider-specific feature support, the Aperture provider id and model id should match the Models.dev respective IDs. Provider IDs with an -x- suffix use the base ID for Models.dev lookup, so opencode-go-x-anthropic and opencode-go-x-responses both use the opencode-go catalog entry while retaining their separate API compatibility and SDK configuration.
Optional aperture.json fields:
{
"modelsDevUrl": "https://models.dev",
"modelsDevPath": "/path/to/models-dev-api.json",
"disableModelsDev": false
}The plugin also honors OpenCode's OPENCODE_MODELS_URL, OPENCODE_MODELS_PATH, and OPENCODE_DISABLE_MODELS_FETCH environment variables.
Once configured, models will be available via the plugin tools:
/list_aperture_models- List available models from Aperture/get_aperture_model modelId=<id>- Get model details