Rate limits
Every standard API key receives the same published payload and throughput limits. Nothing is silently truncated: any request exceeding a payload limit is refused before GPU execution with 422 Unprocessable Entity (or 413 Content Too Large) and is never billed.
Request and payload limits
Section titled “Request and payload limits”| Parameter | Limit | Error code when exceeded |
|---|---|---|
state length | 16,384 tokens | 422 state_too_long |
questions per request | 128 questions | 422 too_many_questions |
One question with the state (instructions, options, framing) | 18,432 tokens | 422 question_too_long |
state tokens × questions | 64,000 (e.g. a 3,500-token state with 16 questions, or 400 tokens with 128; question and option text count too) | 422 too_much_work |
Options per choice question | 255 options | 422 too_many_options |
images per request | 8 still images (PNG, JPEG or WebP as base64 data URLs) | 422 too_many_images / 422 invalid_image |
| One image | 16,000,000 pixels, aspect ratio at most 200:1; resized to 0.07–1.6 MP before the model reads it | 422 invalid_image |
Levels per score question | 2 to 10 levels | 422 invalid_schema |
| HTTP request body size | 4,000,000 bytes (4 MB), after decompression, base64 images included | 413 request_too_large |
Calibration examples per call | 200 to 400 examples | 422 too_few_examples / too_many_examples |
| Labeled examples per question signature | ≥ 50 examples | Skipped in report (or 422 too_few_examples_per_question if none qualify) |
| Engine execution timeout | 30 seconds | 503 engine_timeout |
mouse-1 reads the whole state and every image once for each question, so the work in a request is (state tokens + image tokens) × questions (plus one more pass per multi-option choice question with order_invariant). You are billed for the state once; the cap keeps any single request from holding the GPU.
After an idle period the model takes a few minutes to start. Requests during that window return 503 engine_timeout with Retry-After; retry and they succeed once it is up.
Throughput rate limits
Section titled “Throughput rate limits”Throughput is enforced per API key using two shared Redis token buckets: a requests-per-second (RPS) bucket with a 2× burst capacity, and an input-tokens-per-minute (TPM) bucket.
| Key kind | Requests per second | Request burst | Input tokens per minute |
|---|---|---|---|
Standard key (sk_mouse_...) | 10 RPS | 20 requests | 1,000,000 TPM |
| Console Playground key (1h TTL) | 5 RPS | 20 requests | 1,000,000 TPM |
Each account also has a model-work budget of 300,000 tokens per minute, counted as state tokens × questions across all of its keys. Over it, requests return 429 work_rate_limited with Retry-After.
Need higher sustained RPS or TPM for a batch workload or gateway integration? Contact sales@mouse.dev with your key prefix (sk_mouse_xxxx…) to provision reserved RPS/TPM capacity on a committed-throughput purchase order at the same $0.10 / 1M input token rate—no enterprise markup.
Tuning limits
Section titled “Tuning limits”POST /v1/tunings checks every example against the payload limits above, then the job as a whole:
| Parameter | Limit | Error code when exceeded |
|---|---|---|
Examples per readout job | 200 to 5,000 | 422 too_few_examples / too_many_examples |
Examples per lora job | 1,000 to 20,000 | 422 too_few_examples / too_many_examples |
Training tokens per lora job (both epochs) | 8,000,000 | 422 too_much_work |
| Example tokens per job | 30,000,000 | 422 too_much_work |
| Cost per job (fee plus estimated GPU) | $250 | 422 too_much_work |
| Jobs in flight per account | 1 (queued or running) | 409 tune_in_progress |
| Labeled examples per question signature | ≥ 50 to be fitted and gated on its own | Flagged with warning in the quote; evaluated but not fitted |
suffix | 1 to 24 of [a-z0-9-] | 422 invalid_schema |
| Stored decisions per account (unexpired) | 100,000 | 422 too_many_stored |
| Stored decision retention | 30 days | Deleted automatically; 404 decision_not_found after |
episode | Up to 128 characters | 422 invalid_schema |
A quote (dry_run: true) runs the same checks and is never billed. Requests to a tuned model count against the same key and account limits as mouse-1.
Rate limit headers
Section titled “Rate limit headers”Every authenticated response includes rate-limit state headers:
| Header | Description | Example |
|---|---|---|
x-ratelimit-limit-requests | Sustained requests-per-second limit for this key. | 10 |
x-ratelimit-remaining-requests | Remaining requests available in the burst bucket right now. | 19 |
x-ratelimit-reset-requests | Window reset interval in seconds (1). | 1 |
x-ratelimit-limit-tokens | Input tokens-per-minute capacity for this key. | 1000000 |
x-ratelimit-remaining-tokens | Remaining input tokens available in the 60-second bucket. | 999926 |
x-ratelimit-reset-tokens | Window reset interval in seconds (60). | 60 |
Retry-After | Included on every 429 and on 503 (engine_timeout) responses. Integer seconds to wait: until enough bucket capacity refills, or 60 for auth_rate_limited. | 1 |