MisarMisar

API Documentation

Integrate Misar AI into your applications

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

1

Create an API Key

Go to Settings → API Keys to create a new API key. Choose the appropriate scopes for your use case.

2

Save Your Key Securely

Your API key is only shown once when created. Store it securely in environment variables, never in client-side code.

3

Include in Requests

Add the Authorization header to all API requests:

example.js
1// Include your API key in all requests
2const 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

EndpointFreeStarterProTeam
Projects API60/min120/min300/min600/min
Chat API20/min40/min100/min200/min
RAG API--100/min200/min
Deploy API10/min20/min50/min100/min

Rate limit headers are included in all responses:

  • X-RateLimit-Limit: Maximum requests per window
  • X-RateLimit-Remaining: Remaining requests
  • X-RateLimit-Reset: Unix timestamp when limit resets

All Endpoints

get
/api-keys

List API keys

Returns all API keys for the authenticated user. Keys are returned without the secret portion for security.

Code Examples

terminal
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

response.json
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}
post
/api-keys

Create API key

delete
/api-keys

Revoke API key

get
/projects

List projects

post
/projects

Create project

get
/projects/{id}

Get project

patch
/projects/{id}

Update project

delete
/projects/{id}

Delete project

post
/projects/{id}/deploy

Deploy project

get
/projects/{id}/deploy

Get deployment status

get
/templates

List templates

post
/templates

Create template

get
/templates/{id}

Get template

patch
/templates/{id}

Update template

delete
/templates/{id}

Delete template

post
/templates/{id}/use

Create project from template

post
/chat

Generate code with AI

post
/rag

Index project files

get
/rag

Search code or get stats

delete
/rag

Clear project embeddings

get
/usage

Get usage statistics

post
/usage/track

Track usage event

post
/billing/checkout

Create checkout session

post
/stripe/portal

Get billing portal URL

post
/analytics/events

Track analytics events

get
/health

Comprehensive health check

get
/health/ready

Kubernetes readiness probe

get
/health/live

Kubernetes liveness probe

Error Codes

CodeStatusDescription
200OKRequest succeeded
201CreatedResource created successfully
400Bad RequestInvalid request parameters
401UnauthorizedMissing or invalid API key
403ForbiddenInsufficient permissions or plan
404Not FoundResource not found
429Too Many RequestsRate limit or billing limit exceeded
500Internal ErrorServer error, please retry