moth docs
Reference Read a job

Read a job

Returns a job's status and, once it has succeeded, the addresses of its files.

GEThttps://api.runmoth.si/v1/jobs/{id}

Status

status is queued, running, succeeded or failed, and progress runs from 0 to 1. A failed job says so in error and was charged nothing.

Files

Each output's url is a path on https://api.runmoth.si. Fetch it with the same key to get the file itself, with its own content type. A song's cover image is at the same path followed by /cover. Downloads cost nothing but count as calls against the rate limit.

Errors

404not_found_errorNo such job on this account, or it ended more than 24 hours ago
401authentication_errorThe key is missing, revoked or expired
429rate_limit_errorToo many reads from the key, so wait for retry-after
curl https://api.runmoth.si/v1/jobs/{id} \
  -H "Authorization: Bearer $MOTH_API_KEY"
Response
{
  "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"
    }
  ]
}