Development Tools

Using OneAster in Cursor

Detailed guide on how to configure and use OneAster API service in Cursor AI code editor. This guide will help you configure OneAster API in Cursor to access rich AI model resources for code development.

Prerequisites

Before you begin, please ensure:
  1. Cursor is installed
    Download and install the version suitable for your OS from the Cursor website
  2. You have an OneAster API key
    Log in to the OneAster Console to get your API key (starts with sk-)
Tip: If you don’t have an OneAster account yet, register at OneAster and obtain an API key first.

Step 1: Open Cursor Settings

After launching Cursor, open Settings:
  1. Click the ⚙️ Settings icon (gear) in the top-right corner
  2. Or use shortcuts:
    • Windows/Linux: Ctrl+Shift+J
    • macOS: Cmd+Shift+J

Open Cursor settings using the gear icon at the top right, or press Ctrl+Shift+J on Windows/Linux or Cmd+Shift+J on macOS.

Step 2: Configure model settings

2.1 Open model settings

In Settings:
  1. Find Models in the left sidebar
  2. Open the model settings page
Cursor Settings - Models

2.2 Use OpenAI API Key

On the model settings page:
  1. Find the OpenAI API Key section
  2. Click Add new or Override OpenAI Base URL
Important: Cursor supports OpenAI-compatible APIs, so OneAster can be configured as a custom provider.

2.3 Configure OneAster

Enter the following:
Important: - Base URL must include the /v1 suffix: https://api.oneaster.ai/v1 - The API key must be the sk-... key from the OneAster console - After saving, Cursor uses OneAster models for completion and chat

In Cursor model settings, enter your OneAster API Key and set Base URL to https://api.oneaster.ai/v1. Check and save the configuration.

Step 3: Choose models

3.1 Model selection

Enable the required model in Cursor model settings. If adding a model manually, enter a model ID available through OneAster, then select it in the chat panel.

In model settings you can choose which models to use. Available families:
  • GPT-4/5 — strong for complex code generation and Q&A
    • gpt-5 — latest GPT-5
    • gpt-4o — GPT-4o
    • gpt-4o-mini — faster, lower cost
  • Claude — strong for understanding and refactoring
    • claude-sonnet-4-5-20250929 — Claude Sonnet 4.5
    • claude-haiku-4-5-20251001 — Claude Haiku 4.5
  • Other
    • gemini-2.0-flash-exp — Google Gemini 2.0 Flash
Suggestions: - 💰 Completion (cost-efficient): gpt-4o-mini - 🚀 Hard tasks (performance): gpt-5, gpt-4o, claude-sonnet-4-5-20250929 - ⚡ Low latency: gpt-4o-mini, gemini-2.0-flash-exp

3.2 Per-feature models

You can pick different models per feature:
  • Chat — conversations with the AI
  • Autocomplete — inline suggestions
  • Cmd+K — quick edit / generate
Choose the best fit for each workflow.

Step 4: Start using

Once configured, you can use Cursor’s AI features.

4.1 AI Chat (Cmd+L / Ctrl+L)

  1. Press Cmd+L (macOS) or Ctrl+L (Windows/Linux)
  2. Ask a question or give a task, for example:
    • “How do I implement quicksort?”
    • “Help me optimize this code’s performance”
    • “Explain how this function works”

Press Cmd+L on macOS or Ctrl+L on Windows/Linux to open AI chat. Select the configured model, enter a question or coding request, and read the response in the panel.

4.2 Code completion

  1. Type as usual in the editor
  2. Cursor suggests completions
  3. Press Tab to accept
Autocomplete

4.3 Quick edit (Cmd+K / Ctrl+K)

  1. Select code
  2. Press Cmd+K (macOS) or Ctrl+K (Windows/Linux)
  3. Describe the edit, e.g.:
    • “Add error handling”
    • “Refactor this function”
    • “Add type annotations”
Quick edit

4.4 Explain code

  1. Select the code
  2. Right-click Explain with AI (or shortcut)
  3. The AI explains behavior and logic

FAQ

Q1: Can’t reach OneAster?

Try:
  1. Base URL — must be exactly https://api.oneaster.ai/v1
  2. API key — valid sk-... key from the console
  3. Network — ensure https://api.oneaster.ai is reachable; a proxy may be required in some regions

Q2: Slow responses?

Try:
  1. Use a lighter model (gpt-4o-mini instead of gpt-4o, or gemini-2.0-flash-exp)
  2. Shorten context — send less code, ask more precise questions
  3. Check latency / proxy if needed

Q3: API errors?

Q4: Usage and billing?

Open the OneAster Console:
  • 📊 Call statistics
  • 💰 Cost breakdown
  • 📈 Usage trends
  • 🔍 Request logs

Tips

1. Use context

  • Open related files
  • Reference files with @filename
  • Reference folders with @folder

2. Clear prompts

❌ Weak:
✅ Strong:

3. Iterate

Start small → refine → test → adjust prompts.

4. Project rules

Define style, naming, architecture, and tests in .cursorrules.

Features

With Cursor + OneAster:
  • 💬 Chat for coding questions
  • ⚡ Smart completion
  • ✏️ Natural-language edits
  • 🔍 Deeper code understanding
  • 🐛 Debugging help
  • 📝 Docs and comments
  • 🔄 Refactoring
  • 🧪 Test scaffolding

Support


Get started with OneAster

Sign up, get your API key, and ship faster with Cursor!