---
title: "OpenAI-compatible clients"
description: "Connect OpenAI-compatible clients and coding agents through the meinGPT API"
canonical_url: "https://meingpt.com/en/docs/integrations/openai-compatible-clients"
language: en
---

# OpenAI-compatible clients

meinGPT exposes an OpenAI-compatible API. You can run OpenAI-compatible clients and coding agents against your meinGPT models. This page shows the setup using [OpenCode](https://opencode.ai) and [Pi](https://pi.dev) as examples; other clients are configured the same way.

## Prerequisites

- A personal API key: in your meinGPT settings, open "meinGPT API" and create a key.
- The client of your choice, installed locally (e.g. OpenCode or Pi).
- The API base URL: `https://app.meingpt.com/api/openai/v1`

## Configure the client

In both cases you register meinGPT as a custom provider: base URL, API key, and the models you want to use – for a coding agent, one is usually enough. Valid model IDs are the models enabled for your organization; you can find them via the `/models` endpoint or the model overview in meinGPT.

### OpenCode

Create an `opencode.json` in your project:

```json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "meingpt": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "meinGPT",
      "options": {
        "baseURL": "https://app.meingpt.com/api/openai/v1",
        "apiKey": "YOUR_API_KEY"
      },
      "models": {
        "claude-sonnet-4-6": {
          "name": "Claude Sonnet 4.6",
          "limit": { "context": 200000, "output": 64000 }
        }
      }
    }
  }
}
```

Then start OpenCode with the model:

```bash
opencode -m meingpt/claude-sonnet-4-6
```

The `limit` field tells OpenCode the model's context window (`context`) and maximum output length (`output`), which lets it show context utilization. Without these values the utilization indicator stays at 0%. You can find the right values per model in the model overview in meinGPT.

Add more models under `models`.

### Pi

Pi registers providers via an extension. Create the file `~/.pi/extensions/meingpt.ts`:

```ts
export default function (pi) {
  pi.registerProvider("meingpt", {
    baseUrl: "https://app.meingpt.com/api/openai/v1",
    apiKey: "YOUR_API_KEY",
    api: "openai-completions",
    models: [
      {
        id: "claude-sonnet-4-6",
        name: "Claude Sonnet 4.6",
        input: ["text"],
        cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
        contextWindow: 200000,
        maxTokens: 64000,
      },
    ],
  });
}
```

Then start Pi with the provider and model:

```bash
pi --provider meingpt --model claude-sonnet-4-6
```

Add more models to the extension's `models` array.

Not every model supports the function calls (tool calls) a coding agent uses. Search models such as Perplexity Sonar reject those requests with an error – use a model like Claude, GPT, or Gemini instead. Reasoning-tier models use a fixed internal `temperature` and may reject other values; omit `temperature` in that case.

Coding agents commonly send images (e.g. screenshots) as `image_url` content blocks. The meinGPT chat completions endpoint does not accept these - message `content` must be plain text, so a request containing an image fails with `400`. This applies to any client using this integration, since coding agents talk to the endpoint documented in [Chat Completions](/en/docs/api/completions). There is no drop-in fix: sending files or images requires switching to the [Assistants Run](/en/docs/api/assistants) or [Workflow execution](/en/docs/api/workflows) API instead, which use a different (`multipart/form-data`) request format that most OpenAI-compatible coding-agent clients do not support natively.

## VS Code extensions: Continue.dev and Cline

VS Code extensions like **Continue.dev** and **Cline** can also be connected via the OpenAI-compatible API.

Coding agents like Cline and Continue.dev resend the full conversation history and all tool definitions with every turn, so they can consume a large token budget quickly. If you hit `429` errors, see [Rate Limits](/en/docs/api#rate-limits) - the limit is checked per user, per organization, and per model.

### Continue.dev

Create the file `.continue/config.yaml` in your project:

```yaml
models:
  - name: meinGPT
    provider: openai
    apiBase: https://app.meingpt.com/api/openai/v1
    apiKey: ${MEINGPT_API_KEY}
```

Cline can be configured similarly via its OpenAI-compatible provider settings, using the same base URL and API key.

Double-check the exact schema against Continue.dev's own current docs before publishing, since it can change independently of meinGPT.

## Optional: pull in every model (OpenCode)

OpenCode reads available models from the `/models` endpoint, but for custom providers it only shows models it recognizes itself. If you want every enabled model in the picker without adding them one by one, you can generate the `models` block from the API once (it needs `curl` and `python3`) and re-run it when needed. The `/models` endpoint does not return context windows, so for models generated this way the utilization indicator stays at 0% until you add `limit` by hand:

```bash
KEY="YOUR_API_KEY"
curl -s -H "Authorization: Bearer $KEY" \
  https://app.meingpt.com/api/openai/v1/models \
| KEY="$KEY" python3 -c '
