# Use GPT and Claude in Cursor or Cline with one key

> Use GPT and Claude in Cursor, Cline, or Roo Code with one key by routing custom OpenAI requests through thelastapi gateway at thelastapi.dev/v1/ai.

**You can use both GPT and Claude in Cursor, Cline, or Roo Code with one key by setting your editor's OpenAI-compatible base URL to `https://thelastapi.dev/v1/ai`.** thelastapi runs an OpenAI-compatible gateway that accepts chat completion requests and routes them to models from OpenAI, Anthropic, Google, DeepSeek, and other providers. You keep one account, set unified spend limits, and switch between GPT and Claude simply by changing the model identifier in your editor settings.

This guide walks through configuring Cursor, Cline, and Roo Code, selecting models, and managing budgets across your coding tools.

## Why route coding models through one key

Using multiple AI models in your daily workflow usually requires separate accounts, multiple API keys, and fragmented billing pages. You might use Claude for architectural refactoring, GPT for code explanations, and DeepSeek for high-volume context analysis. That setup creates operational friction:

- **Key proliferation.** You must store, track, and rotate separate credentials for every lab on each development machine.
- **Scattered billing.** Credits sit in separate accounts with individual deposit minimums and disconnected billing cycles.
- **Duplicated tooling.** Different lab endpoints require separate client adapters or extension plugins.

