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

# How to use OpenCode with SiliconFlow APIs

OpenCode is one of the most powerful open-source AI coding agents available today. This guide walks you through integrating SiliconFlow APIs with OpenCode to leverage high-performance models in your development workflow.

## Step 1: Install OpenCode

Install OpenCode by running the following command in your terminal:

```text theme={null}
curl -fsSL https://opencode.ai/install | bash
```

**\*Note:** This guide demonstrates CLI-based setup for quick integration. OpenCode also offers multiple installation options including desktop app, IDE extensions and platform integrations to fit different workflows：

* **Terminal CLI**: Install via curl, npm, Homebrew, or system package managers
* **Desktop app** (Beta): Available for macOS, Windows, and Linux
* **IDE extensions**: Integrates with VS Code, Cursor, Zed, Windsurf, and VSCodium
* **Platform integrations**: Connect with GitHub and GitLab

Visit [OpenCode's official download page](https://opencode.ai/download) for more details.

## Step 2: Launch OpenCode

Run`opencode`in your terminal to launch OpenCode:

```text theme={null}
opencode
```

## Step 3: Configure SiliconFlow

* **Connect to SiliconFlow**: Enter `/connect` in the OpenCode to open the API provider selection page
* **Select SiliconFlow**: Choose `SiliconFlow` from the available providers
* **Add API Key**: [Get your SiliconFlow API key](https://cloud.siliconflow.cn/account/ak) and paste it when prompted
* **Select Models**: Run `/models` to access powerful models including:
  * `deepseek-ai/DeepSeek-V3.2`
  * `moonshotai/Kimi-K2-Thinking`
  * `MiniMaxAI/MiniMax-M2.1`
  * `zai-org/GLM-4.7`
  * And more

**You're all set!** Start coding with AI-powered assistance by asking OpenCode to help with your development tasks with SoTA models.

## OpenCode Command Shortcut

Below is a quick reference of commonly used OpenCode commands and agents to help you navigate:

| **Command** |       **Action**      |                                                                                                   **Description**                                                                                                  |
| :---------: | :-------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|   /models   |     Switch Models     |                                                                 Access the list of available models and switch between them to suit specific tasks.                                                                |
|     /new    |      New Session      |                                                               Clear the current context and return to the main interface to start a new task session。                                                              |
|   /compact  |    Compress Context   |                                                                  Compress conversation history to reduce token usage while preserving key context.                                                                 |
|    /init    |   Built-in commands   |                                                         Create or update [AGENTS.md](http://AGENTS.md) file. [Learn more](https://opencode.ai/docs/rules).                                                         |
|    /undo    | Undo Previous Message |                                                         Undo the last message in the conversation. <br />Tip: Any file changes made will also be reverted.                                                         |
|    /share   |  Create public links  | Allows you to create public links to your OpenCode conversations, so you can collaborate with teammates or get help from others. <br />NOTE: Shared conversations are publicly accessible to anyone with the link. |
|    /exit    |      exit the app     |                                                                            Safely close the agent and return to your standard terminal.                                                                            |

For more details, please refer to the [official OpenCode documentation](https://opencode.ai/docs).
