error field, and often a message for humans:
Status codes
A render that fails during execution (bad Manim code, runtime error) still returns
200 from GET /api/v2/render/{jobId} — the failure surfaces as status: "failed" with error populated. HTTP 5xx is reserved for Kodisc-side problems, not your scene’s.
The credit model
Credits are the unit Kodisc bills against. Each render consumes credits proportional to its wall-clock render time and quality preset. The lifecycle of credits during a render:1
Reserve
On
POST /api/v2/render, Kodisc reserves a minimum amount of credits up-front. If your balance is below the reserve, the call fails with 402 immediately — no job is created.2
Settle
When the render finishes, Kodisc computes the actual cost from
durationMs and quality. If the actual cost exceeds the reserve, the difference is charged. If you don’t have enough to cover it, the job is marked failed and the reserve is refunded.3
Refund
If the actual cost is below the reserve, the difference is automatically returned to your balance. Failed jobs refund the full reserve.
GET /api/v2/me — the response splits paid (purchased credits) from free (your plan’s monthly allowance).
Common 400 messages
Retry strategy
400and401are client errors — retrying without changes won’t help.402clears as soon as your balance increases; retry after topping up or after the next free-credit refresh.404is permanent for the givenjobId.5xxand network errors are safe to retry; use exponential backoff (e.g. 1s → 2s → 4s, up to 5 attempts).