Moamao

Quickstart: your first run

Zero to one mixture run: an API key, one curl call, and the same call through the TypeScript SDK. No provider keys required — the default compute mode runs on Moamao Cloud.

1. Get an API key

Moamao is in open beta — no invite needed. Create a free account, then generate a key in the dashboard. Keep it server-side; it authenticates every request as a Bearer token.

export MOAMAO_KEY="mm_live_..."

2. First run with curl

Create a run by POSTing to /api/v1/runs. With "compute": "moamao-cloud" (the default) the mixture runs on our managed capacity — no provider setup, metered per token.

curl https://moamao.com/api/v1/runs \
  -H "Authorization: Bearer $MOAMAO_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Review this migration plan for failure modes: ...",
    "compute": "moamao-cloud"
  }'
Beta host: the API is served from the app origin (moamao.com/api/v1/runs). A dedicated api.moamao.com host arrives at GA.

The call blocks until the judge finishes — expect roughly the wall time of two sequential model calls, since each layer runs in parallel. Streaming isn't available in the beta; send "stream": false (the default).

3. The same run in TypeScript

The TypeScript SDK ships with the open beta. Until then the snippet below shows the intended surface; the raw REST call above works today.

npm install moamao
import { Moamao } from "moamao";

const client = new Moamao({ apiKey: process.env.MOAMAO_KEY });

const run = await client.runs.create({
  input: "Review this migration plan for failure modes: ...",
  compute: "moamao-cloud",
});

console.log(run.answer);

4. Reading the response

A completed run has three parts you'll use most:

{
  "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
  }
}
  • answer — the synthesized final answer. This is what you show your users.
  • trace[]— the propose, critique, and aggregate stages in order, each with its wall-clock time. Traces are stored for replay; a zero-retention option is available if you don't want them kept.
  • usage.total_tokens — what the run metered. Moamao Cloud bills per token across the whole mixture. (BYOK runs, in the playground, meter per run instead.)

5. Using your own provider keys (BYOK)

Prefer to run the mixture on your own Anthropic, OpenAI, Google, or OpenAI-compatible keys, at your own rates? BYOK is billed per run instead of per token. In the open beta, BYOK mixtures run from the playground — passing "compute": "byok" to the REST API returns a clear error until account-level provider keys land at GA.


Next: learn the vocabulary in Concepts, or go straight to the API reference.