API reference
Evaluate a state against a map of typed questions (choice, noul, score) in one request (~100 ms) and receive structured answers with calibrated probability distributions.
- Base URL:
https://api.mouse.dev(US-East) - Authentication:
Authorization: Bearer sk_mouse_...(create an API key) - Data retention: Zero data retention by default on every request (
Mouse-Data-Retention: none,Cache-Control: no-store) - OpenAPI 3.1 spec:
/openapi.json· Interactive Playground:/console/playground
| Method & endpoint | Auth | Description |
|---|---|---|
POST /v1/decisions | Bearer sk_mouse_... | Evaluate 1 to 128 typed choice, noul (yes/no), and score questions in parallel against a state. |
POST /v1/safeguards | Bearer sk_mouse_... | Judge proposed tool calls against plain-English hard_deny / soft_deny / allow rules and return Claude Code's safeguard_results (flagged, not_flagged, or unavailable). |
POST /v1/calibrations | Bearer sk_mouse_... | Fit a signed confidence cutoff profile (calp1.) on 200–400 labeled examples using 5-fold out-of-fold cross-fitting. |
POST /v1/tunings | Bearer sk_mouse_... | Tune the base model on 200+ labeled examples and get a tenant model id (mouse-1:ft-<suffix>-<id>); dry_run: true returns a quote. |
GET /v1/tunings | Bearer sk_mouse_... | List the account's tunings. |
GET /v1/tunings/{id} | Bearer sk_mouse_... | One tuning with its held-out before/after report. |
DELETE /v1/tunings/{id} | Bearer sk_mouse_... | Remove the adapter and stop hosting. |
GET /v1/models | Bearer sk_mouse_... | List immutable model versions (mouse-preview-2026-10-13), current aliases (mouse-1, mouse), and the account's tuned models. |
GET /healthz | None | Unauthenticated liveness and region probe. |
POST /v1/decisions
Section titled “POST /v1/decisions”Evaluate up to 128 typed questions in parallel and in isolation against a shared state. TypeSafe SDKs that call /v1/systemone reach the same handler; see SDKs and compatibility.
POST https://api.mouse.dev/v1/decisionsAuthorization: Bearer <MOUSE_API_KEY>Content-Type: application/jsonRequest body
Section titled “Request body”| Property | Type | Required | Default | Description |
|---|---|---|---|---|
state | string | object | array | number | boolean | Required | — | The content to evaluate (up to 16,384 tokens). Pass a string for a single message or passage, or a JSON object/array for structured application state, tool proposals, and records. Never truncated; states over 16,384 tokens return 422 state_too_long. |
questions | Record<string, Question> | Required | — | Non-empty map of 1 to 128 question IDs you choose to typed ChoiceQuestion, NoulQuestion, or ScoreQuestion objects. Question IDs are returned as keys in answers and are not sent to the model during inference. |
model | string | Optional | "mouse-1" | Model alias ("mouse-1", "mouse"), immutable snapshot ID ("mouse-preview-2026-10-13"), a tuned model id ("mouse-1:ft-acme-7f3a2c"), or a tuned alias ("mouse-1:ft-acme", the newest published tuning with that suffix). See POST /v1/tunings. |
calibration | string | null | Optional | null | Optional signed calibration profile token ("calp1.<kid>.<blob>") returned by POST /v1/calibrations. |
images | string[] | Optional | [] | Up to 8 still images every question sees, as base64 data URLs (data:image/png;base64,...; PNG, JPEG or WebP; animated files are refused). Placed before state in the prompt, in array order; resized to 0.07–1.6 MP (an image under 65,536 pixels is accepted with a warnings entry); billed once per request as usage.image_tokens. EXIF orientation is not applied. See Images. |
store | boolean | Optional | false | Keep this request's state and questions (AES-256-GCM, 30 days) under the response id, so you can post what happened to POST /v1/decisions/{id}/outcome and tune on it. The response then carries stored: { expires_at } and Mouse-Data-Retention: 30d. Text only: refused with images. |
episode | string | Optional | null | Your task or session id (up to 128 characters), kept with a stored decision. A tuning holds out whole episodes, so near-identical decisions from one task never sit on both sides of its held-out check. |
order_invariant | boolean | Optional | false | Score every multi-option choice question a second time with its options reversed and average the two distributions, removing option-order sensitivity. The reversed questions are billed again (their question_tokens and framing_tokens roughly double); the state prefix is shared and billed once. noul and score are never permuted. |
Unknown top-level fields (for example "temperature") are ignored and listed in the response's warnings array, as is every image under 65,536 pixels. Unknown fields inside a question object are refused with 422 invalid_schema.
Accepted aliases
Section titled “Accepted aliases”So that a migration is a base-URL change, the request parser also accepts, and normalizes before validation:
| You send | Read as |
|---|---|
input | state |
questions as an array of objects carrying id or name | questions map keyed by that id/name |
type: "predicate" or type: "boolean" | type: "noul" |
text | instructions |
options: ["a", "b"] | criteria: { "a": null, "b": null } |
choices: [{ value, description }] | criteria: { [value]: description } |
levels: [{ label, description }] | criteria: ["<label>: <description>", ...] |
Aliases change only how the request is read; the response is always the Mouse shape documented below.
Example request (cURL, TypeScript, Python)
Section titled “Example request (cURL, TypeScript, Python)”curl https://api.mouse.dev/v1/decisions \ -H "Authorization: Bearer $MOUSE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "mouse-1", "state": { "task": "Rename exported function `parseToken` to `verifyToken` in src/auth.ts.", "proposed_command": "pnpm --filter @mouse/relay test" }, "questions": { "next_tool": { "type": "choice", "instructions": "Which tool should handle `task` next?", "criteria": { "edit_file": "Modify source code in a file", "grep_search": "Search for symbols across the repository", "run_tests": "Execute the test suite", "ask_user": "Ask the user for clarification" } }, "safe_to_run": { "type": "noul", "instructions": "Is `proposed_command` safe to run without human approval?" }, "blast_radius": { "type": "score", "instructions": "What is the impact of `proposed_command`?", "criteria": [ "Read-only inspection or local test execution", "Reversible local workspace edit", "Irreversible deletion, remote git push, or external mutation" ] } } }'const res = await fetch("https://api.mouse.dev/v1/decisions", { method: "POST", headers: { Authorization: `Bearer ${process.env.MOUSE_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ model: "mouse-1", state: { task: "Rename exported function `parseToken` to `verifyToken` in src/auth.ts.", proposed_command: "pnpm --filter @mouse/relay test", }, questions: { next_tool: { type: "choice", instructions: "Which tool should handle `task` next?", criteria: { edit_file: "Modify source code in a file", grep_search: "Search for symbols across the repository", run_tests: "Execute the test suite", ask_user: "Ask the user for clarification", }, }, safe_to_run: { type: "noul", instructions: "Is `proposed_command` safe to run without human approval?", }, blast_radius: { type: "score", instructions: "What is the impact of `proposed_command`?", criteria: [ "Read-only inspection or local test execution", "Reversible local workspace edit", "Irreversible deletion, remote git push, or external mutation", ], }, }, }),});
const data = await res.json();console.log(data.answers.next_tool.choice, data.answers.safe_to_run.noul);import osimport requests
res = requests.post( "https://api.mouse.dev/v1/decisions", headers={"Authorization": f"Bearer {os.environ['MOUSE_API_KEY']}"}, json={ "model": "mouse-1", "state": { "task": "Rename exported function `parseToken` to `verifyToken` in src/auth.ts.", "proposed_command": "pnpm --filter @mouse/relay test", }, "questions": { "next_tool": { "type": "choice", "instructions": "Which tool should handle `task` next?", "criteria": { "edit_file": "Modify source code in a file", "grep_search": "Search for symbols across the repository", "run_tests": "Execute the test suite", "ask_user": "Ask the user for clarification", }, }, "safe_to_run": { "type": "noul", "instructions": "Is `proposed_command` safe to run without human approval?", }, "blast_radius": { "type": "score", "instructions": "What is the impact of `proposed_command`?", "criteria": [ "Read-only inspection or local test execution", "Reversible local workspace edit", "Irreversible deletion, remote git push, or external mutation", ], }, }, }, timeout=5.0,)print(res.json()["answers"])Question types
Section titled “Question types”A Question is one of three primitives determined by its type field ("choice", "noul", or "score").
All three primitives accept instructions as a string, a structured object, an array, or null. Point a question at a specific nested field inside state (or inside a structured instructions object) using backticks, such as "Does `ticket.messages[0].text` request a refund?".
choice question
Section titled “choice question”Picks one option from a set of 1 to 255 named options and returns the full probability distribution.
| Property | Type | Required | Description |
|---|---|---|---|
type | "choice" | Required | Always "choice". |
criteria | Record<string, string | object | array | null> | Required | Map of option keys to rubric descriptions. Use null when an option key needs no extra detail. Passing an array instead of an object returns 422 invalid_schema. |
instructions | string | object | array | null | Optional | What the model should decide. |
{ "department": { "type": "choice", "instructions": "Which team should handle this ticket?", "criteria": { "billing": "Payments, invoices, duplicate charges, or refunds", "technical": "Bugs, outages, or API integration problems", "sales": "Pricing, upgrades, or new accounts" } }}noul question
Section titled “noul question”Evaluates a yes/no predicate and returns the probability (0.0 to 1.0) that the statement is true (yes).
| Property | Type | Required | Description |
|---|---|---|---|
type | "noul" | Required | Always "noul". |
instructions | string | object | array | null | Optional | The yes/no question or statement to evaluate against state. Phrase positively so a value near 1.0 means yes. |
criteria | { "true"?: JSONContent, "false"?: JSONContent } | null | Optional | Optional descriptions clarifying what "true" (yes, near 1.0) and "false" (no, near 0.0) mean. Only "true" and "false" keys are allowed. |
{ "is_urgent": { "type": "noul", "instructions": "Does this message convey time-sensitive urgency?", "criteria": { "true": "Production outage, blocked customers, or explicit deadline", "false": "Routine question, feature request, or non-blocking issue" } }}score question
Section titled “score question”Rates the state along an ordered rubric of 2 to 10 concrete levels (0 to N - 1).
| Property | Type | Required | Description |
|---|---|---|---|
type | "score" | Required | Always "score". |
criteria | Array<string | object | array> | Required | Ordered array of 2 to 10 level descriptions from lowest (0) to highest (N - 1). Describe concrete situations rather than bare numbers. |
instructions | string | object | array | null | Optional | What dimension the model should rate. |
{ "frustration": { "type": "score", "instructions": "How frustrated does the customer appear?", "criteria": [ "Calm, stating facts", "Frustrated but civil", "Very angry or threatening to leave" ] }}Response body (POST /v1/decisions)
Section titled “Response body (POST /v1/decisions)”| Property | Type | Description |
|---|---|---|
id | string | Unique decision identifier ("dec_..."). |
object | "systemone.response" | Fixed object type string. |
model | string | Exact immutable model snapshot ID that evaluated the request ("mouse-preview-2026-10-13"). Also echoed in the Mouse-Model-Version HTTP header. |
answers | Record<string, Answer> | One typed ChoiceAnswer, NoulAnswer, or ScoreAnswer per question, keyed by the same IDs you passed in questions. |
usage | Usage | Itemized token counts and exact USD cost for the request. |
latency_ms | number | End-to-end server evaluation latency in milliseconds. |
warnings | string[] (optional) | Present only when unknown top-level request fields were ignored. |
Answer types
Section titled “Answer types”Every answer carries a type matching its question, the full probabilities distribution, the raw logits behind it (softmax(logits) == probabilities), and a mouse metadata object ({ calibrated, p_top, abstain, confidence_winning, confidence_normalized }). choice and score answers also carry a top-level confidence (0.0 to 1.0).
Log logits and model together if you fit thresholds or calibrators offline; probabilities alone lose the scale.
choice answer
Section titled “choice answer”| Property | Type | Description |
|---|---|---|
type | "choice" | Always "choice". |
choice | string | The highest-probability option key from criteria. |
probabilities | Record<string, number> | Every option key mapped to its probability (0.0 to 1.0, summing to 1.0). |
logits | Record<string, number> | Every option key mapped to its raw log-score. |
confidence | number | Normalized concentration score in 0.0 to 1.0: ((p_{\max} - 1/k) / (1 - 1/k)) for (k) options (0.0 for an even split, 1.0 when all probability is on one option). |
mouse | MouseAnswerMeta | { calibrated, p_top, abstain, confidence_winning, confidence_normalized }. |
{ "type": "choice", "choice": "edit_file", "confidence": 0.88, "probabilities": { "edit_file": 0.91, "grep_search": 0.06, "run_tests": 0.02, "ask_user": 0.01 }, "logits": { "edit_file": 2.41, "grep_search": -0.31, "run_tests": -1.41, "ask_user": -2.1 }, "mouse": { "calibrated": false, "p_top": 0.91, "abstain": null, "confidence_winning": 0.91, "confidence_normalized": 0.88 }}noul answer
Section titled “noul answer”| Property | Type | Description |
|---|---|---|
type | "noul" | Always "noul". |
noul | number | The yes/no probability on a scale from 0.0 (false / no) to 1.0 (true / yes). A value near 0.5 indicates equal probability for yes and no (certainty is (|2 \cdot \text{noul} - 1|), also returned as mouse.confidence_normalized). |
probabilities | { "false": number, "true": number } | The same distribution in the shape choice uses: { "false": 1 - noul, "true": noul }. |
logits | { "false": number, "true": number } | Raw log-scores for each side. |
mouse | MouseAnswerMeta | { calibrated, p_top, abstain, confidence_winning, confidence_normalized }, where p_top = max(noul, 1 - noul). |
{ "type": "noul", "noul": 0.98, "probabilities": { "false": 0.02, "true": 0.98 }, "logits": { "false": -1.95, "true": 1.94 }, "mouse": { "calibrated": false, "p_top": 0.98, "abstain": null, "confidence_winning": 0.98, "confidence_normalized": 0.96 }}score answer
Section titled “score answer”| Property | Type | Description |
|---|---|---|
type | "score" | Always "score". |
score | number | Probability-weighted mean level index: (\sum_{i=0}^{k-1} i \cdot p_i), landing continuously between 0.0 and k - 1. |
legend | Record<string, JSONContent> | Each string level index ("0", "1", …) mapped back to its description from criteria. |
probabilities | Record<string, number> | Each string level index ("0", "1", …) mapped to its probability (summing to 1.0). |
logits | Record<string, number> | Each string level index mapped to its raw log-score. |
confidence | number | Ordinal concentration score in 0.0 to 1.0: (\max(0, 1 - \sum_i p_i |i - m| / \text{MAD}_{\text{unif}})), where (m) is the most likely level. |
mouse | MouseAnswerMeta | { calibrated, p_top, abstain, confidence_winning, confidence_normalized }. |
{ "type": "score", "score": 0.04, "confidence": 0.94, "legend": { "0": "Read-only inspection or local test execution", "1": "Reversible local workspace edit", "2": "Irreversible deletion, remote git push, or external mutation" }, "probabilities": { "0": 0.96, "1": 0.04, "2": 0.0 }, "logits": { "0": 3.18, "1": 0.0, "2": -6.9 }, "mouse": { "calibrated": false, "p_top": 0.96, "abstain": null, "confidence_winning": 0.96, "confidence_normalized": 0.94 }}MouseAnswerMeta object
Section titled “MouseAnswerMeta object”| Property | Type | Description |
|---|---|---|
calibrated | boolean | true when a calibration profile was passed on the request and matched this question's signature, or when a tuned model answered this question (its temperature is fitted on your held-out examples; abstain stays null without a profile). When true, probabilities (and every field derived from them) are temperature-scaled on your labels. |
p_top | number | Top outcome probability ((\max_i p_i)). |
abstain | boolean | null | null when uncalibrated; true when p_top is below the profile's fitted cutoff (signaling your code to escalate or fall back); false when p_top >= cutoff. |
confidence_winning | number | The winning-probability convention ((\max_i p_i)), as Cloudflare Clef reports confidence. Equal to p_top; named so a Clef threshold ports without arithmetic. |
confidence_normalized | number | The normalized convention ((p_{\max} - 1/k) / (1 - 1/k)), as TypeSafe reports confidence, on every answer type including noul. |
Both conventions are present because the same distribution reads differently under each: (0.80, 0.15, 0.05) is 0.80 winning and 0.70 normalized, so a 0.75 threshold flips depending on which one a vendor calls confidence. Threshold on the convention your labels were fitted against, or on the full probabilities.
Usage object
Section titled “Usage object”| Property | Type | Description |
|---|---|---|
input_tokens | integer | Total billed input tokens: state_tokens + question_tokens + framing_tokens + image_tokens. |
state_tokens | integer | Tokens in state (counted once per request regardless of how many questions are evaluated). |
question_tokens | integer | Tokens across all question instructions and criteria. |
framing_tokens | integer | Structural delimiter tokens: 4 per request + 3 per question + 2 per option (2 options per noul). |
image_tokens | integer | Tokens across all images (0 when the request has none). Counted once per request, like state. See Images. |
output_tokens | integer | Always 0 (output is free). |
cost_usd | number | Exact USD cost for the request (input_tokens * 0.10 / 1_000_000). |
POST /v1/safeguards
Section titled “POST /v1/safeguards”Judge one or more proposed tool calls against plain-English rules. The response uses the safeguard_results format that Claude Code reads in auto mode. See Tool-call safeguards for setup and examples.
POST https://api.mouse.dev/v1/safeguardsAuthorization: Bearer <MOUSE_API_KEY>Content-Type: application/jsonRequest body
Section titled “Request body”| Property | Type | Required | Default | Description |
|---|---|---|---|---|
tool_uses | { id, name, input }[] | Required | — | 1 to 32 tool calls to judge. Ids must be unique. |
messages | Message[] | Optional | [] | The conversation in Anthropic Messages format. Only user text and earlier tool_use blocks are read. |
rules | RuleSet | Optional | Default rules | Replaces the default rules. Needs at least one hard_deny or soft_deny rule. |
mode | "enforce" | "audit" | Optional | "enforce" | In audit, every call returns not_flagged and mouse.tool_uses[id].would_flag holds the real result. |
timeout_ms | integer | Optional | 10000 | Time budget for the whole request, 200 to 30000. Calls not judged in time return unavailable. |
model | string | Optional | "mouse-1" | Model alias or snapshot ID. |
RuleSet has four optional lists: environment (up to 50 strings, 2,000 characters each), hard_deny, soft_deny and allow (up to 100 rules each). A rule is a string or an object:
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Required | Letters, digits, _, . and -, up to 64 characters. Unique across all tiers. none and user_boundary are reserved. A string rule gets the id <tier>_<index>. |
instructions | string | Required | What a matching call does, up to 8,000 characters. |
name | string | Optional | Short label shown in explanation. |
threshold | number | Optional | Probability at which the rule matches. Default 0.6 for deny tiers and 0.7 for allow. |
Response body (POST /v1/safeguards)
Section titled “Response body (POST /v1/safeguards)”| Property | Type | Description |
|---|---|---|
id | string | Unique identifier ("sg_..."). |
object | "safeguards.response" | Fixed object type string. |
model | string | Model snapshot ID that judged the request. |
safeguard_results | SafeguardResult[] | One dangerous_tool_use entry. status.tool_uses maps each tool call id to { "type": "evaluated", "outcome": "flagged" | "not_flagged", "explanation"? } or { "type": "unavailable", "reason": "timeout" | "truncated" | "error" }. Return it to Claude Code unchanged. |
mouse | object | mode, rules ("default" or "request"), and tool_uses: per call, the deciding tier (decision), the deciding rule, would_flag, the probability of each deny rule (deny), of explicit user intent (explicit_intent) and of each allow rule (allow), truncated, latency_ms, and unavailable. |
usage | Usage | Tokens and cost for the passes that ran. Calls that returned unavailable are not billed. |
latency_ms | number | Server latency in milliseconds. |
warnings | string[] (optional) | Unknown top-level request fields that were ignored. |
POST /v1/calibrations
Section titled “POST /v1/calibrations”Score 200 to 400 labeled examples and fit a signed confidence cutoff profile (calp1.<kid>.<blob>) using 5-fold out-of-fold cross-fitting. Examples are evaluated in memory and discarded immediately (Mouse-Data-Retention: none).
POST https://api.mouse.dev/v1/calibrationsAuthorization: Bearer <MOUSE_API_KEY>Content-Type: application/jsonRequest body
Section titled “Request body”| Property | Type | Required | Default | Description |
|---|---|---|---|---|
examples | CalExample[] | Required | — | Array of 200 to 400 labeled examples. Each distinct question signature requires 50+ labeled examples to be fitted. |
model | string | Optional | "mouse-1" | Model alias or snapshot ID. The returned profile is cryptographically bound to the resolved snapshot ID. |
target_error | number | Optional | 0.05 | Maximum acceptable error rate (0.0 < target_error < 0.5) among non-abstained predictions. |
Each item in examples contains state and questions, where each question includes its ground-truth label:
- Labeled
choice(CalChoice):labelis astringmatching one of the option keys incriteria. - Labeled
noul(CalNoul):labelis aboolean(trueorfalse). - Labeled
score(CalScore):labelis anintegerlevel index in0 .. len(criteria) - 1.
curl https://api.mouse.dev/v1/calibrations \ -H "Authorization: Bearer $MOUSE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "mouse-1", "target_error": 0.05, "examples": [ { "state": "Customer was charged twice for order #1042.", "questions": { "intent": { "type": "choice", "instructions": "What does the customer need?", "criteria": { "billing": "A charge, invoice, or refund issue", "shipping": "Delivery status or tracking", "account": "Login or profile settings" }, "label": "billing" } } } ] }'Response body (POST /v1/calibrations)
Section titled “Response body (POST /v1/calibrations)”| Property | Type | Description |
|---|---|---|
object | "calibration" | Fixed object type string. |
model | string | Immutable snapshot ID this profile was fitted against ("mouse-preview-2026-10-13"). |
target_error | number | Target error rate used to select the abstention cutoff. |
profile | string | HMAC-SHA256 signed profile token ("calp1.<kid>.<blob>"). Pass as calibration on POST /v1/decisions. |
n_examples | integer | Total labeled examples processed. |
questions | CalibrationQuestionReport[] | Per-question-signature report (signature, type, question_ids, status, before, and after metrics including the fitted temperature, cutoff, and 5-fold out-of-fold coverage_at_target_error and error_when_covered). |
note | string | Out-of-fold methodology and zero-data-retention note. |
usage | Usage | Itemized token counts and USD cost for scoring the calibration examples. |
{ "object": "calibration", "model": "mouse-preview-2026-10-13", "target_error": 0.05, "profile": "calp1.k1.eyJmaXRzIjpb...", "n_examples": 250, "questions": [ { "signature": "4f8c12a90e3b7104", "type": "choice", "question_ids": ["intent"], "status": "fitted", "before": { "accuracy": 0.912, "ece": 0.031, "brier": 0.142, "nll": 0.264, "mean_confidence": 0.938, "coverage": 1.0, "cutoff": null, "n": 250 }, "after": { "accuracy": 0.912, "ece": 0.031, "brier": 0.142, "nll": 0.264, "mean_confidence": 0.938, "coverage": 0.864, "cutoff": 0.78, "n": 250, "coverage_at_target_error": 0.856, "error_when_covered": 0.0421 } } ], "note": "'coverage_at_target_error' and 'error_when_covered' are 5-fold out-of-fold. Examples were not stored.", "usage": { "input_tokens": 14500, "state_tokens": 3500, "question_tokens": 7750, "framing_tokens": 3250, "image_tokens": 0, "output_tokens": 0, "cost_usd": 0.00145 }}POST /v1/tunings
Section titled “POST /v1/tunings”Train a tenant model on your stored, labelled decisions or on a file of labelled examples, and get back a model id you can send as model on POST /v1/decisions. Posted examples are the job's input and are never stored. The job's output is a model scoped to your account, plus a report. Plain-words walkthrough: Tuning on your outcomes.
POST https://api.mouse.dev/v1/tuningsAuthorization: Bearer <MOUSE_API_KEY>Content-Type: application/jsonRequest body
Section titled “Request body”| Property | Type | Required | Default | Description |
|---|---|---|---|---|
outcomes | { question_ids?, since? } | One of outcomes / examples | — | Train on your stored decisions that have outcomes (store: true plus POST /v1/decisions/{id}/outcome), newest first: up to 5,000 for readout, 20,000 for LoRA. question_ids trains only those questions; since (ISO 8601) skips older decisions. {} uses everything labelled. |
examples | CalExample[] | One of outcomes / examples | — | Labeled examples, the same shape as POST /v1/calibrations: state, questions, a label on every question, and an optional episode. 200 to 5,000 for readout, 1,000 to 20,000 for LoRA; at most 30,000,000 example tokens per job. |
model | string | Optional | "mouse-1" | The base to tune. Only "mouse-1" (or its current snapshot) is accepted. |
method | "readout" | "lora" | Optional | readout up to 5,000 examples, lora above | readout refits the decision layer and serves at the base model's latency. lora fits the readout first, then trains a low-rank adapter on top and keeps it only if it beats the readout tune on the held-out fold; it serves on the slower eager path (roughly 110–130 ms). |
suffix | string | Optional | "model" | 1 to 24 lowercase letters, digits, or hyphens. Becomes part of the model id (mouse-1:ft-<suffix>-<6 hex>) and the alias (mouse-1:ft-<suffix>). |
baseline | string | Optional | null | A ready tuning of yours (tune_..., its model id, or its alias). The new model is published only if it beats this one on the new held-out fold, and the alias moves only then. |
dry_run | boolean | Optional | false | Return a quote instead of starting the job. Nothing is billed. |
Quote response (200, dry_run: true)
Section titled “Quote response (200, dry_run: true)”| Property | Type | Description |
|---|---|---|
method | string | The method that would run. |
examples | integer | Examples accepted. |
training_tokens | integer | Tokens of the training fold (80% of the examples), times 2 epochs for LoRA. |
gpu_seconds_est, gpu_usd_est | number | Estimated GPU time and its cost at our H100 rate. The job bills actual seconds. |
fee_usd | number | The Mouse fee: $10 per readout job, or $10 per 1M training tokens ($25 minimum) for LoRA. |
total_usd | number | gpu_usd_est + fee_usd. |
questions | Array<{ signature, type, count, question_ids, warning? }> | Per question signature (with your question ids for it), how many labeled examples you sent, with a warning under 50, where the signature is trained and evaluated but gets no calibrated temperature of its own. |
Tuning response (202, and every GET)
Section titled “Tuning response (202, and every GET)”| Property | Type | Description |
|---|---|---|
id | string | "tune_...". |
model | string | The tuned model id, "mouse-1:ft-<suffix>-<6 hex>". Immutable. |
status | string | queued, running, ready, rejected, failed, suspended (hosting paused for lack of credits), or deleted. |
method | string | readout or lora. A lora job that kept its readout tune shows readout once finished. |
report | TuningReport | null | Filled in when the job finishes. |
examples, training_tokens | integer | As quoted. |
gpu_seconds_est, gpu_seconds | integer | null | Estimated, then measured on the job (the GPU line settles to the measured seconds). |
cost | { fee_usd, gpu_usd_est } | The fee and the GPU estimate debited at acceptance. |
baseline | string | null | The tuning this one had to beat. |
created_at, finished_at | string | null | ISO 8601. |
A TuningReport is { method, published, reasons, questions, canary, baseline, fit }: questions maps each signature to { type, keys, question_ids, n_train, n_holdout, before: { accuracy, ece, nll, brier }, after: { ... }, temperature, passed }, measured on the held-out 20%; canary is { passed, failed: [...], injection, order }: how often answers on your held-out examples flipped under a planted instruction or reversed options, mouse-1 (before) vs the tuned model (after); reasons explains a published: false in plain words; fit.escalation (LoRA jobs) compares the readout tune and the LoRA and names the one kept. The report contains metrics, question ids and signatures only, never example text.
{ "id": "tune_01j9x3k8m2v7", "object": "tuning", "model": "mouse-1:ft-acme-7f3a2c", "status": "running", "method": "readout", "examples": 1840, "training_tokens": 412000, "gpu_seconds_est": 516, "gpu_seconds": null, "cost": { "fee_usd": 10.0, "gpu_usd_est": 0.57 }, "baseline": null, "created_at": "2026-10-19T14:02:11Z", "finished_at": null, "report": null}A rejected job is billed (the report is the deliverable); a failed job is refunded. One job runs per account at a time (409 tune_in_progress).
GET /v1/tunings
Section titled “GET /v1/tunings”curl https://api.mouse.dev/v1/tunings -H "Authorization: Bearer $MOUSE_API_KEY"{ "object": "list", "data": [ { "id": "tune_01j9x3k8m2v7", "model": "mouse-1:ft-acme-7f3a2c", "status": "ready", "...": "..." } ] }GET /v1/tunings/{id}
Section titled “GET /v1/tunings/{id}”One tuning, with report once the job has finished. Returns 404 tuning_not_found for an id that is not yours or was deleted.
DELETE /v1/tunings/{id}
Section titled “DELETE /v1/tunings/{id}”Removes the adapter, stops hosting, and sets status to deleted. Requests that name the model id afterwards return 404 model_not_found; an alias whose newest ready tuning was deleted falls back to the next newest, or 404 if none remains. Posted examples were never stored. Stored decisions are separate: delete them with DELETE /v1/outcomes.
Tuned model ids and aliases
Section titled “Tuned model ids and aliases”| You send | Resolves to |
|---|---|
mouse-1:ft-acme-7f3a2c | Exactly that tuning. Immutable. |
mouse-1:ft-acme | The newest ready tuning on your account with suffix acme. Moves when a later job with suffix: "acme" publishes. |
Both forms are accepted everywhere model is: POST /v1/decisions and POST /v1/calibrations. The response's model field and the Mouse-Model-Version header always carry the full tuned id. Tuned ids are visible only to the account that created them; another account's id returns 404 model_not_found.
POST /v1/decisions/{id}/outcome
Section titled “POST /v1/decisions/{id}/outcome”Record what actually happened for a decision sent with store: true. id is the response's id (dec_...).
curl https://api.mouse.dev/v1/decisions/dec_4f1a.../outcome \ -H "Authorization: Bearer $MOUSE_API_KEY" -H "Content-Type: application/json" \ -d '{"labels": {"safe_to_run": true, "next_tool": "run"}}'| Property | Type | Description |
|---|---|---|
labels | Record<string, boolean | string | integer> | Per question id: true/false for noul, an option key for choice, a level index for score. Any subset of the decision's questions. Posting again merges, so a later label replaces an earlier one for that question. |
Returns { id, object: "outcome", labels } with every label recorded so far. 404 decision_not_found when the decision was not stored, has expired (30 days) or was deleted, or belongs to another account; 422 invalid_label when a label does not fit its question. Free.
GET /v1/outcomes
Section titled “GET /v1/outcomes”Counts for your stored decisions, never their contents.
{ "object": "outcomes.summary", "stored": 4210, "labelled": 1873, "retention_days": 30, "questions": [ { "signature": "9c1e4b2f7a03d851", "type": "noul", "question_ids": ["safe_to_run"], "stored": 4210, "labelled": 1873 } ]}DELETE /v1/outcomes
Section titled “DELETE /v1/outcomes”Deletes every stored decision and label on your account at once: { "object": "outcomes", "deleted": 4210 }. Tuned models already trained on them are not affected; delete those with DELETE /v1/tunings/{id}.
GET /v1/models
Section titled “GET /v1/models”List active immutable model versions, alias mappings (mouse-1, mouse), and the tuned models on your account.
curl https://api.mouse.dev/v1/models \ -H "Authorization: Bearer $MOUSE_API_KEY"{ "object": "list", "alias": { "mouse-1": "mouse-preview-2026-10-13", "mouse": "mouse-preview-2026-10-13" }, "data": [ { "id": "mouse-preview-2026-10-13", "released": "2026-10-13", "status": "preview", "base": "mouse-1", "max_state_tokens": 16384, "modalities": ["text", "image"], "retire_after": null } ], "today": "2026-10-14"}GET /healthz
Section titled “GET /healthz”Unauthenticated liveness probe returning serving region and engine status.
curl https://api.mouse.dev/healthz{ "ok": true, "region": "us", "engine": "modal"}Response headers
Section titled “Response headers”Every response from https://api.mouse.dev includes these HTTP headers:
| Header | Example | Description |
|---|---|---|
Mouse-Request-Id | req_8f92a1c04e1b902d73c104ab | Unique request identifier (req_ + 24 hex chars). |
Mouse-Model-Version | mouse-preview-2026-10-13 | Exact immutable snapshot ID that scored the request (POST /v1/decisions, POST /v1/safeguards, and POST /v1/calibrations), or the full tuned id (mouse-1:ft-acme-7f3a2c) when the request named a tuned model or alias. |
Mouse-Region | us | Serving region (us). |
Mouse-Data-Retention | none | Enforced zero data retention on every response. |
Cache-Control | no-store | Prevents intermediary caching. |
x-ratelimit-limit-requests | 10 | Sustained requests-per-second limit (10 standard, 5 playground). |
x-ratelimit-remaining-requests | 19 | Remaining requests in the burst bucket (20 capacity). |
x-ratelimit-reset-requests | 1 | Seconds until the request bucket resets (1). |
x-ratelimit-limit-tokens | 1000000 | Input-tokens-per-minute limit (1,000,000). |
x-ratelimit-remaining-tokens | 999926 | Remaining input tokens in the 60-second bucket. |
x-ratelimit-reset-tokens | 60 | Seconds until the token bucket resets (60). |
Retry-After | 2 | Present on 429 and 503 responses; integer seconds to wait before retrying. |
Errors
Section titled “Errors”All non-2xx responses use a single JSON error envelope. Messages name the limit or offending field and never echo request content:
{ "error": { "type": "invalid_request_error", "code": "state_too_long", "message": "state is 18,204 tokens; mouse-preview-2026-10-13 reads at most 16,384. Nothing was truncated or billed.", "param": "state" }}| Status | error.type | error.code | Meaning |
|---|---|---|---|
400 | invalid_request_error | invalid_calibration_profile | Malformed, altered, or retired calibration profile token. |
401 | authentication_error | missing_api_key, invalid_api_key | Missing Authorization: Bearer sk_mouse_... header, bad CRC32 checksum, or revoked/expired key. |
402 | billing_error | insufficient_credits | Prepaid credit balance is $0.00. Add credits at /console/billing. |
404 | invalid_request_error | model_not_found | Unknown model name, or a tuned model id or alias that is not on this account or was deleted. See GET /v1/models. |
409 | invalid_request_error | profile_model_mismatch | calibration profile was fitted on a different model snapshot than the one serving the request. |
409 | invalid_request_error | tune_in_progress | A tuning job is already queued or running on this account. Wait for it or delete it. |
413 | invalid_request_error | request_too_large | Request body exceeds 4,000,000 bytes (4 MB). |
422 | invalid_request_error | invalid_schema, state_too_long, question_too_long, too_much_work, too_many_questions, too_many_options, too_few_examples, too_many_examples, too_few_examples_per_question, invalid_label, too_many_stored | Request failed schema validation or exceeded a published payload limit. On POST /v1/tunings, too_few_examples / too_many_examples mean the count is outside the method's range (readout 200 to 5,000, LoRA 1,000 to 20,000), and too_much_work means over 30M example tokens, a LoRA over 8M training tokens, or the $250 job cap. invalid_label means a label on /v1/decisions/{id}/outcome does not fit its question; too_many_stored means 100,000 unexpired stored decisions. Never billed. |
429 | rate_limit_error | rate_limited, token_rate_limited, work_rate_limited, auth_rate_limited | Exceeded 10 RPS (burst 20), 1M TPM, the account's 300k work tokens per minute, or too many invalid keys from one client. Honor the Retry-After header. |
503 | api_error | engine_timeout | Inference worker timed out (30s), usually while the model starts after an idle period. Honor the Retry-After header. |