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

# Integrations

> Use Opper as an inference provider to AI agents, editors and CLIs

## Agents

Use Opper as an inference provider for your agent framework, editor, or SDK of choice. All integrations give you access to the full [Opper model catalog](https://docs.opper.ai/capabilities/models), including EU-hosted options.

<Tip>
  One-command setup through the [Opper CLI](/developer-tools/cli):

  ```bash theme={null}
  npx @opperai/cli launch [AGENT]
  ```
</Tip>

<CardGroup cols={2}>
  <Card title="OpenCode" href="#opencode">
    Terminal-based AI coding assistant
  </Card>

  <Card title="Vercel AI SDK" href="#vercel-ai-sdk">
    Use any Opper model with the Vercel AI SDK
  </Card>

  <Card title="OpenClaw" href="#openclaw">
    Personal AI assistant built on pi
  </Card>

  <Card title="pi" href="#pi">
    Terminal coding agent with native Opper provider support
  </Card>

  <Card title="Hermes" href="#hermes">
    Open-source terminal agent via custom OpenAI-compatible endpoint
  </Card>

  <Card title="Claude Code" href="#claude-code">
    Anthropic's CLI, routed through Opper's Anthropic-compatible gateway
  </Card>

  <Card title="Claude Desktop" href="#claude-desktop">
    Anthropic's desktop app (chat + Code), routed through Opper's gateway
  </Card>

  <Card title="Cursor" href="#cursor">
    AI-powered code editor with rules support
  </Card>

  <Card title="Cline" href="#cline">
    VS Code extension with OpenAI-compatible providers
  </Card>

  <Card title="Continue.dev" href="#continue-dev">
    Open-source AI assistant for VS Code and JetBrains
  </Card>

  <Card title="GitHub Copilot" href="#github-copilot">
    Route Copilot Chat and Agent mode in VS Code through Opper
  </Card>
</CardGroup>

### OpenCode

[OpenCode](https://opencode.ai) is a terminal-based AI coding assistant.

**Quick start (no install):**

```bash theme={null}
npx @opperai/cli launch opencode
```

The CLI writes the Opper provider block into `~/.config/opencode/opencode.json` and starts OpenCode. To wire it manually instead:

```bash theme={null}
mkdir -p ~/.config/opencode
curl -o ~/.config/opencode/opencode.json https://raw.githubusercontent.com/opper-ai/setup/main/data/opencode.json
export OPPER_API_KEY=your-api-key
```

### Vercel AI SDK

The [Vercel AI SDK](https://sdk.vercel.ai/) is a TypeScript toolkit for building AI-powered applications. Install the Opper provider package and pass any Opper model string to `generateText`, `streamText`, `embed`, or tool calls:

```bash theme={null}
npm install @opperai/ai-sdk-provider ai
```

```ts theme={null}
import { opper } from '@opperai/ai-sdk-provider';
import { generateText } from 'ai';

const { text } = await generateText({
  model: opper('openai/gpt-5.5'),
  prompt: 'Hello!',
});
```

Pass any Opper model string: `opper('anthropic/claude-sonnet-4-6')`, `opper('gemini/gemini-2.5-flash')`, `opper('default')`, etc.

**Session tracing:**

Wrap your model with `opperSpan` to group every call in a conversation under one trace in Opper:

```ts theme={null}
import { wrapLanguageModel, generateText } from 'ai';
import { opper, opperSpan } from '@opperai/ai-sdk-provider';

const { middleware, handle } = opperSpan({ name: 'my-chat-session' });

const model = wrapLanguageModel({
  model: opper('openai/gpt-5.5'),
  middleware,
});

const { text } = await generateText({ model, prompt: 'Hello!' });
await handle.end(text); // closes the span
```

### OpenClaw

[OpenClaw](https://openclaw.ai) is a personal AI assistant built on pi that runs on WhatsApp, Telegram, Discord, and other chat apps. Add Opper as a custom provider in `~/.openclaw/config.json`:

```json theme={null}
{
  "env": { "OPPER_API_KEY": "your-api-key" },
  "agents": {
    "defaults": {
      "model": { "primary": "opper/anthropic/claude-opus-4-7" }
    }
  },
  "models": {
    "providers": {
      "opper": {
        "baseUrl": "https://api.opper.ai/v3/compat",
        "apiKey": "${OPPER_API_KEY}",
        "api": "openai-completions",
        "models": [
          { "id": "anthropic/claude-opus-4-7", "name": "Claude Opus 4.7 (Opper)" },
          { "id": "anthropic/claude-sonnet-4-6", "name": "Claude Sonnet 4.6 (Opper)" },
          { "id": "mistral/mistral-large", "name": "Mistral Large EU (Opper)" },
          { "id": "gemini/gemini-2.5-flash", "name": "Gemini 2.5 Flash EU (Opper)" }
        ]
      }
    }
  }
}
```

3. Switch models at any time:

```bash theme={null}
openclaw models set opper/anthropic/claude-sonnet-4-6
```

<Note>
  This method gives you full model access with a single API key, but no session span tracing. For that, use the native pi extension.
</Note>

***

### pi

[pi](https://github.com/badlogic/pi-mono) is a terminal-based coding agent.

**Quick start (no install):**

```bash theme={null}
npx @opperai/cli launch pi
```

The CLI adds an `opper` provider entry to `~/.pi/agent/models.json` (idempotently, alongside any existing providers) and starts pi.

For deeper integration (300+ Opper models, automatic session span tracing, and 7 multimodal tools), install the `@opperai/pi-provider` package:

```bash theme={null}
pi install npm:@opperai/pi-provider
export OPPER_API_KEY=your-api-key
```

Then use `/model` inside pi to switch to any Opper model. The package also registers 7 multimodal tools directly in pi: image generation, image analysis, text-to-speech, speech-to-text, web search, web fetch, and embeddings.

**Load only the provider or only the tools:**

```json theme={null}
{
  "packages": [
    {
      "source": "npm:@opperai/pi-provider",
      "extensions": ["extensions/provider.ts", "extensions/tools.ts"]
    }
  ]
}
```

**Optional environment variables:**

| Variable             | Description                                                      |
| -------------------- | ---------------------------------------------------------------- |
| `OPPER_AGENT_NAME`   | Override the framework name sent in headers (default: `pi-code`) |
| `PI_IMAGE_SAVE_MODE` | Default image save mode: `tmp`, `project`, `global`, or `custom` |

### Hermes

[Hermes](https://hermes-agent.nousresearch.com) is an open-source terminal agent by Nous Research.

**Quick start (no install):**

```bash theme={null}
npx @opperai/cli launch hermes
```

The CLI uses an isolated `HERMES_HOME=~/.opper/hermes-home/` so your real `~/.hermes/` is untouched.

**Manual setup:**

To wire Opper into your existing Hermes setup, add your API key and register Opper as a named custom provider, then point the `model` block at it to make it the default:

```bash theme={null}
# Add your Opper API key
echo 'OPPER_API_KEY=your-api-key' >> ~/.hermes/.env
```

```yaml theme={null}
# ~/.hermes/config.yaml
model:
  provider: opper
  default: anthropic/claude-opus-4-7

custom_providers:
  - name: opper
    base_url: https://api.opper.ai/v3/compat
    key_env: OPPER_API_KEY
```

Switch models mid-session:

```
/model custom:opper:anthropic/claude-opus-4-7
/model custom:opper:gemini/gemini-2.5-flash
```

<Note>
  Hermes discovers the available models from Opper automatically — the model picker lists the full Opper catalog without any per-model configuration.
</Note>

### Claude Code

[Claude Code](https://claude.com/claude-code) is Anthropic's CLI.

**Quick start (no install):**

```bash theme={null}
npx @opperai/cli launch claude
```

The CLI sets `ANTHROPIC_BASE_URL` / `ANTHROPIC_AUTH_TOKEN` and starts Claude Code with traffic routed to Opper's Anthropic-compatible endpoint. To wire it manually, export the variables in your shell, or add the same keys to `.claude/settings.local.json` under `env`:

```bash theme={null}
export ANTHROPIC_BASE_URL=https://api.opper.ai/v3/compat
export ANTHROPIC_AUTH_TOKEN=your-api-key
export ANTHROPIC_DEFAULT_SONNET_MODEL=anthropic/claude-sonnet-4-6
export ANTHROPIC_DEFAULT_HAIKU_MODEL=anthropic/claude-haiku-4-5
export ANTHROPIC_DEFAULT_OPUS_MODEL=anthropic/claude-opus-4-7
```

### Claude Desktop

[Claude Desktop](https://claude.ai/download) is Anthropic's macOS / Windows desktop app. Both the chat and Claude Code surfaces inside the app run through whichever inference profile is active.

**Quick start (no install):**

```bash theme={null}
npx @opperai/cli launch claude-desktop
```

The CLI uses Claude Desktop's documented third-party-inference mode (`deploymentMode: "3p"`). It writes an Opper profile to `~/Library/Application Support/Claude-3p/configLibrary/` on macOS (or `%LOCALAPPDATA%\Claude-3p\configLibrary\` on Windows), pointing at Opper's Anthropic-compatible endpoint. If Claude Desktop is already running, it is quit and reopened so the change takes effect immediately. The picker shows Opus, Sonnet, and Haiku with Opus 4.7 as the default; pass `--model <id>` to pin a different default.

To revert Claude Desktop to standard Anthropic inference:

```bash theme={null}
npx @opperai/cli agents uninstall claude-desktop
```

This flips `deploymentMode` back to `"1p"` and removes the Opper profile entry. Other tools' third-party profiles and your own preferences are left untouched.

<Note>
  On first launch, macOS will prompt "opper would like to control Claude". Accept this so the CLI can quit and reopen the app cleanly. Available on macOS and Windows. Anthropic does not ship a Linux build of Claude Desktop.
</Note>

***

### Cursor

[Cursor](https://cursor.com) is an AI-powered code editor. Download the Opper rules file for your language and drop it in your project to give Cursor context about the Opper SDKs.

1. Download the `.mdc` file for your language:
   * **Python**: <a href="https://raw.githubusercontent.com/opper-ai/opper-python/refs/heads/main/opper-python.mdc" download="opper-python.mdc">Download</a>
   * **TypeScript**: <a href="https://raw.githubusercontent.com/opper-ai/opper-node/refs/heads/main/opper-node.mdc" download="opper-node.mdc">Download</a>
2. Place it in your project at `.cursor/rules/opper.mdc`.
3. In Cursor, make sure the rule is set to **Always**.

### Cline

[Cline](https://cline.bot) is an AI coding agent for VS Code. Add Opper as a provider in the Cline settings panel:

1. Select **OpenAI Compatible** as the API Provider.
2. Set the Base URL to `https://api.opper.ai/v3/compat`.
3. Enter your Opper API key.
4. Set the Model ID to any model available on Opper (e.g. `gemini/gemini-2.5-flash`).

### Continue.dev

[Continue.dev](https://continue.dev) is an open-source AI code assistant for VS Code and JetBrains. Add Opper manually to `~/.continue/config.yaml`:

```yaml theme={null}
models:
  - name: Gemini 2.5 Flash (EU)
    provider: openai
    model: gemini/gemini-2.5-flash
    apiKey: your-api-key
    apiBase: https://api.opper.ai/v3/compat
    roles:
      - chat
      - edit
```

### GitHub Copilot

[GitHub Copilot](https://github.com/features/copilot) Chat and Agent mode in VS Code can be routed through Opper via the [OAI Compatible Provider](https://marketplace.visualstudio.com/items?itemName=johnny-zhao.oai-compatible-copilot) extension. Inline completions stay on GitHub's own service.

**Quick start (no install):**

```bash theme={null}
npx @opperai/cli editors github-copilot-vscode
```

The CLI prompts before installing the community extension, then writes the Opper provider block into your VS Code user `settings.json`. Reload the window, then in Copilot Chat: model picker → **Manage Models** → **OAI Compatible** → paste your `OPPER_API_KEY` when prompted.

To wire it manually instead:

1. Install the extension: `code --install-extension johnny-zhao.oai-compatible-copilot`

2. Add Opper to your VS Code user `settings.json`:

   ```json theme={null}
   "oaicopilot.baseUrl": "https://api.opper.ai/v3/compat",
   "oaicopilot.models": [
     {
       "id": "anthropic/claude-opus-4-7",
       "owned_by": "opper",
       "apiMode": "openai",
       "context_length": 1000000
     }
   ]
   ```

3. Open Copilot Chat → model picker → **Manage Models** → **OAI Compatible** → paste your Opper API key when prompted.

<Note>
  Copilot Business / Enterprise users may need their org admin to enable the "Bring Your Own Language Model Key in VS Code" policy.
</Note>

***

## Developer Tools

For terminal use of Opper itself, see the [CLI](/developer-tools/cli). For dropping Opper context into AI code editors (Claude Code, Cursor, Cline, GitHub Copilot, OpenAI Codex, Windsurf), see [Skills](/developer-tools/skills).

## Start building

You've seen the platform. Now write code against it.

<CardGroup cols={2}>
  <Card title="Pick the right API" icon="signs-post" href="/build/overview">
    Chat, JSON, or Realtime. Choose one and build.
  </Card>

  <Card title="Drop-in SDKs" icon="plug" href="/build/gateway/drop-in-sdks">
    Use the OpenAI, Anthropic, or Google AI SDK you already have.
  </Card>
</CardGroup>
