---
title: "Coding Agent Setup and API Integration - Mistbeam"
description: "Connect Claude Code, Codex, OpenCode, Pi, OpenClaw, Hermes Agent, Cline, and Kilo Code to Mistbeam's OpenAI-compatible API."
url: "https://mistbeam.com/docs/integration"
---

# Integration

Use Mistbeam with the tools you already use. Mistbeam exposes an OpenAI-compatible API, so you can point supported coding agents and applications at one endpoint and change providers without changing your workflow.

## Before you start

1. [Create an account](https://mistbeam.com/register).
2. Add credit from your [dashboard](https://mistbeam.com/dashboard).
3. Create an API key. Copy it when shown because it cannot be viewed again.

Keep your API key private. Do not commit it to a repository or expose it in browser-side code.

## Claude Code

Use [Claude Code Router](https://github.com/musistudio/claude-code-router) as a proxy to connect Claude Code to Mistbeam's OpenAI-compatible API.

## Codex

Add Mistbeam as a custom provider in your global `~/.codex/config.toml`:

```toml
model = "qwen-3.8-27b"
model_provider = "mistbeam"

[model_providers.mistbeam]
name = "Mistbeam"
base_url = "https://api.mistbeam.com/v1"
wire_api = "responses"
experimental_bearer_token = "mb_your_key_here"

```

Replace `mb_your_key_here` with your Mistbeam API key.

On Linux or macOS, restrict file access to your user account:

```bash
chmod 600 ~/.codex/config.toml

```

## OpenCode

Add Mistbeam as a custom provider in your global `~/.config/opencode/opencode.json`:

```json
{
  "$schema": "https://opencode.ai/config.json",
  "providers": {
    "mistbeam": {
      "name": "Mistbeam",
      "package": "@opencode/ai/providers/openai-compatible",
      "settings": {
        "baseURL": "https://api.mistbeam.com/v1"
      },
      "models": {
        "qwen-3.8-27b": {
          "name": "Qwen 3.8 27B"
        }
      }
    }
  }
}

```

Start OpenCode, run `/connect`, select `Mistbeam`, then choose `Manually enter API Key` and paste your Mistbeam API key.

Select a model with `/models`. See the [OpenCode provider docs](https://opencode.ai/v2/docs/providers#custom) and [global configuration docs](https://opencode.ai/v2/docs/config#locations).

## Pi

Add Mistbeam as a custom provider in your global `~/.pi/agent/models.json`:

```json
{
  "providers": {
    "mistbeam": {
      "baseUrl": "https://api.mistbeam.com/v1",
      "api": "openai-responses",
      "models": [
        { "id": "qwen-3.8-27b" }
      ]
    }
  }
}

```

Add your Mistbeam API key to `~/.pi/agent/auth.json`:

```json
{
  "mistbeam": {
    "type": "api_key",
    "key": "mb_your_key_here"
  }
}

```

Replace `mb_your_key_here` with your Mistbeam API key.

On Linux or macOS, restrict file access to your user account:

```bash
chmod 600 ~/.pi/agent/auth.json

```

Open `/model`, select Mistbeam's model, and press `Ctrl+S` to save it as the default for new sessions.

## OpenClaw

Add Mistbeam as a custom provider in your global `~/.openclaw/openclaw.json`:

```json5
{
  models: {
    providers: {
      mistbeam: {
        baseUrl: "https://api.mistbeam.com/v1",
        apiKey: "mb_your_key_here",
        api: "openai-responses",
        models: [
          { id: "qwen-3.8-27b", name: "Qwen 3.8 27B" }
        ]
      }
    }
  },
  agents: {
    defaults: {
      model: { primary: "mistbeam/qwen-3.8-27b" }
    }
  }
}

```

Replace `mb_your_key_here` with your Mistbeam API key.

On Linux or macOS, restrict file access to your user account:

```bash
chmod 700 ~/.openclaw
chmod 600 ~/.openclaw/openclaw.json

```

## Hermes Agent

Run the interactive model setup:

```bash
hermes model

```

Choose `Custom endpoint`, then enter:

```text
API base URL: https://api.mistbeam.com/v1
API key: mb_your_key_here
Model: qwen-3.8-27b

```

Replace `mb_your_key_here` with your Mistbeam API key.

On Linux or macOS, restrict file access to your user account:

```bash
chmod 700 ~/.hermes
chmod 600 ~/.hermes/.env

```

## Cline

Open Cline's settings using the gear icon and select `OpenAI Compatible` as the API provider. Enter:

```text
Base URL: https://api.mistbeam.com/v1
API key: mb_your_key_here
Model ID: qwen-3.8-27b

```

Replace `mb_your_key_here` with your Mistbeam API key.

See the [Cline OpenAI-compatible provider docs](https://docs.cline.bot/provider-config/openai-compatible).

## Kilo Code

Open Kilo Code's settings using the gear icon, go to the `Providers` tab, and click `Custom provider`. Enter:

```text
Provider ID: mistbeam
Display name: Mistbeam
Provider API: OpenAI Compatible
Base URL: https://api.mistbeam.com/v1
API key: mb_your_key_here

```

Replace `mb_your_key_here` with your Mistbeam API key. Add `qwen-3.8-27b` from the model list or enter it manually, then click `Submit`. Select the model in Kilo Code's model picker.

See the [Kilo Code OpenAI-compatible provider docs](https://kilo.ai/docs/ai-providers/openai-compatible).

## Support

[support@mistbeam.com](mailto:support@mistbeam.com)
