Introduction
The Polaris API provides programmatic access to AI-powered code editing features. All endpoints require authentication and use JSON for request and response payloads.Base URL
Authentication
Polaris uses Clerk for authentication. All API requests must include a valid session token.Authentication Flow
- User authenticates through Clerk
- Clerk session token is automatically included in requests
- API validates the session and extracts
userId - Request is processed for the authenticated user
Authentication Errors
If authentication fails, you’ll receive one of these error responses:Request Format
All POST requests should include:- Content-Type:
application/json - Authentication: Valid Clerk session token (handled by Clerk SDK)
Response Format
All responses are returned as JSON with appropriate HTTP status codes:200- Success400- Bad Request (validation error)401- Unauthorized (missing authentication)403- Forbidden (invalid authentication)404- Not Found (resource doesn’t exist)500- Internal Server Error
Rate Limiting
Rate limiting is enforced per user session. Contact your administrator for specific limits.Available Endpoints
AI Features
Messages
Send messages to AI assistant and trigger code generation
Cancel Messages
Cancel in-progress AI message processing
Suggestions
Get AI-powered code completions at cursor position
Quick Edit
Edit selected code using natural language instructions
Projects
Create with AI
Create a new project from a natural language prompt
GitHub Integration
Import Repository
Import a GitHub repository into Polaris
Export to GitHub
Export a Polaris project to a new GitHub repository