Cursor Integration
Learn how to use Nia AI with Cursor code editor
This guide explains how to set up Nia AI in Cursor to enhance your coding experience with Nia Agent.
- You need a personal Nia API key to get started.
Overview
Cursor is a code editor built for AI pair programming. By integrating Nia AI with Cursor, you can override the default OpenAI models with the Nia Agent, providing enhanced context-aware coding assistance.
Messages sent in Cursor will be logged in your External folder, allowing you to continue your conversations in the Nia web app.
API Key Options
Nia offers two types of API keys for integration with Cursor:
-
V2 API Key: Costs 0.10 cents per request. Suitable for occasional use or testing.
-
Cursor API Key: Included in the Nia Pro plan ($14.99/month). Provides unlimited integration with Cursor and other tools.
Choose the option that best fits your usage needs.
Rate Limits
All Nia API keys have a default rate limit of 60 requests per minute. This ensures optimal performance and fair usage across all users.
Pro plan users can request increased rate limits by contacting our support team.
Installation
Access Cursor Settings
-
Open Cursor code editor
-
Navigate to Settings
-
Select the “Models” section
-
Find the “OpenAI API Key” settings
Configure API Settings
-
Override the base URL to
https://api.trynia.ai
-
Add your Nia API key in the API key field
Verify Connection
-
Click on the “Verify” button
-
If working correctly, there should be no output from Cursor
-
You’re now ready to use Nia AI in Cursor
Usage
Features
Enhanced Context
-
Improved code understanding
-
Project-wide context awareness
-
More relevant code suggestions
Conversation Continuity
-
Seamless transition between Cursor and Nia
-
Persistent conversation history
-
Cross-platform context retention
Advanced Code Assistance
-
Deeper code analysis
-
More accurate bug detection
-
Better code completion
Integrated Experience
-
Native-feeling integration
-
Familiar interface
-
Consistent user experience
Other Code Editor Integrations
Nia API works with any IDE or developer tool that uses LLMs and allows custom models that use the OpenAI chat/completions format.
Configure Your IDE
-
Locate the AI settings in your preferred code editor
-
Find the API configuration section
Set Up Nia API
-
Override the base URL to
https://api.trynia.ai
-
Add your Nia API key
-
Use the appropriate model name as required by your IDE
Best Practices
Performance Optimization
-
Be aware of higher latency due to context retrieval
-
Use specific, focused queries
-
Provide clear context when needed
Effective Queries
-
Be specific about code sections
-
Reference file paths when relevant
-
Break complex questions into smaller parts