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

# OpenCode Integration

> Configure OpenCode to use Nordlys's Mixture of Models model for lab-grade coding quality and lower cost

Configure OpenCode to use Nordlys's Mixture of Models model for high-quality coding results.

<Tip>
  **Get the best AI specialist for every prompt** with a Mixture of Models model. Works
  as a custom integration in OpenCode.
</Tip>

## Get Your Nordlys API Key

[Sign up here](https://nordlyslabs.com/api-platform/orgs) to create an account and generate your API key.

## Quick Setup

<Steps>
  <Step title="Download Installer" icon="download">
    <CodeGroup>
      ```bash macOS/Linux theme={null}
      curl -o opencode.sh https://raw.githubusercontent.com/Nordlys-Labs/nordlys/main/scripts/installers/unix/opencode.sh
      chmod +x opencode.sh
      ```

      ```powershell Windows (PowerShell) theme={null}
      Invoke-WebRequest -Uri https://raw.githubusercontent.com/Nordlys-Labs/nordlys/main/scripts/installers/windows/opencode.ps1 -OutFile opencode.ps1
      ```
    </CodeGroup>
  </Step>

  <Step title="Run Installer" icon="play">
    <CodeGroup>
      ```bash macOS/Linux theme={null}
      ./opencode.sh
      ```

      ```powershell Windows (PowerShell) theme={null}
      .\opencode.ps1
      ```
    </CodeGroup>

    The installer will prompt for your API key and configure OpenCode with Nordlys.

    Config is saved to `~/.config/opencode/opencode.json`.
  </Step>

  <Step title="Select Model" icon="robot">
    Start OpenCode and run `/models`, then select **"Hypernova Nordlys"**.

    <img src="https://mintcdn.com/adaptive-c37cc850/cgaFe0RoZA5zgXtv/images/guides/dev-tools/opencode/opencode-step-3.png?fit=max&auto=format&n=cgaFe0RoZA5zgXtv&q=85&s=4801f8e53530df840e63c5c84f6e63af" alt="Select Hypernova Nordlys model in OpenCode" width="4400" height="2950" data-path="images/guides/dev-tools/opencode/opencode-step-3.png" />
  </Step>

  <Step title="Start Coding" icon="check-circle">
    Hypernova is now active. Start chatting to verify the setup.

    <img src="https://mintcdn.com/adaptive-c37cc850/cgaFe0RoZA5zgXtv/images/guides/dev-tools/opencode/opencode-step-4.png?fit=max&auto=format&n=cgaFe0RoZA5zgXtv&q=85&s=1699203a37df8400421afccd46870c4d" alt="OpenCode working with Hypernova" width="4400" height="2950" data-path="images/guides/dev-tools/opencode/opencode-step-4.png" />
  </Step>
</Steps>

## Alternative Setup Methods

<CodeGroup>
  ```bash Environment Variables theme={null}
  export NORDLYS_API_KEY='your-api-key-here'
  ./opencode.sh
  ```

  ```powershell Environment Variables (PowerShell) theme={null}
  $env:NORDLYS_API_KEY="your-api-key-here"
  .\opencode.ps1
  ```

  ```json Manual Configuration theme={null}
  // Create ~/.config/opencode/opencode.json
  {
    "$schema": "https://opencode.ai/config.json",
    "provider": {
      "nordlys": {
        "npm": "@ai-sdk/openai-compatible",
        "name": "Nordlys",
        "options": {
          "baseURL": "https://api.nordlyslabs.com/v1",
          "apiKey": "your-nordlys-api-key"
        },
        "models": {
          "nordlys/hypernova": {
            "name": "Hypernova"
          }
        }
      }
    },
    "model": "nordlys/hypernova"
  }
  ```
</CodeGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Integration Not Appearing" icon="eye-slash">
    * Check `opencode.json` syntax is valid JSON
    * Ensure integration ID "nordlys" matches between auth and config
    * Run `opencode auth list` to confirm credentials were added
  </Accordion>

  <Accordion title="Authentication Errors" icon="key">
    * Regenerate API key from [Nordlys dashboard](https://nordlyslabs.com/api-platform/orgs)
    * Verify integration ID matches exactly between auth and config
    * Try re-running `opencode auth login` and selecting "Other"
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Monitor Usage & Savings" href="https://nordlyslabs.com/api-platform/orgs" icon="chart-line" cta="View Dashboard">
    Track your usage analytics in real-time
  </Card>

  <Card title="API Documentation" href="/api-reference/chat-completions" icon="book" cta="View API Docs">
    Learn about Nordlys's API capabilities and advanced features
  </Card>

  <Card title="Other IDE Integrations" href="/developer-tools/claude-code" icon="code" cta="Explore Tools">
    Set up Nordlys with Claude Code, Cline, and other AI development tools
  </Card>

  <Card title="Get Support" href="/troubleshooting" icon="life-ring" cta="Get Help">
    Troubleshooting guides and support resources
  </Card>
</CardGroup>

***

<Note>
  **Was this page helpful?** Contact us at
  [info@llmadaptive.uk](mailto:info@llmadaptive.uk) for feedback or assistance
  with your OpenCode integration.
</Note>
