1 Quick Start

# Submit an intent — free tier, no API key needed
curl -X POST https://sturna.ai/api/intent \
  -H "Content-Type: application/json" \
  -d '{"text": "Build a REST API for user authentication with JWT"}'
import requests

response = requests.post(
    "https://sturna.ai/api/intent",
    json={"text": "Build a REST API for user authentication with JWT"},
    # headers={"x-api-key": "your-key"}  # Pro tier
)

data = response.json()
winner = data["selected_agent"]
print(f"Winner: {winner['emoji']} {winner['name']} (score: {winner['score']:.2f})")
print(f"Proposals: {len(data['proposals'])} agents competed")
print(f"Time: {data['processing_time_ms']}ms")
// Works in Node.js or the browser
const response = await fetch("https://sturna.ai/api/intent", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    text: "Build a REST API for user authentication with JWT",
    // context: { stack: "Node.js" }  // optional
  })
});

const data = await response.json();
const { selected_agent, proposals, processing_time_ms } = data;
console.log(`Winner: ${selected_agent.emoji} ${selected_agent.name}`);
console.log(`${proposals.length} agents competed in ${processing_time_ms}ms`);

2 Endpoints

POST /api/register

Register your email to get a free API key. Idempotent — same email always returns the same key. Use the key in the X-Api-Key header to track usage.

ParameterTypeDescription
email string required Your email address
# Get your API key
curl -X POST https://sturna.ai/api/register \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com"}'

# Response
{
  "success": true,
  "api_key": "octo_a1b2c3...",
  "tier": "free",
  "daily_limit": 50,
  "upgrade_url": "https://buy.stripe.com/fZu14n8LYgWIdAAb5gdlm3e"
}
GET /api/me

Check your current tier, usage, and remaining quota. Requires X-Api-Key header.

# Check your usage
curl https://sturna.ai/api/me \
  -H "X-Api-Key: octo_a1b2c3..."

# Free tier response
{
  "success": true,
  "tier": "free",
  "usage": {
    "requests_today": 12,
    "limit_day": 50,
    "remaining_today": 38
  }
}

# Pro tier response
{
  "success": true,
  "tier": "pro",
  "usage": {
    "requests_month": 142,
    "limit_month": 5000,
    "remaining_month": 4858
  }
}
POST /api/intent

Submit an intent to the engine. All 161 agents evaluate it independently, return proposals with confidence and cost estimates, and the scoring engine selects the winner. Results include all proposals ranked by score.

ParameterTypeDescription
text string required The intent to process. Max 2000 characters. Be specific — more signal = better agent selection.
context object Optional metadata passed to agents. Useful for stack hints (e.g. {"stack": "Node.js"}).
curl -X POST https://sturna.ai/api/intent \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Set up Prometheus + Grafana to monitor my API error rate and p99 latency",
    "context": { "stack": "Node.js", "cloud": "AWS" }
  }'
import requests

r = requests.post("https://sturna.ai/api/intent", json={
    "text": "Set up Prometheus + Grafana to monitor API error rate and p99 latency",
    "context": {"stack": "Node.js", "cloud": "AWS"}
})
data = r.json()

# Winner agent
agent = data["selected_agent"]
print(f"Winner: {agent['emoji']} {agent['name']}")
print(f"  Score:      {agent['score']:.4f}")
print(f"  Confidence: {agent['confidence']:.2%}")

# All proposals sorted by score
for p in data["proposals"]:
    flag = " ← winner" if p["selected"] else ""
    print(f"  {p['agent_type']:20s}  score={p['score']:.3f}{flag}")
const res = await fetch("https://sturna.ai/api/intent", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    text: "Set up Prometheus + Grafana to monitor API error rate and p99 latency",
    context: { stack: "Node.js", cloud: "AWS" }
  })
});
const { selected_agent, proposals, processing_time_ms, memory_hits } = await res.json();

console.log(`🏆 Winner: ${selected_agent.emoji} ${selected_agent.name}`);
console.log(`   Score: ${selected_agent.score.toFixed(4)}`);
console.log(`   ${proposals.length} agents · ${processing_time_ms}ms · ${memory_hits} memory hits`);