A unified API gateway solves this by using the OpenAI request format as a common protocol. By routing requests through `https://thelastapi.dev/v1/ai`, you can invoke models from Anthropic, OpenAI, or Google using standard OpenAI client settings. If you want your agent to handle infrastructure beyond completions, you can read [one API key for an AI agent: hosting, database, email, payments and models](https://thelastapi.dev/blog/one-api-key-for-ai-agent).

## Available models and token rates

When sending requests to the gateway, you specify which model to run using the `model` field. You can select either a thelastapi alias model or any lab model identifier from the catalogue:

| Model ID | Lab model | Primary use | Input / output per million tokens |
| --- | --- | --- | --- |
| `vibiz/fast` | GPT-6 Luna (OpenAI) | Quick inline edits and lightweight chat | $0.10 / $0.50 |
| `vibiz/lite` | DeepSeek V4.1 Flash | High-context tasks and budget completions | $0.14 / $0.42 |
| `vibiz/balanced` | Gemini 3.8 Flash (Google) | Balanced speed, reasoning, and cost | $0.825 / $4.125 |
| `vibiz/smart` | Claude Sonnet 5.5 (Anthropic) | Complex coding, debugging, and refactoring | $2 / $10 |
| `vibiz/pro` | Claude Opus 5.5 (Anthropic) | Advanced architecture and multi-file reasoning | $4 / $20 |

You can also use direct lab identifiers, such as `anthropic/claude-sonnet-5.5`, `anthropic/claude-opus-5.5`, or `moonshotai/kimi-k3.1-pro`. More than 400 language models are available through the catalogue.

When you request a model, exactly that model runs. If a provider experiences an outage, the gateway does not swap in a different model without your knowledge. It returns `model_unavailable` or `provider_unavailable` with a retry hint. If you enter an unrecognized model ID, the API returns a `400 invalid_request` error naming the `model` parameter.

To view all available models and current rates from your command line, run:

```bash
vibiz ai models --all
```

## Configure Cursor for GPT and Claude

Cursor lets you override its default OpenAI endpoints. This allows you to route chat, edits, and agent prompts through thelastapi with a single key.

### Set up custom OpenAI endpoints in Cursor

1. Open Cursor and navigate to **Settings ▸ Models**.
2. Under the OpenAI section, enter your thelastapi key (`vz_sk_…`).
3. Turn on **Override OpenAI Base URL** and set the endpoint to:
   ```text
   https://thelastapi.dev/v1/ai
   ```
4. In the model list, add the model identifiers you plan to use, such as `vibiz/smart`, `vibiz/fast`, and `anthropic/claude-sonnet-5.5`.
5. Disable unnecessary default model toggles so requests route through your thelastapi key.

Now, selecting `vibiz/smart` runs Claude Sonnet 5.5, while selecting `vibiz/fast` runs GPT-6 Luna, all billed to your thelastapi balance.

### Connect Cursor to the MCP server

Beyond simple completions, Cursor can interact with databases, deployments, and email tools through the Model Context Protocol (MCP). To connect Cursor to the MCP server, add this configuration to `.cursor/mcp.json` in your project or `~/.cursor/mcp.json` for global access:

```json
{
  "mcpServers": {
    "vibiz": {
      "command": "npx",
      "args": ["-y", "@vibiz/cli", "mcp"],
      "env": {
        "VIBIZ_API_KEY": "${env:VIBIZ_API_KEY}"
      }
    }
  }
}
```

Or connect directly to the remote MCP endpoint without installing local packages:

```json
{
  "mcpServers": {
    "vibiz": {
      "url": "https://thelastapi.dev/mcp"
    }
  }
}
```

For more configuration examples, review the [Agents documentation](https://thelastapi.dev/docs/agents).

## Configure Cline and Roo Code in VS Code

Cline and Roo Code support custom OpenAI-compatible providers natively. You can configure them to toggle between GPT and Claude from a single interface.

### Step 1: Configure the API provider

Open the settings view in Cline or Roo Code:

1. Locate the **API Provider** setting and select **OpenAI Compatible**.
2. In the **Base URL** field, enter:
   ```text
   https://thelastapi.dev/v1/ai
   ```
3. In the **API Key** field, paste your thelastapi key (`vz_sk_…`).

### Step 2: Set your model identifier

In the **Model ID** field, type the identifier for the model you need:

- For coding, refactoring, and debugging, enter `vibiz/smart` or `anthropic/claude-sonnet-5.5`.
- For fast, low-cost iterations, enter `vibiz/fast`.
- For difficult logic and system design, enter `vibiz/pro` or `anthropic/claude-opus-5.5`.

When you want to switch from Claude to GPT, update the Model ID field to `vibiz/fast`. You do not need to change your base URL or update your API key.

To confirm your key and connection outside the editor, test the endpoint with `curl`:

```bash
curl https://thelastapi.dev/v1/ai/chat/completions \
  -H "Authorization: Bearer $VIBIZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "vibiz/smart",
    "messages": [{"role": "user", "content": "Respond with the word pong"}]
  }'
```

To understand the boundaries of what OpenAI gateways can do across different agent tools, see [can you use Claude Code with other models? What a gateway can and cannot do](https://thelastapi.dev/blog/claude-code-other-models).

## Install agent skills in Cursor

You can install agent skills to give Cursor exact operational context for your tasks. Skills are structured folders containing a `SKILL.md` file and reference materials. When your instructions match a skill's description, the editor loads the necessary workflow rules.

Install skills globally for Cursor using the [CLI](https://thelastapi.dev/docs/cli):

```bash
vibiz skills add --global --agent cursor
```

The CLI places skill packages into `~/.cursor/skills/<name>/SKILL.md`. To read more about how skills format instructions for agents, check [Agent skills (SKILL.md) for Claude Code, Codex and Cursor](https://thelastapi.dev/blog/agent-skills-skill-md) and the [Agent skills documentation](https://thelastapi.dev/docs/skills).

## Managing keys, limits, and costs

When using an API key inside editor extensions, managing permissions and spending limits protects your account.

### Key permissions: Full access vs. Limited keys

thelastapi provides two primary key access tiers:

- **Full access (`access: owner`):** Can perform all owner actions, including reading production secrets, managing domains, executing withdrawals, and changing billing settings.
- **Limited key (`access: agent`):** Can create projects, deploy code, send email, and make AI calls, but cannot view production secrets or modify payment accounts.

When logging in through the CLI with `vibiz login`, a Limited key named `cli · <computer name>` is saved by default. If you share a key with a third-party extension or teammate, generate a Limited key:

```bash
vibiz keys create editor-key --limited
```

If an extension holding a Limited key attempts an owner-restricted operation, the API returns a `403 owner_only` error containing `details.grant_url`, where an account owner can approve the action. Learn more in the [Keys and environments documentation](https://thelastapi.dev/docs/keys).

### Controlling spend and monitoring usage

To prevent runaway loops from coding agents, you can set account and project spending caps:

```bash
vibiz billing limit 10          # sets account-wide daily limit to $10
vibiz ai budget 5 --project prj_123 # sets a project daily AI limit to $5
```

By default, accounts have a $5 daily spend ceiling, and projects have a $1 daily AI budget. When a budget is reached, calls return a `429 rate_limited` response with the reason stated in `details.reason`.

You can review spend by model, key, or day directly from your terminal:

```bash
vibiz usage --by model
vibiz usage --by api_key
```

Each completed request also includes `cost_micro_usd` in its JSON payload, giving you exact per-call accounting.

To get started, set up your account by following the [Quickstart documentation](https://thelastapi.dev/docs/quickstart), or create your account at [thelastapi.dev/start](https://thelastapi.dev/start) if you don't have one yet.

## Frequently asked questions

### Do I need separate accounts with OpenAI and Anthropic to use both in Cursor or Cline?

No. By setting your editor's base URL to `https://thelastapi.dev/v1/ai` and using your thelastapi key, you can call models from OpenAI, Anthropic, Google, and DeepSeek on one bill.

### What happens if an AI lab suffers an outage while I am coding?

The gateway fails transparently and returns a `model_unavailable` or `provider_unavailable` error with a retry hint. It never secretly redirects your prompt to a different model.

### How can I prevent a coding agent from racking up unexpected API bills?

You can configure an account-wide daily limit with `vibiz billing limit <dollars>` or set a project-specific ceiling with `vibiz ai budget <dollars>`. Requests exceeding the budget fail with an informative `429 rate_limited` error.

### What are the request and token rate limits for the AI gateway?

Account keys receive 300 requests and 400,000 tokens per minute, while project keys receive 120 requests and 200,000 tokens per minute. Default maximum token output is 1,024, expandable up to 16,384 tokens.

---

Published 2026-11-15 · https://thelastapi.dev/blog/one-key-cursor-cline-models
