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:

  1. V2 API Key: Costs 0.10 cents per request. Suitable for occasional use or testing.

  2. 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

1

Access Cursor Settings

  1. Open Cursor code editor

  2. Navigate to Settings

  3. Select the “Models” section

  4. Find the “OpenAI API Key” settings

2

Configure API Settings

  1. Override the base URL to https://api.trynia.ai

  2. Add your Nia API key in the API key field

3

Verify Connection

  1. Click on the “Verify” button

  2. If working correctly, there should be no output from Cursor

  3. You’re now ready to use Nia AI in Cursor

Usage

# Select any OpenAI model (e.g., gpt-4o)
# Cursor will automatically route requests to Nia AI

# Ask coding questions
# Get context-aware responses
# Receive code suggestions

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.

1

Configure Your IDE

  1. Locate the AI settings in your preferred code editor

  2. Find the API configuration section

2

Set Up Nia API

  1. Override the base URL to https://api.trynia.ai

  2. Add your Nia API key

  3. 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

Troubleshooting

FAQ