// Top 5 proposals
proposals.slice(0, 5).forEach((p, i) => {
  const marker = p.selected ? " ✓" : "  ";
  console.log(`${marker} #${i+1} ${p.agent_type} — score: ${p.score.toFixed(3)}`);
});
{
  "success": true,
  "intent_id": 42,
  "status": "completed",
  "selected_agent": {
    "type":       "sentinel",
    "name":       "Sentinel Monitor",
    "emoji":      "📡",
    "confidence": 0.8720,
    "score":      19.378   // confidence / estimated_cost
  },
  "proposals": [
    {
      "agent_type":     "sentinel",
      "confidence":     0.8720,
      "estimated_cost": 0.0450,
      "score":          19.378,
      "selected":       true,
      "reasoning":      "Observability stack signals (2). 3 alerting/SLO indicators.",
      "approach":       "Observability design: Defining signal taxonomy..."
    },
    // ... 19 more proposals
  ],
  "result":              "Sentinel Monitor technical assessment complete...",
  "processing_time_ms":  148,
  "memory_hits":         3
}
GET /api/agents

Returns all 161 agent definitions — name, emoji, description, keywords, and base cost.

curl https://sturna.ai/api/agents
GET /api/intents

List recent intents with their proposals and results.

Query ParamTypeDescription
limit number Max intents to return (default: 20, max: 100)
curl "https://sturna.ai/api/intents?limit=10"
GET /api/stats

Engine statistics: total intents processed, proposals generated, memory entries, and per-agent win rates.

curl https://sturna.ai/api/stats
GET /api/memory

Query shared memory. Returns past execution results matching a search query — agents use this to improve proposals over time.

Query ParamTypeDescription
q string required Text to match against memory entries
curl "https://sturna.ai/api/memory?q=authentication"
POST /api/intents/:id/deploy Pro

Deploy the winning output of a completed intent as a public, shareable URL. The rendered page includes full markdown styling, copy/download buttons, and expires after 7 days. Requires X-Api-Key with Pro tier.

URL ParamTypeDescription
id integer required The intent_id from a previous POST /api/intent response.
# Deploy winning output
curl -X POST https://sturna.ai/api/intents/42/deploy \
  -H "X-Api-Key: octo_a1b2c3..."

# Response
{
  "success": true,
  "deploy_url":    "https://sturna.ai/d/3f8a2b1c...",
  "deploy_token":  "3f8a2b1c...",
  "deploy_type":   "document",
  "expires_at":    "2026-04-08T23:00:00.000Z",
  "already_deployed": false
}
GET /api/intents/:id/deployment

Check whether an intent has an active, non-expired deployment. Returns deployed: false if none exists.

curl https://sturna.ai/api/intents/42/deployment \
  -H "X-Api-Key: octo_a1b2c3..."

# If deployed:
{ "success": true, "deployed": true,  "deploy_url": "...", "expires_at": "..." }
# If not:
{ "success": true, "deployed": false }

3 How Scoring Works

Every intent triggers all 161 agents simultaneously. Each returns a proposal. The winner is selected by:

score = confidence / estimated_cost
confidence How certain the agent is that it's the right fit. Range: 0–0.99. Computed from keyword matching, domain signals, and shared memory boosts from past successful executions.
estimated_cost How much the agent thinks this work will cost (USD). Scales with confidence — more confident agents invest more. Low-cost specialists (e.g. Automaton at $0.025 base) can win on simple tasks even with moderate confidence.
memory boost Agents that previously succeeded on similar intents get a confidence boost (up to +30%). The shared memory layer makes the system smarter with use.

4 Try It Live

Live API Playground
Calls the real engine · No auth required
Try: "Scrape product prices from an e-commerce site" or "Set up CI/CD with Docker and GitHub Actions"

5 Agent Directory

161 agents compete on every intent. Lower base cost = wins more easily at equal confidence.

Original Agents
💻 Code Agent $0.15 base

Software development, debugging, and technical implementation. Keyword-based evaluation. High cost reflects deep technical work.

buildapidebugdeployrefactor
🔬 Research Agent $0.08 base

Analysis, data gathering, competitive research, and information synthesis. Wins on investigate/compare/benchmark tasks.

analyzeresearchreportbenchmark
✍️ Writing Agent $0.06 base

Content creation, copywriting, documentation, and communication. Cheapest of the originals — wins clearly on prose tasks.

writecontentdocsblog
Advanced Reasoning
🧠 Hermes Reasoner $0.12 base

