List jobs
Moth DocsReference
GEThttps://api.runmoth.si/v1
/jobsLists your media jobs newest first, for as long as Moth keeps them.
curl https://api.runmoth.si/v1/jobs?limit=20 \
-H "Authorization: Bearer $MOTH_API_KEY"Response
{
"object": "list",
"data": [
{
"id": "job_7Hc2pW9kLm4Qx8Rt1Vz3",
"object": "job",
"model": "nano-banana-2",
"modality": "image",
"status": "succeeded",
"created_at": 1793347200,
"completed_at": 1793347214,
"unit": "image",
"units": 1,
"held_usd": "0.047059",
"charged_usd": "0.047059",
"progress": 1,
"outputs": [
{
"index": 0,
"url": "/v1/jobs/job_7Hc2pW9kLm4Qx8Rt1Vz3/output/0",
"content_type": "image/png"
}
]
}
],
"has_more": false
}Query
limitintegerFrom 1 to 100, and 20 by default.
statusstringOnly jobs with this status, queued, running, succeeded or failed.
beforestringThe ID of the last job on a page, to list the jobs made before it.
Each job is the same object Read a job returns, and has_more says whether an older page follows. A job leaves the list 24 hours after it ends, when Moth forgets it. A running job's progress here is the one from Moth's last check, which can be 15 seconds old, while reading the job itself checks it fresh.
Errors
400invalid_request_errorlimit, status or before isn't valid, or before names no job of yours401authentication_errorThe key is missing, revoked or expired429rate_limit_errorToo many reads from the key, so wait for retry-after