---
title: "Cursor Integration"
description: "Call 1折AI's Claude models in Cursor using a custom OpenAI API key and Base URL, and which features do not use the custom API key."
headingIds: {"Configuration":"section-1","Known Issues":"section-2","FAQ":"section-3"}
---

<aside className="docs-publication" data-pagefind-ignore>

Documentation maintained by [1ZheAI](https://1zheai.com/en/editorial/#publisher). [Sources and corrections](https://1zheai.com/en/editorial/).

Found an error? [Contact support](mailto:support@1zheai.com) with the page address and a description. Do not send API keys or account credentials.

</aside>
Cursor allows you to enter your own API key in settings, and chat models use this API key to send requests. Below is how to connect to 1折AI, along with several limitations you must know first.

<Warning>

Understand these three points before you start:

- According to Cursor's official documentation, **custom API keys only apply to chat models; Tab completion always uses Cursor's own models**.
- Requests pass through Cursor's servers first before being sent to the address you entered, so the Base URL must be publicly accessible (`https://1zheai.com/v1` works fine; a local `localhost` proxy does not).
- The "Override OpenAI Base URL" toggle is not in Cursor's official documentation. The interface description below comes from the Cursor forum and community tutorials, and may change after Cursor updates.

</Warning>

## Configuration

<Steps>
<Step title="Open model settings">

Cursor → **Cursor Settings** → **Models**, find the Keys section.

</Step>
<Step title="Enter OpenAI API Key and Base URL">

```text
OpenAI API Key              sk-你的Key（1折AI 的 Key）
Override OpenAI Base URL    https://1zheai.com/v1
```

The Base URL must include `/v1`.

</Step>
<Step title="Add a model">

Click **Add model** in the model list, enter the model ID, for example `claude-sonnet-5-5`, then turn on its toggle. For model IDs, see [supported models ](/en/docs/models/).

</Step>
<Step title="Try it once in chat">

Select the newly added model in the Chat panel and send a message. After the reply comes back normally, go to the console [call logs ](/en/docs/usage-logs/) to confirm this call.

</Step>
</Steps>

## Known Issues

<Warning>

There is feedback on the Cursor forum: after setting Override OpenAI Base URL, models whose names start with `claude-` may be treated by Cursor as Anthropic models, handled by the Anthropic API key, or cause an error directly. When selecting Claude, the model ID starts with `claude-`. If you encounter this issue, first clear any Anthropic API key you have entered in Cursor and try again.

Reference: [forum post 144899 ](https://forum.cursor.com/t/anthropic-models-break-when-override-openai-baseurl-is-set/144899), [forum post 146998 ](https://forum.cursor.com/t/override-anthropic-base-url-automatically-switches-on-when-using-anthropic-byok/146998).

</Warning>

## FAQ

<AccordionGroup>
<Accordion title="Will Tab completion use 1折AI?">

No. According to Cursor's official documentation, Tab completion always uses Cursor's built-in models and does not go through your API key.

</Accordion>
<Accordion title="Clicking Verify fails?">

First confirm that the Base URL includes `/v1`. Community feedback indicates that the Verify button does not necessarily pass for non-OpenAI model names. You can send a message directly in Chat to test; the deciding factor is whether there is a record in the call logs.

</Accordion>
<Accordion title="Can I use Agent / Composer?">

Community tutorials generally report that only Chat uses the custom API key; features such as Agent, Apply, and Inline Edit may still go through Cursor's own backend. Rely on the records you actually see in the call logs.

</Accordion>
<Accordion title="Want to use Claude fully inside your editor?">

If you mainly want to use Claude for writing code, [Claude Code ](/en/docs/quickstart-claude-code/) (command line or VS Code extension) and [Cline ](/en/docs/quickstart-cline/) have more complete support for custom addresses.

</Accordion>
</AccordionGroup>
