Skip to main content
The examples on this page use Chat Completions. If the current OpenCode version exposes a dedicated Responses provider, select that mode instead.

Prepare

Environment variables

Provider mapping

Configuration file template

If your OpenCode version supports provider config files, keep the key in the environment and store only provider metadata in the config:
OpenCode config field names can differ by release. If your version uses baseUrl, base_url, or api_key, keep the values the same and adapt the field names to the current schema.

Verify

  1. Test a plain cURL chat request.
  2. Create an OpenAI-compatible provider in OpenCode.
  3. Run a read-only task in a temporary project.
  4. Enable tool calls and file edits only after plain chat works.
A successful standalone API call does not prove that a full agent request with tools and a large prompt will succeed. Test the complete workflow.
Last modified on August 12, 2026