# OpenCode

URL: https://docs.usestitch.ai/docs/resources/harnesses/opencode



## Version [#version]

Set `version` explicitly to pin a release, for example `2.0.26`.
The release must be available upstream and support the adapter's OpenCode V2 commands.

OpenCode runs use standalone mode and a private database for each run.

## Model and Reasoning Effort [#model-and-reasoning-effort]

Set both `model` and `reasoningEffort` to non-empty strings. Use OpenCode's
`provider/model` identifier. Stitch does not check a model catalog, supported
variants, or infer required credentials from the model. OpenCode reports invalid
provider, model, or variant settings so you can correct the configuration.

OpenCode receives `--model provider/model#effort`. Use `reasoningEffort: default`
to pass only `provider/model`.

## Authentication [#authentication]

Use exactly one auth method that matches your model's provider. Store the credential as a
[Stitch secret](/docs/resources/secrets) and reference it with `secretName`.

| Model prefix | Auth method         | Get credentials                                         |
| ------------ | ------------------- | ------------------------------------------------------- |
| `openai/`    | `openai_api_key`    | [OpenAI Platform](https://platform.openai.com/api-keys) |
| `anthropic/` | `anthropic_api_key` | [Anthropic Console](https://console.anthropic.com/)     |
| `google/`    | `gemini_api_key`    | [Google AI Studio](https://aistudio.google.com/apikey)  |
| `meta/`      | `meta_api_key`      | [Meta Llama API](https://llama.developer.meta.com/)     |
| `opencode/`  | `opencode_api_key`  | [OpenCode Zen](https://opencode.ai/auth)                |