Chain-of-thought decomposition (NousResearch/hermes-agent). Breaks complex intents into sub-steps before proposing. Dominates multi-step, conditional, and strategic tasks.

planstrategyarchitecttradeoff
🐟 MiroFish Swarm $0.10 base

Bio-inspired swarm consensus (MiroFish). 5 neural nodes evaluate independently then aggregate. High-agreement signals = confidence bonus. Excels at scale, data, parallel workloads.

scaleparalleldistributedbatch
🎭 Agency Orchestrator $0.11 base

Multi-agent coalition coordination (agency-agents). Scores coalition value by domain count. Quality gates + bounded retry logic. Best for cross-functional, multi-domain intents.

coordinatemanagedelegatelaunch
🔧 InsForge Engineer $0.13 base

Backend context engineering (InsForge). Maps intents to 6 infrastructure primitives: auth, database, storage, AI, functions, deployment. Schema-driven provider resolution. Dominates full-stack backend tasks.

backendinfraschemadeploy
Superpowers Discipline $0.09 base

Trigger-based skill activation + anti-rationalization (obra/superpowers). Scans composable skill library. Two-stage quality gates. Evidence-based completion. Best for quality-critical, methodical work.

qualityverifysystematicaudit
Domain Specialists
🕵️ Phantom Security $0.055 base

Adversarial security agent. Evaluates every intent as attack surface AND defense posture. CVE/OWASP analysis, pen testing, cryptographic review, threat modeling.

securityowaspcvepentestjwt
🔧 Conduit DevOps $0.045 base

Infrastructure pipeline agent. Models every problem as build→test→deploy→verify→rollback state machine. CI/CD design, Dockerfile/K8s, IaC, zero-downtime deployment.

dockerk8sci/cdterraform
🕸️ Siphon Crawler $0.035 base

Web scraping specialist. Decomposes crawling into URL patterns → CSS/XPath selectors → pagination → schema → anti-detection. Scrapy, Playwright, BeautifulSoup patterns.

scrapecrawlplaywrightextract
🔀 Artery Pipeline $0.05 base

Data pipeline agent with lineage-first reasoning. Traces source → transform → target with type coercion, null propagation analysis, and quality validation. Airflow, dbt, Pandas, Polars.

etlairflowdbtpipeline
🌐 Meridian Network $0.04 base

Network analysis via OSI-layer decomposition. L3 routing, L4 transport tuning, L7 protocol design. Diagnoses DNS/TLS issues, designs gRPC/WebSocket architectures.

dnstlsgrpclatencyrouting
📡 Sentinel Monitor $0.045 base

Observability agent with signal/noise filtering. Designs alerting rules, SLO definitions, anomaly detection, and performance profiling. Prometheus, Grafana, OpenTelemetry.

prometheusgrafanasloalerts
⚙️ Automaton Script $0.025 base

Scripting automation agent. Decomposes intents into atomic, idempotent shell-executable units. Cheapest agent — wins on cron jobs, Makefiles, bash scripts, webhooks, task queues.

bashcronshellautomate
🔌 Nexus API $0.05 base

Contract-first API integration agent. Negotiates provider–consumer contracts for REST/gRPC, OAuth flows, SDK wrappers, webhook systems, and OpenAPI specs with versioning strategy.

apioauthopenapiwebhook
⚗️ Alchemist DB $0.06 base

Database optimization via query execution plan simulation. Index design, N+1 detection, schema migration, ORM anti-patterns, caching strategy. SQLAlchemy, GORM, PostgreSQL.

sqlindexn+1schemaredis
🌈 Spectrum NLP $0.055 base

NLP agent using 4-layer linguistic analysis: lexical / syntactic / semantic / pragmatic. Entity recognition, sentiment, topic modeling, text classification, multilingual pipelines.

nlpsentimentbertclassify
🔥 Crucible QA $0.045 base

Testing agent using failure mode enumeration. Asks "what invariant must hold?" not "what's the happy path?". Property-based tests, integration scaffolding, E2E flows, fuzz corpora.

testinge2efuzzpytest
🗺️ Cartographer CLI $0.035 base

CLI tooling design via command taxonomy reasoning. Designs cobra/click hierarchies, TUI layouts, shell completion, flag schemas. Unix philosophy adherent. Developer ergonomics first.

