Skip to main content
Cursor is an AI-native code editor built on VS Code, integrating powerful AI capabilities to provide developers with an unprecedented programming experience. Through Laozhang API, you can use various advanced large language models in Cursor.

Quick Start

1. Download and Install

Visit Cursor Official Website to download and install the version suitable for your operating system:
  • Windows: Windows 10 or higher
  • macOS: macOS 10.15 or higher
  • Linux: Ubuntu 18.04 or higher

2. Configure Laozhang API

1

Open Settings

Click “Cursor” in the menu bar > “Settings” (or use shortcut Cmd/Ctrl + ,)
2

Find Models Configuration

In the left sidebar, select “Models” option
3

Configure OpenAI Compatible API

Scroll to the “OpenAI API Key” section:
  • API Provider: Select “OpenAI Compatible”
  • Base URL: Enter https://api2.laozhang.ai/v1
  • API Key: Enter your Laozhang API key
  • Default Model: Choose a model (e.g., gpt-5.5)
4

Save Configuration

Click “Save” button to complete configuration
Cursor Settings Interface
Obtaining API Key
  1. Visit Laozhang API Console
  2. Click “Create New Token” button
  3. Choose a suitable billing method
  4. Copy the generated API Key
Cursor supports multiple large language models, choose appropriate models based on different programming needs:
Model Selection Strategy
  • Cost-sensitive users: Recommend gpt-4.1-mini for daily coding
  • Quality prioritizers: Recommend gpt-5.5 or claude-sonnet-4-6
  • Large codebase: Recommend claude-sonnet-4-6
  • Multimodal needs: Recommend gemini-3.1-pro-preview, supports image understanding

Core Features

1. AI Code Completion (Tab)

Cursor provides intelligent code completion triggered by the Tab key: Features:
  • Context-aware smart completion
  • Multi-line code generation
  • Automatic import statement generation
  • Intelligent comment writing
Usage Example:

2. AI Chat (Cmd/Ctrl + K)

Chat with AI in the editor, get instant help: Use Cases:
  • Ask code questions
  • Request refactoring suggestions
  • Generate test cases
  • Explain complex algorithms
  • Debug error messages
Usage Example:

3. AI Editing (Cmd/Ctrl + L)

Select code, trigger AI editing mode: Features:
  • Code refactoring
  • Style adjustment
  • Add comments
  • Type annotation
  • Error fixing
Usage Example:

4. Codebase Indexing

Cursor can index your entire codebase, providing:
  • Global code search
  • Intelligent jump to definition
  • Refactoring suggestions
  • Dependency analysis

5. Multi-file Editing

Operate on multiple files simultaneously:
  • Batch code refactoring
  • Consistent style modification
  • Cross-file function extraction
  • Unified dependency updates

Advanced Features

@Symbols Citation

Use @ symbol in chat mode to cite code elements:
Example:

Terminal Integration

Cursor integrates terminal, you can:
  • Let AI generate terminal commands
  • Explain command outputs
  • Debug errors
  • Optimize scripts

Git Integration

Deeply integrated with Git:
  • AI-generated commit messages
  • Code review assistance
  • Conflict resolution suggestions
  • Branch management advice

Configuration Best Practices

Basic Configuration

Advanced Configuration

Multi-Model Configuration

Configure different models for different scenarios:

Usage Scenarios

Scenario 1: New Project Development

Scenario 2: Code Refactoring

Scenario 3: Bug Fixing

Scenario 4: Learning New Technologies

Troubleshooting

Connection Issues

Problem: Unable to connect to API Solutions:
  1. Check if Base URL is correct: https://api2.laozhang.ai/v1
  2. Verify API Key validity (visit console)
  3. Check network connection
  4. Confirm firewall settings

No Response

Problem: AI doesn’t respond Solutions:
  1. Check account balance
  2. Confirm model availability
  3. Try switching models
  4. Check if request exceeds rate limit

Inaccurate Suggestions

Problem: Code suggestions don’t meet expectations Solutions:
  1. Provide more context information
  2. Refine requirement descriptions
  3. Try different models
  4. Adjust temperature parameter (lower = more deterministic, higher = more creative)

Response Too Slow

Problem: AI response speed is slow Solutions:
  1. Switch to a faster model (e.g., gpt-4.1-mini)
  2. Reduce maxTokens setting
  3. Simplify query content
  4. Check network speed

Best Practices

1. Effective Communication

Communicate clearly and specifically with AI:

2. Utilize Context

Make full use of Cursor’s context awareness:
  • Use @ symbol to cite relevant files
  • Provide necessary background information
  • Keep editor open with related code

3. Iterative Improvement

Don’t expect perfect results at once:
  1. Get initial suggestions
  2. Test and evaluate
  3. Provide feedback
  4. Iterative optimization

4. Security Awareness

Protect sensitive information:
  • Don’t paste actual API keys in chat
  • Don’t share production database connection strings
  • Don’t upload confidential business logic

5. Cost Control

Reasonably control usage costs:
  • Use lighter models for simple tasks
  • Avoid unnecessary repeated requests
  • Set reasonable maxTokens limits
  • Regularly review usage

Shortcut Reference

Further Learning

Official Resources

Learning Resources

Community Support

Need more help? Please visit Laozhang API Official Website or contact our support team.