# Integrations (/docs/integrations)

Step-by-step setup for Cursor, Claude Code, GitHub Copilot, Cline, Continue, Zed, the Vercel AI SDK and Codex CLI against the codai gateway.

Every tool below needs three things: a base URL, a `codai_…` key and the model name `codai`. Pick your tool, paste the snippet, restart it.

<Cards>
  <Card title="Cursor" href="./cursor.mdx" description="Chat and Agent through the OpenAI key slot, plus MCP." />
  <Card title="Claude Code" href="./claude-code.mdx" description="Anthropic Messages at the root URL, every model alias pinned." />
  <Card title="GitHub Copilot" href="./github-copilot.mdx" description="VS Code Custom Endpoint and Copilot CLI BYOK." />
  <Card title="Cline" href="./cline.mdx" description="OpenAI Compatible provider in Plan and Act." />
  <Card title="Continue" href="./continue.mdx" description="config.yaml with chat, edit and apply roles." />
  <Card title="Zed" href="./zed.mdx" description="Named OpenAI-compatible provider and a remote context server." />
  <Card title="Vercel AI SDK" href="./vercel-ai-sdk.mdx" description="AI SDK 7 through the OpenAI-compatible provider." />
  <Card title="Codex CLI" href="./codex-cli.mdx" description="Custom provider on the Responses API (not yet verified end to end)." />
</Cards>

## The three values [#the-three-values]

| Wire format | Base URL | Used by |
| --- | --- | --- |
| OpenAI Chat Completions | `https://ai.codai.ro/v1` | Cursor, Cline, Continue, Zed, Copilot CLI (`openai`) |
| OpenAI Chat Completions | `https://ai.codai.ro/v1` | Vercel AI SDK (`@ai-sdk/openai-compatible`) |
| OpenAI Responses | `https://ai.codai.ro/v1` | Codex CLI (`wire_api = "responses"`) |
| Anthropic Messages | `https://ai.codai.ro` (root, no `/v1`) | Claude Code, Copilot CLI (`anthropic`), Zed (`anthropic_compatible`) |
| MCP (Streamable HTTP) | `https://ai.codai.ro/mcp` | All six |

The key is the same everywhere: create it at [hub.codai.ro](https://hub.codai.ro) under **Keys → Create key** (see the [quickstart](../gateway/index.mdx)). The model is `codai`; the other aliases are listed in [models](../gateway/models.mdx).

## What codai does not serve [#what-codai-does-not-serve]

- **`POST /v1/completions`** (legacy completions, fill-in-the-middle). Editor autocomplete that calls it — Continue autocomplete, Zed edit predictions — will not work against codai. Keep those on the tool's own provider.
- **`POST /v1/messages/count_tokens`**. Clients that treat it as optional keep working.

## MCP in one paragraph [#mcp-in-one-paragraph]

`https://ai.codai.ro/mcp` accepts either `Authorization: Bearer codai_…` or OAuth 2.1. For OAuth the auth server supports Dynamic Client Registration and requires PKCE, so a client that implements the MCP authorization spec needs only the URL — no key, no client ID. Tools and auth details are on [clients](../gateway/clients.mdx#mcp-server).

## When something fails [#when-something-fails]

- **`404` on the first request** — the base URL is wrong. OpenAI-style tools need `/v1`; Anthropic-style tools need the root. A `404` here is often reported by the tool as an authentication error.
- **`401 invalid_api_key`** — the key is missing, revoked or pasted with a space.
- **`429`** — read `error.code`: `quota_exceeded` means your plan tasks are used up, `rate_limit_exceeded` means slow down. See [limits and pricing](../gateway/limits-pricing.mdx).