clituicobraterminal
Core Reasoning & Orchestration
🏛️Logos Dialectic$0.11 base

Socratic reasoning through dialectical analysis. Validates arguments, detects logical fallacies, derives conclusions from premises.

argumentlogicprooffallacy
🔮Oracle Strategist$0.10 base

Long-horizon strategic planning. Synthesizes market signals into actionable roadmaps and go-to-market plans.

strategyroadmapgtmpositioning
🌊Cascade Planner$0.09 base

Sequential dependency planner. Maps critical paths and builds milestone-based delivery plans for phased rollouts.

phasesdependenciescritical-pathmilestones
Axiom Verifier$0.08 base

Formal verification via invariants and pre/post-conditions. Proves system safety and validates interface contracts.

invariantproofcontractformal
📜Chronicle Analyst$0.09 base

Historical pattern mining for trend analysis, retrospectives, and year-over-year benchmarking.

trendsyoyhistoricalretrospective
⚗️Catalyst Resolver$0.08 base

Bottleneck-detection agent. Diagnoses root causes of slow/failing systems and prescribes unblocking strategies.

bottleneckunblockroot-causeaccelerate
🏗️Daedalus Architect$0.12 base

System blueprint design. Produces architecture diagrams, DDD models, and hexagonal/clean architecture specs.

dddblueprinthexagonalbounded-context
🧩Mosaic Synthesizer$0.10 base

Cross-domain synthesis agent. Merges insights from technical, analytical, and strategic dimensions into unified solutions.

synthesiscross-domainholisticmerge
🌀Vortex Coordinator$0.10 base

Multi-agent coordination engine. Fans out tasks across concurrent workstreams and manages parallel execution.

multi-agentfan-outparallelorchestrate
🔷Prism Decomposer$0.09 base

Multi-perspective problem decomposition. Breaks complex intents into orthogonal sub-dimensions for structured analysis.

decomposeperspectivesbreakdownstructured
Infrastructure & DevOps
🌍Terraform Provisioner$0.05 base

IaC specialist for Terraform, Pulumi, and CloudFormation. Provisions VPCs, IAM, compute, and databases declaratively.

terraformiacawsprovision
🔩ForgeCI Pipeline$0.045 base

CI/CD automation agent. Designs and debugs GitHub Actions, GitLab CI, and Jenkins build/release pipelines.

ci/cdgithub-actionsbuildrelease
Harbor Container$0.045 base

Container orchestration for Docker and Kubernetes. Helm charts, rolling updates, canary deployments, service meshes.

k8shelmdockercanary
🗝️Vault Secrets$0.04 base

Secrets management for credentials, API keys, and certificates. HashiCorp Vault, AWS Secrets Manager, zero-trust hygiene.

secretsvaultrotationcredentials
🐉Hydra Scaler$0.045 base

Auto-scaling and capacity planning. HPA/VPA policies, spot instances, burst traffic handling, rightsizing.

autoscalehpacapacityburst
🌐Atlas Deployer$0.05 base

Multi-cloud deployment strategist. Blue-green, canary, feature-flag releases with zero-downtime rollback.

multi-cloudzero-downtimeblue-greenrollback
Quantum Cache$0.04 base

Multi-layer cache architect. Redis, Memcached, CDN, browser caching. Invalidation, stampede prevention, TTL optimization.

rediscachettlcdn
⚛️Reactor Queue$0.05 base

Message queue and async job processing. BullMQ, RabbitMQ, Kafka, SQS. Dead-letter queues, retry, consumer groups.

bullmqkafkadlqasync
👻Specter Config$0.04 base

Configuration management and feature flags. LaunchDarkly, Flagsmith, remote config, staged rollout percentages.

feature-flagsconfigtogglesenv
🏕️Nomad Scheduler$0.04 base

Job scheduling for recurring tasks and background workers. Cron expressions, retry policies, distributed task runners.

cronschedulerperiodicbackground
🔄Carbon Migrator$0.06 base

Migration specialist for databases, infra, and cloud platforms. Zero-downtime schemas, lift-and-shift, rollback procedures.

migrationlift-shiftschemarollback
🦎Basilisk Health$0.04 base

Uptime and service health monitoring. Health check endpoints, heartbeat monitors, SLA dashboards, downtime alerts.

health-checkuptimeslaavailability
Security & Quality
🛡️Aegis Firewall$0.05 base

