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

# Get Started with OpenCode

> Configure OpenCode to use Cerebras Inference for AI coding assistance. 

[OpenCode](https://opencode.ai/?utm_source=cerebras\&utm_campaign=opencode) is a 100% open-source, terminal-focused AI coding assistant that runs multiple models and integrates deeply with developer tools for seamless coding automation.

## Prerequisites

Before you begin, ensure you have a **Cerebras API Key**. Get an API key [here](https://cloud.cerebras.ai/?utm_source=3pi_opencode\&utm_campaign=integrations).

<Note>
  Paid tier required. This integration is only available on paid Cerebras plans. Visit the [Cloud Console](https://cloud.cerebras.ai) to upgrade your plan.
</Note>

## Configure OpenCode

<Steps>
  <Step title="Install OpenCode in your terminal">
    Run the following:

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

    <Tip>
      After installation, reload your shell configuration so the `opencode` command is available in your current session:

      ```bash theme={null}
      source ~/.zshrc
      ```

      If you use bash, run `source ~/.bashrc` instead.
    </Tip>
  </Step>

  <Step title="Select Cerebras">
    Run the following command, then select Cerebras from the dropdown menu:

    ```bash theme={null}
    opencode auth login
    ```

    <img src="https://mintcdn.com/cerebras-inference/wkAqgJUX5tGPmMIW/images/opencode/step1.png?fit=max&auto=format&n=wkAqgJUX5tGPmMIW&q=85&s=850ed9592e27de8a7733450e01875c14" alt="step1" width="1096" height="526" data-path="images/opencode/step1.png" />
  </Step>

  <Step title="Configure API key">
    Enter your Cerebras API key:

    <img src="https://mintcdn.com/cerebras-inference/wkAqgJUX5tGPmMIW/images/opencode/step2.png?fit=max&auto=format&n=wkAqgJUX5tGPmMIW&q=85&s=f357c82af98af077d60d4fe51af23afe" alt="step2" width="1010" height="304" data-path="images/opencode/step2.png" />
  </Step>

  <Step title="Select a model and start coding!">
    Launch OpenCode in your project directory:

    ```bash theme={null}
    opencode
    ```

    Once inside the OpenCode interface, type `/models` and press Enter to open the model selector. Choose a Cerebras model from the list.

    <img src="https://mintcdn.com/cerebras-inference/vsmZPwLQ5jrLsxoS/images/opencode/step3.png?fit=max&auto=format&n=vsmZPwLQ5jrLsxoS&q=85&s=1d592575da8e7641b22af623d992a222" alt="step3" width="469" height="248" data-path="images/opencode/step3.png" />

    Now you can start coding!

    <img src="https://mintcdn.com/cerebras-inference/wkAqgJUX5tGPmMIW/images/opencode/step4.png?fit=max&auto=format&n=wkAqgJUX5tGPmMIW&q=85&s=db86981511c5ff871308ea022dcf5a41" alt="step4" width="1582" height="970" data-path="images/opencode/step4.png" />
  </Step>
</Steps>

## Available Models

OpenCode supports all Cerebras models for AI coding assistance:

| Model            | Parameters | Best For                                                         |
| ---------------- | ---------- | ---------------------------------------------------------------- |
| **llama3.1-8b**  | 8B         | Fastest option for simple tasks and high-throughput scenarios    |
| **gpt-oss-120b** | 120B       | Largest model for the most demanding tasks                       |
| **zai-glm-4.7**  | 357B       | Advanced 357B parameter model with strong reasoning capabilities |

You can switch between models at any time by typing `/models` inside the OpenCode interface.
