The Misar AI API enables programmatic access to AI-powered code generation, project management, and deployment features. Use this API to integrate Misar capabilities into your development workflows, CI/CD pipelines, or custom applications.
Authentication
Secure your API requests with an API key
Create an API Key
Go to Settings → API Keys to create a new API key. Choose the appropriate scopes for your use case.
Save Your Key Securely
Your API key is only shown once when created. Store it securely in environment variables, never in client-side code.
Include in Requests
Add the Authorization header to all API requests:
1// Include your API key in all requests2const response = await fetch("https://app.misar.dev/api/projects", {3 headers: {4 "Authorization": "Bearer msk_your_api_key_here",5 "Content-Type": "application/json",6 },7});
Never expose your API key in client-side code or public repositories.
Rate Limits
Request limits vary by endpoint and subscription plan
| Endpoint | Free | Starter | Pro | Team |
|---|---|---|---|---|
| Projects API | 60/min | 120/min | 300/min | 600/min |
| Chat API | 20/min | 40/min | 100/min | 200/min |
| RAG API | - | - | 100/min | 200/min |
| Deploy API | 10/min | 20/min | 50/min | 100/min |
Rate limit headers are included in all responses:
X-RateLimit-Limit: Maximum requests per windowX-RateLimit-Remaining: Remaining requestsX-RateLimit-Reset: Unix timestamp when limit resets
All Endpoints
/api-keysList API keys
Returns all API keys for the authenticated user. Keys are returned without the secret portion for security.
Code Examples
1curl -X GET "https://app.misar.dev/api/api-keys" \2 -H "Authorization: Bearer msk_your_api_key" \3 -H "Content-Type: application/json"
Response
1{2 "apiKeys": [3 {4 "id": "550e8400-e29b-41d4-a716-446655440000",5 "userId": "user_abc123",6 "name": "Production API Key",7 "keyPrefix": "msk_a1b2c3d4",8 "scopes": [9 "projects:read",10 "projects:write"11 ],12 "lastUsedAt": "2024-01-15T10:30:00Z",13 "expiresAt": null,14 "createdAt": "2024-01-01T00:00:00Z"15 }16 ],17 "availableScopes": {18 "projects:read": "Read project data",19 "projects:write": "Create and update projects",20 "projects:delete": "Delete projects",21 "builds:read": "Read build data",22 "builds:create": "Create new builds",23 "ai:chat": "Use AI chat features",24 "ai:generate": "Use AI code generation",25 "*": "Full API access"26 }27}
/api-keysCreate API key
/api-keysRevoke API key
/projectsList projects
/projectsCreate project
/projects/{id}Get project
/projects/{id}Update project
/projects/{id}Delete project
/projects/{id}/deployDeploy project
/projects/{id}/deployGet deployment status
/templatesList templates
/templatesCreate template
/templates/{id}Get template
/templates/{id}Update template
/templates/{id}Delete template
/templates/{id}/useCreate project from template
/chatGenerate code with AI
/ragIndex project files
/ragSearch code or get stats
/ragClear project embeddings
/usageGet usage statistics
/usage/trackTrack usage event
/billing/checkoutCreate checkout session
/stripe/portalGet billing portal URL
/analytics/eventsTrack analytics events
/healthComprehensive health check
/health/readyKubernetes readiness probe
/health/liveKubernetes liveness probe
Error Codes
| Code | Status | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Insufficient permissions or plan |
| 404 | Not Found | Resource not found |
| 429 | Too Many Requests | Rate limit or billing limit exceeded |
| 500 | Internal Error | Server error, please retry |