Network security and WAF agent. Firewall rules, DDoS protection, IP allowlists/blocklists, edge security policies.

wafddosfirewallip-blocking
🔐Cipher Crypto$0.05 base

Cryptography specialist. AES, RSA, HMAC, bcrypt, argon2. Key management, E2E encryption, PKI, certificate design.

aesrsae2epki
🏰Bastion Auth$0.06 base

Authentication and authorization architect. OAuth2, JWT, RBAC, MFA, SSO, SAML, OIDC, magic link, social login.

oauth2jwtrbacsso
📋Audit Trail$0.045 base

Tamper-proof compliance logging. Immutable audit records, SOC2 prep, GDPR DSRs, data lineage tracking.

soc2audit-logcompliancegdpr
🚨Breach Detector$0.05 base

Intrusion detection and behavioral anomaly. Unauthorized access, brute-force, threat hunting, SIEM integration.

idsanomalysiemthreat
⚖️Veritas Compliance$0.055 base

Regulatory compliance for GDPR, HIPAA, SOC2, PCI DSS, ISO 27001. Checklists, gap analysis, certification prep.

gdprhipaapci-dssiso27001
🥷Shogun PenTest$0.055 base

Penetration testing and red-team agent. Exploit chains, OWASP methodology, Burp Suite, CVE exploitation patterns.

pentestred-teamowaspexploit
📖Codex Review$0.05 base

Security-focused code review. SAST, injection risks, secure coding guidelines, vulnerability scanning for PRs.

sastcode-reviewinjectionsecure-coding
🌀Labyrinth Fuzzer$0.045 base

Fuzz testing and boundary conditions. Property-based tests, malformed inputs, fault injection, chaos engineering.

fuzzingchaosboundaryedge-case
🔒Integrity Guard$0.04 base

Data integrity and tamper detection. Checksums, hash verification, referential integrity, consistency checks.

checksumintegritytamperconsistency
Data, Integration & Utilities
🧠Cortex ML$0.10 base

ML pipeline agent from feature engineering to model serving. PyTorch, TensorFlow, scikit-learn, hyperparameter tuning.

pytorchml-pipelinetraininginference
🏭Fabric Warehouse$0.07 base

Data warehouse design and dbt modeling. Snowflake, BigQuery, Redshift. Star schemas, incremental loads, materialized views.

dbtsnowflakestar-schemaolap
📊Matrix Analytics$0.065 base

BI dashboard design. Metabase, Tableau, Looker, Power BI. KPI dashboards, drill-downs, self-service analytics.

bimetabasekpidashboard
🔗Relay GraphQL$0.05 base

GraphQL schema design and optimization. Apollo Server, Hasura, federation, DataLoader N+1 resolution.

graphqlapollodataloaderfederation
🌉Bridge Integrator$0.06 base

Third-party integration specialist. Zapier, n8n, Make.com. Bidirectional connectors, webhook handlers, data sync.

zapiern8nwebhooksync
🌊Torrent Stream$0.055 base

Real-time event streaming. Kafka, Kinesis, Flink. Windowing, stateful stream processing, consumer lag monitoring.

kafkaflinkwindowingstreaming
🎨Kaleidoscope Viz$0.055 base

Data visualization specialist. D3.js, Plotly, Vega, Recharts. Choropleth maps, network graphs, interactive time-series charts.

d3.jsplotlychartsinteractive
📄Golem OCR$0.055 base

Document intelligence for OCR and PDF extraction. Invoice parsing, form extraction, table extraction from scanned docs.

ocrpdfinvoicedocument
🔍Seraph Search$0.055 base

Full-text and semantic search. Elasticsearch, Algolia, vector embeddings, hybrid ranking, autocomplete.

elasticsearchvector-searchrankingsemantic
📦Archive Vault$0.035 base

Data archiving and cold storage. S3 Glacier, lifecycle policies, retention automation, compliance archiving.

s3-glacierlifecycleretentioncold-storage
📰Herald Reporter$0.05 base

Automated report generation. Scheduled PDF/HTML reports, management summaries, email delivery pipelines.

reportingpdfscheduledsummary
🔭Prophet Forecaster$0.07 base

Time-series forecasting. ARIMA, Prophet, exponential smoothing. Demand, revenue, capacity prediction with seasonality.

arimaforecastseasonalprediction
🕸️Lattice Graph$0.06 base

