OpenCode

OpenCode integrates with Stravia through the open-responses protocol. Desktop can write configuration to your OpenCode directory; configure Stravia as a provider with your API Key and models.

Prerequisites

Connect an upstream Model Service, create an enabled Stravia Model ID with an enabled destination, and create an enabled API Key authorized for that model.

Configuration

Protocol: open-responses
Configuration location: ~/.config/opencode/opencode.json (Desktop Apply) or manual
Required settings:

  • provider.stravia.npm: Must be @ai-sdk/open-responses
  • provider.stravia.options.url: Server address (e.g., http://127.0.0.1:23471/v1/responses)
  • provider.stravia.options.apiKey: Your Stravia API Key
  • provider.stravia.models: Object mapping model IDs to model metadata, generated from selected models in Connect

Apply configuration (Desktop only)

From Connect clients, select OpenCode, choose your API Key and models, then click Apply to Client. Desktop writes the Stravia provider configuration to your OpenCode config file, merging with existing providers.

Manual configuration

Edit ~/.config/opencode/opencode.json and add the Stravia provider. Copy the exact configuration from the Preview section in Stravia Connect, which includes the provider settings and all model metadata required by OpenCode.

Verify the connection

After configuration, use OpenCode to make a request. Check Request history in Stravia to confirm the request arrived and the model responded.

Troubleshoot a failed request

Confirm the provider URL ends at Stravia's /v1/responses endpoint, the API Key is authorized for the selected Model ID, and provider.stravia.models is an object keyed by those model IDs. If Request history shows no interaction, check the URL and client network path; if the request appears, inspect the recorded error. Applying or copying the provider object alone does not prove a successful connection.

Next steps

For other clients see Other clients . For general client configuration see Connect clients .