> ## Documentation Index
> Fetch the complete documentation index at: https://docs.compose.market/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenCode

> Use Compose.Market as a remote OpenCode provider.

OpenCode can load organization config from:

```http theme={null}
GET https://api.compose.market/.well-known/opencode
```

The config defines one provider, `compose-market`, backed by `@ai-sdk/openai-compatible`. The remote config supplies the provider and model map. Credentials stay in OpenCode's local `/connect` flow.

## Provider config shape

The remote config uses this shape:

```json theme={null}
{
  "config": {
    "$schema": "https://opencode.ai/config.json",
    "provider": {
      "compose-market": {
        "name": "Compose.Market",
        "npm": "@ai-sdk/openai-compatible",
        "options": {
          "baseURL": "https://api.compose.market/external/v1",
          "includeUsage": true,
          "timeout": false,
          "chunkTimeout": 120000
        }
      }
    }
  }
}
```

The public endpoint does not include an `apiKey` field. Use OpenCode's `/connect` flow for the `compose-market` provider so OpenCode stores the credential locally, outside the remote config.

## Models

OpenCode model keys are public catalog IDs.

Examples:

```text theme={null}
gpt-5.5
openai/gpt-5.5
@cf/meta/llama-3.3-70b-instruct-fp8-fast
```

OpenCode accepts a smaller model metadata schema than `/external/v1/models`. The remote config only includes fields OpenCode can validate; the full external catalog remains available at `/external/v1/models`.

## Debug

If OpenCode starts but a model call fails, check the response headers:

```text theme={null}
x-public-model
x-upstream-provider
x-upstream-model
```

They show which catalog row the request reached.

## Related

* [External clients](/inference/external-use/overview)
* [Compose Keys](/x402/compose-key)
* [OpenCode providers](https://opencode.ai/docs/providers/)