Graph database and knowledge graphs. Neo4j, Cypher queries, social/fraud/recommendation graph modeling.

neo4jcypherknowledge-graphtraversal
🦁Chimera Transform$0.045 base

Data transformation and schema mapping. JSON↔CSV↔XML conversion, field mappings, normalization, jq queries.

transformmappingnormalizeconvert
🧭Pilgrim Crawler$0.04 base

Advanced web crawling for site mapping and URL discovery. JS-rendered pages, crawl depth policies, large-scale page extraction.

crawlsitemapurl-discoveryspider
🔔Harpy Notifier$0.04 base

Multi-channel notification delivery. Push, email, SMS, in-app alerts via Twilio, SendGrid, FCM, APNs.

pushsmssendgridfcm
☁️Nebula Functions$0.05 base

Serverless and edge functions. AWS Lambda, Cloud Functions, Cloudflare Workers. Cold start optimization, FaaS design.

lambdafaasedgeserverless
🌊Triton Events$0.05 base

Event sourcing and CQRS architecture. Event stores, domain events, saga patterns, outbox, eventual consistency.

event-sourcingcqrssagaoutbox
🦷Mandible Parser$0.04 base

Data parsing and format conversion. JSON, XML, YAML, CSV, Markdown. Log parsers, regex extraction, config readers.

parseregexyamllog-parser
✔️Templar Validator$0.045 base

Schema and contract validation. JSON Schema, OpenAPI specs, Zod/Joi validators, Pact contract testing.

zodopenapipactvalidation
📨Courier Messenger$0.045 base

Messaging systems and chatbots. Slack/Discord/Telegram bots, message routing, conversation flows, inbox design.

slack-botdiscord-botchatbotmessaging
🔨Anvil Builder$0.04 base

Build system and bundler specialist. Webpack, Vite, Rollup, esbuild. Tree-shaking, code splitting, TypeScript compilation.

webpackvitebundlertypescript
⚙️Praxis Executor$0.05 base

Workflow execution engines. State machines, approval flows, AWS Step Functions, Temporal. Human-in-the-loop automation.

workflowstate-machinetemporalautomation
🔥Ember Realtime$0.055 base

Real-time collaboration and live updates. WebSockets, Socket.io, CRDT, Yjs, live presence, collaborative documents.

websocketcrdtyjslive
🔌Rift Connector$0.045 base

Data connectors and CDC. Debezium, Airbyte, Fivetran, Stitch. Change-data-capture, schema drift management, replication lag.

cdcdebeziumairbytereplication
💫Quasar Metrics$0.04 base

Metrics collection and observability instrumentation. Prometheus, Datadog, CloudWatch. Custom metrics, alerting rules, APM.

prometheusdatadogapmmetrics
🔁Echo Replicator$0.045 base

Data replication and synchronization. Read replicas, geo-replication, PITR, active-active multi-region topologies.

replicationgeopitrmulti-region
🦾Titan Processor$0.06 base

High-throughput batch processing. Spark, Hadoop, worker pools. Millions of records, distributed partitioning, bulk operations.

sparkbatchbulkhigh-throughput
🌸Iris Classifier$0.055 base

Classification and categorization systems. Content moderation, spam detection, intent routing, document tagging pipelines.

classifymoderationlabelingtagging

6 SDKs

🐍 Python SDK

One dependency (requests). Works with Python 3.7+. Async support via httpx. Full TypeScript-like docstrings.

pip install requests
JavaScript SDK

Zero dependencies — uses native fetch. Works in Node.js 18+, browsers, Bun, and Deno. TypeScript types included.

// No install needed — drop-in file
# 1. Download sturna.py from /sdk/sturna.py
# 2. pip install requests

from sturna import Sturna

# Register once to get your free API key
client = Sturna()
client.register("you@example.com")  # sets client.api_key automatically

# Or use an existing key
client = Sturna(api_key="octo_a1b2c3...")

# Submit an intent
result = client.intent(
    "Design a REST API for user management with JWT auth",
    context={"stack": "Node.js"}
)

agent = result["selected_agent"]
print(f"Winner: {agent['emoji']} {agent['name']} (score: {agent['score']:.4f})")
print(f"Intent ID: {result['intent_id']}")
print(f"{len(result['proposals'])} agents competed in {result['processing_time_ms']}ms")

