Skip to main content

Introduction

The Polaris IDE API provides programmatic access to create and manage projects, interact with AI features, and handle file operations. All API endpoints require authentication via Stack Auth JWT tokens.

Base URL

The API is hosted at the same domain as your Polaris IDE instance:
https://your-domain.com/api
For local development:
http://localhost:3000/api

Authentication

All API endpoints require authentication using Stack Auth. See the Authentication page for details on obtaining and using JWT tokens.

Request Format

All POST requests require:
  • Content-Type: application/json header
  • Valid JWT token in the Authorization header
  • JSON request body (where applicable)

Response Format

All responses are returned in JSON format:
{
  "success": true,
  "data": { ... }
}
Or in case of errors:
{
  "error": "Error message",
  "status": 400
}

Error Handling

The API uses standard HTTP status codes:
Status CodeMeaning
200Success
400Bad Request - Invalid parameters
401Unauthorized - Missing or invalid authentication
403Forbidden - Project limit reached or access denied
404Not Found - Resource doesn’t exist
409Conflict - Resource already being processed
500Internal Server Error

Common Error Responses

{
  "error": "Unauthorized"
}

Rate Limiting

Polaris IDE implements usage-based limits via Autumn (Stripe) integration:

Project Limits

TierProjectsPrice
Free10$0/mo
Pro MonthlyUnlimited$29/mo
Pro YearlyUnlimited$290/yr

AI Features

AI features (suggestions, quick edit, conversations) are available to all users. Rate limiting is handled at the provider level (OpenRouter or Cerebras).

API Endpoints

Projects

GitHub Integration

AI Features

System

Health Check

/api/health
GET
Check API health status

Response

status
string
Always returns “ok” if API is healthy
timestamp
number
Current server timestamp in milliseconds
environment
string
Either “electron” or “web” depending on the runtime

Example Request

cURL
curl https://your-domain.com/api/health

Example Response

{
  "status": "ok",
  "timestamp": 1735660800000,
  "environment": "web"
}

Next Steps

Authentication

Learn how to authenticate API requests

Projects API

Create and manage projects

Messages API

Interact with AI conversations

AI Suggestions

Use AI-powered code features

Build docs developers (and LLMs) love