Docs / API Reference

API Reference

40+ REST endpoints covering authentication, agent management, AI features, billing, and system health. All endpoints return JSON and require Bearer token authentication in production.

Authentication

The API provides two authentication paths: a Bearer token for programmatic access, and a session cookie for the dashboard. In production, API requests require a Bearer token set via the API_TOKEN environment variable:

Authorization: Bearer your-api-token
  • Bearer token — required on all endpoints in production, set via API_TOKEN
  • /api/health — exempt from authentication, so uptime checks work without a token
  • Dashboard sessions — use a session cookie set during login instead of a Bearer token

Rate Limits

ScopeLimitWindow
General API120 requests1 minute
Heavy operations10 requests1 minute

Heavy rate limiting applies to these endpoints:

  • clone-url
  • media/produce
  • leads/scrape
  • batch
  • grok/query
  • browser/execute
  • 3d/scenes
  • vibe-design/projects

System

GET /api/health

Server health check. Returns uptime, memory usage, version, and environment.

Authentication Endpoints

POST /api/auth/login

Authenticate a user. Sets a session cookie and returns a token.

// Request body
{ "email": "[email protected]", "password": "..." }

// Response
{ "token": "session-token", "plan": "pro" }
GET /api/auth/me

Get current session info. Returns email and subscription plan.

POST /api/auth/logout

Invalidate the current session and clear the cookie.

Agents & Skills

GET /api/agents

List all available agents with metadata (name, model, tier, description).

GET /api/skills

List all available skills with descriptions and input schemas.

POST /api/orchestrate

Send a task to the Orchestrator for intelligent routing and execution.

Design System

GET /api/design-system

Get the current DESIGN.md content with reasoning and token layers.

POST /api/design-system/clone-url

Clone a brand's design system from a URL. Heavy rate limited.

// Request body
{ "url": "https://example.com" }

// Response
{ "design": { "reasoning": {...}, "tokens": {...} } }
GET /api/design-system/export

Export the design system as DESIGN.md, CSS variables, JSON tokens, or Tailwind config.

Media & 3D

POST /api/media/produce

Start a media production job (video, image, audio). Heavy rate limited.

POST /api/3d/scenes

Generate a Blender 3D scene from a text prompt. Heavy rate limited.

POST /api/vibe-design/projects

Create a new Vibe Design Studio project. Heavy rate limited.

Monetization

POST /api/leads/scrape

Start a lead scraping job for a target industry. Heavy rate limited.

POST /api/batch

Submit a batch content generation job. Heavy rate limited.

// Request body
{
  "type": "blog|social|product|email|seo",
  "prompt": "Topic or instructions",
  "count": 10  // max: 100
}

AI Queries

POST /api/grok/query

Send a real-time query to Grok (grok-4.5) for live data. Heavy rate limited.

POST /api/browser/execute

Execute a headless browser task. Heavy rate limited.

Branding

GET /api/tenant/branding

Returns this instance's branding (company name, tagline, logo, colors). Public, no auth required.

POST /api/branding

Update this instance's branding — theme your own self-hosted dashboard with your company name, logo, and colors. Admin only.

Knowledge Graph

GET /api/knowledge

List all knowledge graph entries with metadata.

POST /api/knowledge

Add a new entry to the knowledge graph.

Error Responses

All endpoints return standard error objects:

{
  "error": "Description of what went wrong"
}
StatusMeaning
400Bad Request — Missing or invalid parameters
401Unauthorized — Missing or invalid API token
403Forbidden — Valid token but insufficient permissions
404Not Found — Resource does not exist
429Too Many Requests — Rate limit exceeded
500Server Error — Unexpected failure

Frequently Asked Questions

Does the AI OS API require authentication?

Yes. In production, API requests require a Bearer token set via the API_TOKEN environment variable, sent as an Authorization: Bearer header. The /api/health endpoint is exempt, and dashboard access uses session cookies set during login instead of a token.

What are the API rate limits?

General API requests are limited to 120 per minute. Heavy operations — clone-url, media/produce, leads/scrape, batch, grok/query, browser/execute, 3d/scenes, and vibe-design/projects — are limited to 10 per minute.

What happens when the rate limit is exceeded?

The API returns a 429 Too Many Requests status with a standard error object describing what went wrong.

What does an API error response look like?

Every endpoint returns a JSON object with an error field describing the problem, alongside a standard HTTP status code — 400 for bad requests, 401 for missing or invalid tokens, 403 for insufficient permissions, 404 for missing resources, 429 for rate limiting, and 500 for server errors.

How many REST endpoints does the API expose?

The AI OS API offers 40+ REST endpoints covering authentication, agent and skill management, the design system, media and 3D generation, monetization, AI queries, tenant branding, and the knowledge graph. All endpoints return JSON.

Can I submit a batch content generation job through the API?

Yes. POST /api/batch accepts a type (blog, social, product, email, or seo), a prompt, and a count of up to 100 items, and is heavy rate limited.