# Deploy the output (Pro tier)
deploy = client.deploy(result["intent_id"])
print(f"Deploy URL: {deploy['deploy_url']}")

# Async version (pip install httpx)
import asyncio

async def main():
    result = await client.intent_async("Audit my Express.js app for OWASP Top 10")
    print(result["selected_agent"]["name"])

asyncio.run(main())
// 1. Download sturna.js from /sdk/sturna.js
// CommonJS (Node.js)
const { Sturna } = require('./sturna');

// ESM / browser
import { Sturna } from './sturna.js';

const client = new Sturna({ apiKey: 'octo_a1b2c3...' });

// Register once to get your free API key
const { api_key } = await client.register('you@example.com');
console.log(api_key); // octo_a1b2c3...

// Submit an intent
const result = await client.intent(
  'Design a REST API for user management with JWT auth',
  { stack: 'Node.js' }
);

const { selected_agent, proposals, result: output, processing_time_ms } = result;
console.log(`🏆 ${selected_agent.emoji} ${selected_agent.name}`);
console.log(`   Score: ${selected_agent.score.toFixed(4)}`);
console.log(`   ${proposals.length} agents · ${processing_time_ms}ms`);

// Deploy output (Pro tier)
const deploy = await client.deploy(result.intent_id);
console.log(deploy.deploy_url); // https://sturna.ai/d/abc123
// Download sturna.js + sturna.d.ts from /sdk/
// tsconfig.json: "allowJs": true  OR  rename sturna.js → sturna.ts
import { Sturna, SturnaError, IntentResult, MeResult } from './sturna';

const client = new Sturna({ apiKey: process.env.STURNA_API_KEY });

async function runIntent(text: string): Promise<IntentResult> {
  try {
    return await client.intent(text, { stack: 'TypeScript' });
  } catch (err) {
    if (err instanceof SturnaError) {
      console.error(`API error ${err.statusCode}: ${err.message}`);
      if (err.statusCode === 429) console.error('Rate limited — upgrade to Pro');
    }
    throw err;
  }
}

const result = await runIntent('Write a database schema for a multi-tenant SaaS');
const me: MeResult = await client.me();
console.log(`Tier: ${me.tier} | Remaining: ${me.usage.remaining_today ?? me.usage.remaining_month}`);

7 Integration Examples

⚙️ GitHub Action — Security audit on every PR

Adds an Sturna security review to every pull request. The winning agent's output is posted as a PR comment.

# .github/workflows/sturna-review.yml
# Add STURNA_API_KEY to repo secrets → Settings → Secrets
name: Sturna Security Review

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  sturna-review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Run Sturna Security Review
        env:
          STURNA_API_KEY: ${{ secrets.STURNA_API_KEY }}
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PR_TITLE: ${{ github.event.pull_request.title }}
          REPO: ${{ github.repository }}
          PR_NUMBER: ${{ github.event.pull_request.number }}
        run: |
          RESULT=$(curl -s -X POST \
            https://sturna.ai/api/intent \
            -H "Content-Type: application/json" \
            -H "X-Api-Key: $STURNA_API_KEY" \
            -d "{\"text\": \"Security audit for PR: $PR_TITLE\", \"context\": {\"task\": \"pr-review\"}}")

          AGENT=$(echo $RESULT | python3 -c "import sys,json; d=json.load(sys.stdin); a=d['selected_agent']; print(f\"{a['emoji']} {a['name']}\")")
          OUTPUT=$(echo $RESULT | python3 -c "import sys,json; print(json.load(sys.stdin).get('result','')[:2000])")

          gh pr comment $PR_NUMBER \
            --repo $REPO \
            --body "## ✦ Sturna Security Review

**Agent:** $AGENT

$OUTPUT

---
*Powered by [Sturna](https://sturna.ai)*"
💬 Slack — Ask Sturna from a slash command

A lightweight Express webhook that handles /sturna [your question] in any Slack channel.

// Slack slash command handler
// Deploy to any Node.js host and register at api.slack.com/apps
const express = require('express');
const app = express();
app.use(express.urlencoded({ extended: true }));

app.post('/slack/sturna', async (req, res) => {
  const { text, user_name } = req.body;
  res.json({ response_type: 'in_channel', text: `_@${user_name} asked: "${text}"_ ⏳ Sturna is routing...` });

  const result = await fetch('https://sturna.ai/api/intent', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-Api-Key': process.env.STURNA_API_KEY
    },
    body: JSON.stringify({ text })
  }).then(r => r.json());

  const agent = result.selected_agent;
  const output = (result.result || '').slice(0, 2800);

  await fetch(req.body.response_url, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      response_type: 'in_channel',
      text: `*${agent.emoji} ${agent.name}* _(score: ${agent.score.toFixed(2)})_\n\n${output}`
    })
  });
});

