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

# OpenCode

> Connect AnyAPI as a built-in provider in OpenCode via /connect

# AnyAPI Plugin for OpenCode

[OpenCode](https://github.com/opencode-ai/opencode) is an open-source AI coding CLI. AnyAPI is listed as a selectable provider inside OpenCode's `/connect` flow — no base URL or model ID to type in by hand.

## Get Your API Key

Go to [API Keys](https://dash.anyapi.ai/?page=api-keys) in the AnyAPI Dashboard and create a new key.

## Installation

Inside OpenCode, run:

```
/connect
```

**1. Select AnyAPI**

Choose **AnyAPI** from the provider list.

**2. Paste your API key**

Enter your AnyAPI key when prompted.

Models are populated for you automatically.

> [!NOTE]
>
> Don't see **AnyAPI** in `/connect`? Your OpenCode version may predate the built-in provider. Use the manual [OpenAI Compatible setup](https://docs.anyapi.ai/use-cases/opencode) instead.

## Recommended Models

| Model | Best for |
| - | - |
| `anthropic/claude-sonnet-4.6` | Fast coding tasks |
| `anthropic/claude-opus-4.6` | Complex reasoning |
| `openai/gpt-4o` | General purpose |
| `deepseek/deepseek-r1` | Algorithms, math |

Browse all models at [anyapi.ai/ai-models](https://anyapi.ai/ai-models).

## Troubleshooting

> **AnyAPI not in the provider list**
>
> Update OpenCode to the latest version, or fall back to the manual [OpenAI Compatible setup](https://docs.anyapi.ai/use-cases/opencode).

> **Authentication failed**
>
> Re-run `/connect`, select AnyAPI, and re-enter your key. Confirm it's active at [dash.anyapi.ai](https://dash.anyapi.ai).

> **Model not found**
>
> Use the full `vendor/model` form (e.g. `anthropic/claude-sonnet-4.6`), not a bare model name.

## Next Steps

> **[Manual OpenCode Setup](https://docs.anyapi.ai/use-cases/opencode)**
>
> Configure AnyAPI as a custom OpenAI-compatible provider

> **[All Integrations](https://docs.anyapi.ai/integrations/overview.md)**
>
> Browse all supported tools

## Support

* **AnyAPI Dashboard**: [dash.anyapi.ai](https://dash.anyapi.ai)
* **AnyAPI Discord**: [Discord community](https://discord.gg/rJgyzGynHw)
* **AnyAPI Email**: [support@anyapi.ai](mailto:support@anyapi.ai)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.