跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.metask.ai/llms.txt

Use this file to discover all available pages before exploring further.

Cursor supports custom OpenAI-compatible endpoints, which means you can route its AI features — inline completions, chat, and code generation — through 元任务 AI 网关. Once configured, Cursor sends all requests to the gateway, and you can choose any model the gateway supports rather than being limited to those Cursor bundles by default.

Prerequisites

Steps

1

Open Cursor settings

In Cursor, open the Command Palette with Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows/Linux) and search for Cursor Settings. Alternatively, go to CursorSettings in the menu bar.
2

Navigate to the Models section

In the settings panel, select the Models tab (sometimes labeled AI or AI Models depending on your Cursor version).
3

Add a custom OpenAI-compatible endpoint

Scroll to the OpenAI API Key section. Enable the Override OpenAI Base URL option and enter the gateway endpoint:
https://napi.origintask.cn/v1
4

Enter your gateway API key

In the OpenAI API Key field, paste your 元任务 AI 网关 API key. Cursor sends this key in the Authorization header for every request to the gateway.
5

Select a model

In the model list, choose a model name that matches one available on the gateway. If the model you want does not appear in the list, use the Add Model option and type the model identifier exactly as it appears in the Available Models reference.

Verify the connection

After saving your settings, open a file and trigger an inline completion or send a message in Cursor Chat. If the gateway responds correctly, you will see output generated by the model you selected. If you see an authentication error, double-check that your API key is correct and has sufficient balance.
Chat-focused models like gpt-4o and claude-3-5-sonnet tend to work well for Cursor Chat and code explanations. For inline completions, a faster model like gpt-4o-mini reduces latency. You can set different models for chat and autocomplete in Cursor’s settings.
Cursor’s model list may include models that are not available through the gateway. If you select one of those, requests will fail. Stick to model identifiers listed in the gateway’s models reference.