Moamao

API reference

Beta reference — the surface is stabilizing; breaking changes are announced in the changelog.

Base URL: https://moamao.com/api/v1. The API is served from the app origin during the beta; a dedicated api.moamao.com host arrives at GA. All bodies are JSON.

Authentication

Every request carries your API key as a Bearer token. Generate keys in the dashboard; keep them server-side and rotate any key that leaks.

Authorization: Bearer $MOAMAO_KEY

POST /api/v1/runs

Create a run: fan the input out to the panel, run propose and critique, aggregate, and return one answer. The call blocks until the judge finishes.

POST https://moamao.com/api/v1/runs

{
  "input": "Review this migration plan for failure modes: ...",
  "compute": "moamao-cloud"
}

Request fields

FieldTypeRequiredDescription
inputstringrequiredThe prompt. Fans out to the whole panel. Max 8,000 characters in the beta.
compute"moamao-cloud" | "byok"optional“moamao-cloud” (default) runs on our managed mixture endpoint, billed per token. “byok” is reserved for account provider keys and returns byok_not_available in the beta — run BYOK mixtures in the playground for now.
streambooleanoptionalMust be false in the beta. Streaming arrives at GA; sending true returns stream_not_available.

Response

{
  "id": "rn_ahcA-Y86aCc1XWkd",
  "object": "run",
  "model": "Moamao Cloud",
  "compute": "moamao-cloud",
  "answer": "The plan has two likely failure modes: ...",
  "trace": [
    { "stage": "propose",   "provider": "Moamao Cloud", "ms": 2197 },
    { "stage": "critique",  "provider": "Moamao Cloud", "ms": 255 },
    { "stage": "aggregate", "provider": "Moamao Cloud", "ms": 223 }
  ],
  "usage": {
    "prompt_tokens": 536,
    "completion_tokens": 125,
    "total_tokens": 661
  }
}
FieldTypeDescription
idstringRun identifier (rn_...).
objectstringAlways “run”.
modelstringThe compute that answered — “Moamao Cloud” for managed runs.
computestringThe compute mode used: “moamao-cloud”.
answerstringThe synthesized final answer. This is what you show your users.
trace[]arrayOrdered stages: { stage: propose | critique | aggregate, provider, ms }.
usage.prompt_tokensnumberInput tokens metered across the whole mixture.
usage.completion_tokensnumberOutput tokens metered across the whole mixture.
usage.total_tokensnumberSum of the two. Moamao Cloud bills per token on this total.

Errors

Errors return a non-2xx status and a single JSON object with a message and a stable code:

{
  "error": "compute: 'byok' isn't wired in this beta. Use compute: 'moamao-cloud'.",
  "code": "byok_not_available"
}
StatusCodeMeaning
400bad_requestMalformed JSON or a missing input. The message names the problem.
400byok_not_availablecompute: “byok” over the API isn’t wired in the beta. Use moamao-cloud, or run BYOK in the playground.
400stream_not_availablestream: true isn’t available in the beta. Send stream: false.
401unauthorizedMissing, malformed, or revoked API key. Pass Authorization: Bearer mm_live_…
413too_largeinput exceeds the beta size limit.
503capacity_unavailableMoamao Cloud is busy. Retry shortly — availability is honest, not an SLA.
502run_failedThe mixture couldn’t complete. Safe to retry with the same body.

Rate limits

During the beta, managed capacity is shared and requests are lightly rate-limited; over the limit you'll get a 429— queue and retry rather than hammering. Availability is honest, not an SLA: when Moamao Cloud is busy you'll get 503 capacity_unavailable. Endpoints for fetching past runs and listing panels arrive at GA; changes land in the changelog.