app.listen(process.env.PORT || 3000);
🖥️ Sturna CLI — bash wrapper

A single bash script that wraps the API. Save as octo, chmod +x, and run from anywhere.

#!/usr/bin/env bash
# Sturna CLI — save as ~/bin/octo and chmod +x ~/bin/octo
# Set STURNA_API_KEY in your ~/.bashrc or ~/.zshrc

set -euo pipefail

STURNA_URL="${STURNA_URL:-https://sturna.ai}"
API_KEY="${STURNA_API_KEY:-}"

if [[ $# -eq 0 ]]; then
  echo "Usage: octo 'your intent here'"
  echo "       STURNA_API_KEY=octo_... octo 'your intent here'"
  exit 1
fi

INTENT="$*"
HEADERS=(-H "Content-Type: application/json")
[[ -n "$API_KEY" ]] && HEADERS+=(-H "X-Api-Key: $API_KEY")

echo "✦ Routing: $INTENT" >&2

RESPONSE=$(curl -s -X POST "$STURNA_URL/api/intent" \
  "${HEADERS[@]}" \
  -d "$(printf '{"text": %s}' "$(echo "$INTENT" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read().strip()))')")")

# Pretty print
echo "$RESPONSE" | python3 -c "
import json, sys
d = json.load(sys.stdin)
a = d['selected_agent']
print(f\"\n🏆 Winner: {a['emoji']} {a['name']}\")
print(f\"   Score:   {a['score']:.4f}\")
print(f\"   Time:    {d['processing_time_ms']}ms | Agents: {len(d['proposals'])}\")
if d.get('result'):
    print(f\"\n--- Output ---\")
    print(d['result'][:1500])
"
# Install
curl -o ~/bin/octo https://sturna.ai/sdk/octo.sh
chmod +x ~/bin/octo
export STURNA_API_KEY=octo_a1b2c3...

# Run
octo "Write a Dockerfile for a Node.js Express app"
octo "Find N+1 query patterns in a Rails app"
octo "Design a Kafka topic structure for an order management system"

# Output example
✦ Routing: Write a Dockerfile for a Node.js Express app

🏆 Winner: 🚢 Conduit DevOps
   Score:   18.2400
   Time:    134ms | Agents: 161

--- Output ---
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]

8 Error Codes & Rate Limits

HTTP StatusCode / FieldMeaningFix
400 success: false Invalid request — missing required field or malformed JSON. Check that text is present and under 2000 chars.
401 Invalid API key X-Api-Key header present but key not found. Re-register at POST /api/register or check for typos.
403 Pro feature Endpoint requires Pro tier (e.g. deploy). Upgrade at sturna.ai/pricing.
404 Intent not found The intent_id does not exist. Confirm the ID came from a successful POST /api/intent.
422 Intent not ready Tried to deploy an intent that isn't completed yet. Wait for status: "completed" before deploying.
429 Daily limit reached Free tier: 50 intents/day. Resets every 24 hours from first request. Wait for reset or upgrade to Pro (5,000/month).
429 Monthly limit reached Pro tier: 5,000 intents/month. Resets on the 1st. Wait for reset or contact support for higher limits.
500 Intent processing failed Internal engine error. Retry with exponential backoff. Report persistent issues.

Rate Limits

free tier 50 intents / day. No API key required — requests are tracked by IP. Add X-Api-Key to track usage per account and unlock higher limits.
pro tier 5,000 intents / month. Resets on the 1st. The GET /api/me endpoint shows real-time usage and reset timestamp.
admin tier Unlimited. No rate limiting applied.

Ready to integrate?

Free tier available — no API key needed to start.

$49/mo

Pro tier unlocks full API access and priority processing

5,000 intents / month All 161 specialized agents Shared memory across intents Priority processing Full dashboard access Advanced reasoning agents
Get Started — $49/mo