Cursor
Use Token101 models in Cursor IDE via the OpenAI-compatible API
Cursor
Cursor is an AI-powered code editor built on VS Code. It supports custom AI providers through its OpenAI-compatible API configuration, letting you use any Token101 model directly inside the editor.
Prerequisites
- A Token101 API key — subscription users can create one directly; free users need to complete API activation first at token.ppthub.shop/settings/apikeys
- Cursor installed — download from cursor.com
Step 1 — Open Cursor Settings
- Open Cursor
- Press
Cmd + Shift + J(macOS) orCtrl + Shift + J(Windows/Linux) to open Settings - Navigate to Models section
Or go to: Cursor → Settings → Cursor Settings → Models
Step 2 — Add a Custom Model
In the Models section:
- Scroll down to OpenAI API Key section
- Enter your Token101 API key in the API key field
- Click Override OpenAI Base URL and enter:
https://token.ppthub.shop/api/v1- In the model list, you can add custom model names. Click Add Model and enter a model name such as
gpt-5.2
Cursor uses the OpenAI-compatible format. The base URL must end with /v1 — do not use https://token.ppthub.shop/api (which is for Anthropic SDK clients only).
Step 3 — Verify the Connection
- Open any file in Cursor
- Press
Cmd + K(macOS) orCtrl + K(Windows/Linux) to open the inline chat - Type a simple message like
Reply with: TOKEN101_OK - Press Enter
If you see TOKEN101_OK in the response, your configuration is working.
Available Models
Add any of these model names in Cursor's model list:
| Model | Model name to enter |
|---|---|
| GPT-5.4 | gpt-5.4 |
| GPT-5.2 | gpt-5.2 |
| GPT-5.3 Codex | gpt-5.3-codex |
| Claude Opus 4.6 | claude-opus-4-6 |
| Claude Sonnet 4.5 | claude-sonnet-4-5 |
| Claude Haiku 4.5 | claude-haiku-4-5 |
| Qwen Max | qwen-max |
See Supported Models for the complete list.
Cursor Features That Work With Token101
Inline Edit (Cmd/Ctrl + K)
Select code and press Cmd + K to edit inline. Token101 will apply the change directly in the editor.
Chat Panel (Cmd/Ctrl + L)
Open the chat panel to have a conversation about your codebase. Cursor indexes your project files and provides context automatically.
Composer (Cmd/Ctrl + I)
Use Composer to make multi-file changes. Describe what you want at a high level and Cursor will propose and apply changes across multiple files.
Tab Completion
Cursor's tab completion uses its own model by default. To use Token101 for tab completion, you need to configure it as the autocomplete model in Settings → Models → Autocomplete.
Configuration via settings.json
You can also configure Cursor programmatically by editing its settings JSON. Press Cmd + Shift + P, search for "Open User Settings (JSON)", and add:
{
"cursor.general.openAIAPIKey": "your-token101-api-key",
"cursor.general.openAIBaseURL": "https://token.ppthub.shop/api/v1",
"cursor.general.openAIModel": "gpt-5.2"
}Cursor settings files may be stored in plaintext. Avoid syncing them to public repositories. Use Cursor's built-in settings UI where possible, as it stores credentials more securely.
Chat Completions API Reference
Cursor talks to Token101 through the OpenAI-compatible Chat Completions endpoint. The same endpoint works with any OpenAI SDK or HTTP client:
- Endpoint:
POST https://token.ppthub.shop/api/v1/chat/completions - Auth:
Authorization: Bearer sk-... - OpenAI SDK: set
base_urltohttps://token.ppthub.shop/api/v1 - Parameter passthrough: for OpenAI-family models, fields not documented here (such as
response_format,seed, andlogprobs) are forwarded to the model provider as-is - Go deeper: see the OpenAI Chat Completions sections of Streaming and Tool Calling
Troubleshooting
Cursor shows "Invalid API key"
- Verify your API key is correct in Settings → API Keys
- Check that the key is pasted without extra spaces
- Make sure the Base URL is
https://token.ppthub.shop/api/v1(with/v1)
Cursor shows "Model not found"
The model name you entered doesn't match a supported model. Check Supported Models for exact model IDs.
Responses stop mid-way
This can happen with very long responses and Cursor's default timeout settings. Try:
- Asking for shorter responses
- Increasing Cursor's request timeout in advanced settings
Chat panel shows no response
- Check the Cursor output panel (
View → Output → Cursor) for error details - Verify your Token101 credits at token.ppthub.shop/settings/billing
- Try a direct API test with curl to confirm the endpoint is reachable:
curl https://token.ppthub.shop/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN101_API_KEY" \
-d '{"model": "gpt-5.2", "messages": [{"role": "user", "content": "Hi"}]}'Next Steps
- Supported Models — see all available models
- Streaming — how streaming works in the API
- Claude Code — terminal-based coding with Claude
- API Reference — full endpoint documentation