Use Claude Through a Custom API in Cursor IDE

Cursor is an AI-native code editor built on top of VS Code. It lets you configure a custom API endpoint and key so you are not limited to the models Cursor offers natively. By pointing Cursor at APIClaw, you get OpenAI-compatible access to Claude, GPT-4o, Gemini, and more—all billed at a flat monthly rate instead of per token.

Cursor's custom API feature

Cursor supports overriding both the API key and the base URL used for all model calls. This is the same mechanism that lets teams bring their own OpenAI organization key. Because APIClaw exposes a fully OpenAI-compatible API, you can use the same override fields to route all Cursor model traffic through APIClaw.

This works for all Cursor features that make model calls: the chat panel, inline completions, Composer, and the terminal agent. Once the base URL is set, every AI feature in the editor uses your APIClaw plan without any per-feature configuration.

Step-by-step configuration

Open Cursor and go to Settings → Cursor Settings → Models. You will see fields for the OpenAI API key and a base URL override. Fill in both:

text
# In Cursor Settings → Models → OpenAI API Key
# Set your API key:
sk-your-apiclaw-key

# In Cursor Settings → Models → Override OpenAI Base URL
# Set the base URL:
https://apiclaw.biz/v1

# Add a custom model (do NOT use the official Claude id — Cursor treats
# claude-opus-4-8 as a built-in and will not route it through your key).
# Use the Apiclaw brand prefix + public model name:
apiclaw/claude-opus-4-8

Save the settings. Then click Add model and enter apiclaw/claude-opus-4-8 (or apiclaw/ plus any other public model name APIClaw exposes). Official ids like claude-opus-4-8 collide with Cursor built-ins, so the apiclaw/ prefix is required. APIClaw strips that prefix before routing; the model still identifies as Claude Opus 4.8, not "Apiclaw Claude".

If Cursor asks you to verify the API key, it sends a lightweight test request to the configured base URL. APIClaw responds correctly to these checks, so verification passes without any special handling.

Verifying the connection outside of Cursor

If you want to confirm the credentials before configuring Cursor, or if you are debugging a connection issue, use the same key and base URL from a Python script or curl:

python
import openai

# Same credentials Cursor is using
client = openai.OpenAI(
    base_url="https://apiclaw.biz/v1",
    api_key="sk-your-apiclaw-key",
)

response = client.chat.completions.create(
    model="apiclaw/claude-opus-4-8",
    messages=[{"role": "user", "content": "Hello from Cursor!"}],
)

print(response.choices[0].message.content)

A successful response confirms that the API key is valid and the endpoint is reachable. You can also open the APIClaw dashboard under Logs to see the request appear in real time with its model, latency, and status.

Choosing which model Cursor uses

After configuring the custom endpoint, Cursor's model picker shows the models that APIClaw exposes. You can select Claude for tasks that benefit from its reasoning and instruction-following, or switch to a faster model for autocomplete-style completions where latency matters more than depth.

APIClaw also supports model fallbacks at the gateway level. If you configure a fallback, a model that is temporarily unavailable at the provider automatically routes to the next available option. From Cursor's perspective, the request succeeds—no error surfaces in the editor.

Cost advantages compared to native Cursor plans

Cursor's native plans include a request or usage allowance and charge per seat. If you have a team that does heavy AI-assisted coding throughout the day, those native allowances can run out or become expensive per seat. Routing through APIClaw lets you control the model backend independently of the Cursor subscription.

With APIClaw's flat-rate plans, you pay for a daily request allowance that your entire application pool shares. If your team's Cursor usage is concentrated during business hours, the daily reset at 00:00 UTC keeps the allowance fresh each day. There are no seat-based charges at the API level—the same key can serve multiple developers or machines.

Using virtual keys for team access

APIClaw lets you issue scoped virtual API keys from one account. You can give each developer a separate virtual key—all backed by the same plan—so usage is attributed per person in the Logs view. If a developer leaves the team, you revoke their key without affecting anyone else's Cursor configuration.

You can also set per-key request budgets so a single developer's heavy use does not exhaust the daily allowance for the whole team. The virtual key system is managed from the API Keys section of the APIClaw dashboard and requires no changes to the underlying Cursor configuration once the keys are distributed.

What APIClaw adds beyond model access

Beyond serving model requests, APIClaw logs every call with full request and response detail, measures latency, and tracks usage by model and key. This gives you an audit trail of what Cursor sent to which model on which day—information that is useful for debugging unexpected outputs, optimizing which model you use for which task, and reviewing team usage patterns.

The observability data is available in the APIClaw dashboard immediately after requests land. You do not need to set up any external logging infrastructure.

Getting started

Sign up at apiclaw.com/ui/signup/ to get your API key. Every new account includes 50 free requests so you can configure Cursor and verify it is working before subscribing. Choose a plan based on your expected daily request volume, paste the key and base URL into Cursor Settings, and you are done.

Ready to get started?

Every new account includes 50 free requests. No card required.

Create your free account