◈ API Reference
OpenCrest's REST API lets you deploy agent swarms, orchestrate multi-step workflows, and connect to the entire Emaaa Empire — staffing, video generation, Parliament analysis — all from code.
Overview
All endpoints accept JSON POST requests and return JSON. The base URL depends on which API you're calling:
// OpenCrest Orchestrator
POST https://opencrest.io/api/oc_orchestrator.php
// Empire Sync (cross-platform)
POST https://opencrest.io/api/empire_sync.php
// Maya Nexus (chat/image gateway)
POST https://opencrest.io/api/maya_nexus.php
Authentication
Public endpoints (ping, list_roles, stats) require no auth. Orchestration endpoints use the Maya Nexus protocol:
Authorization: Bearer sha256(domain + MASTER_SECRET)
Quick Start
Deploy your first agent swarm in 3 lines:
// Deploy a swarm that builds a marketing campaign
fetch('https://opencrest.io/api/oc_orchestrator.php', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
action: 'orchestrate',
goal: 'Build a marketing campaign for AI staffing',
priority: 'quality',
max_agents: 5
})
});
Orchestrate AUTH REQUIRED
POST/api/oc_orchestrator.php
Submit a high-level goal. Maya's Master Planner decomposes it into subtasks and deploys specialized agents.
| Parameter | Type | Description |
|---|---|---|
| action | string | "orchestrate" |
| goal | string | Natural language description of what you want done |
| priority | string | "speed" | "quality" | "cost" |
| max_agents | int | Maximum agents to deploy (default: 5) |
Deploy Swarm AUTH REQUIRED
POST/api/oc_orchestrator.php
Deploy multiple agents simultaneously with specific roles and tasks.
{
"action": "swarm",
"agents": [
{"role": "seo_warlord", "task": "Audit our website SEO"},
{"role": "viral_director", "task": "Plan 30-day content calendar"},
{"role": "outbound_sniper", "task": "Write 10 cold outreach emails"}
]
}
Deploy Single Agent FREE
POST/api/oc_orchestrator.php
Deploy one specific agent for a focused task.
| Parameter | Type | Description |
|---|---|---|
| action | string | "deploy_agent" |
| role | string | Agent role key (e.g. "api_forge", "security_general") |
| task | string | What this agent should do |
List All Roles FREE
GET/api/oc_orchestrator.php?action=list_roles
Returns all 200+ agent roles organized by department.
Platform Stats FREE
GET/api/oc_orchestrator.php?action=stats
Returns total roles, missions completed, active swarms, and platform status.
Empire Sync API CROSS-PLATFORM
The Empire Sync layer connects OpenCrest to all Emaaa platforms. Call any empire service from one endpoint.
Chat with Maya
{"action": "chat", "message": "How should I structure my automation?"}
Search AI Staff (448 roles)
{"action": "search_staff", "q": "ML engineer"}
Generate Video via CineSynth
{"action": "video", "prompt": "Cinematic product demo...", "aspect": "16:9"}
Consult Parliament (22 seats)
{"action": "parliament", "question": "Should we use microservices or monolith?"}
Health Check All Platforms
{"action": "health"}
// Returns: latency for each platform in ms