{"openapi":"3.1.0","info":{"title":"mazi API","version":"1.0.0","description":"Generate AI videos and images with your mazi credits (1 mazi credit = 0.01 USD). One job endpoint for every model; models, fields, and your prices in mazi credits come from GET /v1/models. Guides: https://joinmazi.ai/docs","contact":{"name":"mazi","url":"https://joinmazi.ai","email":"hello@joinmazi.ai"},"termsOfService":"https://joinmazi.ai/en/terms"},"servers":[{"url":"https://api.joinmazi.ai/v1","description":"Production"},{"url":"https://joinmazi.ai/app/api/v1","description":"Production (same API under the main domain)"}],"security":[{"apiKey":[]}],"tags":[{"name":"Models","description":"Available models, their inputs, and prices in mazi credits."},{"name":"Jobs","description":"Start generations and get their results."},{"name":"Media","description":"Upload input images for media fields."},{"name":"Account","description":"Your mazi credit balance."}],"paths":{"/models":{"get":{"tags":["Models"],"operationId":"listModels","summary":"List models","description":"All models you can generate with, including modes, input fields, limits, and prices in mazi credits.","responses":{"200":{"description":"Models","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"Missing or invalid API key. Send it as \"Authorization: Bearer mz_live_...\"."}}}}}}}},"/models/{model_id}":{"get":{"tags":["Models"],"operationId":"getModel","summary":"Get a model","parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","enum":["seedance-2.5","nano-banana-2.1","gpt-image-2.5-flare","gpt-image-2.5-sunburst"]}}],"responses":{"200":{"description":"Model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"404":{"description":"Unknown model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unknown_model","message":"No model with this id is available. See GET /v1/models."}}}}}}}},"/estimates":{"post":{"tags":["Jobs"],"operationId":"createEstimate","summary":"Estimate a price","description":"Price of a generation in mazi credits, without starting it. Takes the same model and input as POST /jobs; media fields and the prompt may be left out.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string"},"input":{"type":"object"}}},"examples":{"seedance-2.5":{"summary":"Seedance 2.5","value":{"model":"seedance-2.5","input":{"mode":"text","prompt":"A slow dolly shot of a ceramic coffee cup on a sunlit kitchen counter, steam rising","resolution":"720p","aspectRatio":"9:16","duration":5,"audio":true,"numberResults":1}}},"nano-banana-2.1":{"summary":"Nano Banana 2.1","value":{"model":"nano-banana-2.1","input":{"mode":"text","prompt":"Product photo of a ceramic coffee cup on a sunlit kitchen counter, soft shadows","resolution":"1K","aspectRatio":"1:1"}}},"gpt-image-2.5-flare":{"summary":"GPT Image 2.5 Flare","value":{"model":"gpt-image-2.5-flare","input":{"mode":"text","prompt":"Product photo of a ceramic coffee cup on a sunlit kitchen counter, soft shadows","resolution":"1K","aspectRatio":"auto"}}},"gpt-image-2.5-sunburst":{"summary":"GPT Image 2.5 Sunburst","value":{"model":"gpt-image-2.5-sunburst","input":{"mode":"text","prompt":"Product photo of a ceramic coffee cup on a sunlit kitchen counter, soft shadows","resolution":"1K","aspectRatio":"auto"}}}}}}},"responses":{"200":{"description":"Estimate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Estimate"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"The input does not match the model. See details and GET /v1/models/{model_id}."}}}}},"404":{"description":"Unknown model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unknown_model","message":"No model with this id is available. See GET /v1/models."}}}}}}}},"/jobs":{"post":{"tags":["Jobs"],"operationId":"createJob","summary":"Create a job","description":"Starts a generation. The price is reserved from your mazi credits right away, charged when the job succeeds, and refunded if it fails. Returns immediately (status queued) unless you set wait_seconds. Send an Idempotency-Key header so a retried request never starts a second job.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":255},"description":"Unique key per job, for example a UUID. Repeating a request with the same key returns the original job (200, header Idempotent-Replayed: true)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"title":"Seedance 2.5","description":"ByteDance, video.","x-mazi-category":"video","x-mazi-maker":"ByteDance","x-mazi-billing-unit":"second","type":"object","required":["model","input"],"properties":{"model":{"type":"string","const":"seedance-2.5"},"input":{"oneOf":[{"title":"seedance-2.5: text","type":"object","additionalProperties":false,"required":["mode","prompt"],"properties":{"mode":{"type":"string","const":"text"},"prompt":{"type":"string","minLength":2,"maxLength":50000,"description":"Text prompt."},"resolution":{"type":"string","enum":["480p","720p","1080p"],"default":"720p"},"aspectRatio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4","21:9"],"default":"9:16"},"duration":{"type":"integer","minimum":4,"maximum":30,"default":5},"audio":{"type":"boolean","default":true},"numberResults":{"type":"integer","minimum":1,"maximum":4,"default":1}}},{"title":"seedance-2.5: first-frame","type":"object","additionalProperties":false,"required":["mode","firstFrame"],"properties":{"mode":{"type":"string","const":"first-frame"},"firstFrame":{"type":"string","format":"uuid","description":"Media id from POST /v1/media (field \"firstFrame\"). Accepts jpeg, png, webp, up to 30 MB, 300 to 6000 px per side."},"prompt":{"type":"string","minLength":2,"maxLength":50000,"description":"Text prompt."},"resolution":{"type":"string","enum":["480p","720p","1080p"],"default":"720p"},"duration":{"type":"integer","minimum":4,"maximum":30,"default":5},"audio":{"type":"boolean","default":true},"numberResults":{"type":"integer","minimum":1,"maximum":4,"default":1}}},{"title":"seedance-2.5: first-last-frames","type":"object","additionalProperties":false,"required":["mode","firstFrame","lastFrame"],"properties":{"mode":{"type":"string","const":"first-last-frames"},"firstFrame":{"type":"string","format":"uuid","description":"Media id from POST /v1/media (field \"firstFrame\"). Accepts jpeg, png, webp, up to 30 MB, 300 to 6000 px per side."},"lastFrame":{"type":"string","format":"uuid","description":"Media id from POST /v1/media (field \"lastFrame\"). Accepts jpeg, png, webp, up to 30 MB, 300 to 6000 px per side."},"prompt":{"type":"string","minLength":2,"maxLength":50000,"description":"Text prompt."},"resolution":{"type":"string","enum":["480p","720p","1080p"],"default":"720p"},"duration":{"type":"integer","minimum":4,"maximum":30,"default":5},"audio":{"type":"boolean","default":true},"numberResults":{"type":"integer","minimum":1,"maximum":4,"default":1}}},{"title":"seedance-2.5: reference-images","type":"object","additionalProperties":false,"required":["mode","referenceImages","prompt"],"properties":{"mode":{"type":"string","const":"reference-images"},"referenceImages":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":30,"description":"Media id from POST /v1/media (field \"referenceImages\"). Accepts jpeg, png, webp, up to 30 MB, 300 to 6000 px per side. Reference uploads in the prompt as @Image1, @Image2, and so on."},"prompt":{"type":"string","minLength":2,"maxLength":50000,"description":"Text prompt."},"resolution":{"type":"string","enum":["480p","720p","1080p"],"default":"720p"},"aspectRatio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4","21:9"],"default":"9:16"},"duration":{"type":"integer","minimum":4,"maximum":30,"default":5},"audio":{"type":"boolean","default":true},"numberResults":{"type":"integer","minimum":1,"maximum":4,"default":1}}}],"discriminator":{"propertyName":"mode"}},"webhook_url":{"$ref":"#/components/schemas/WebhookUrl"},"wait_seconds":{"$ref":"#/components/schemas/WaitSeconds"}}},{"title":"Nano Banana 2.1","description":"Google, image.","x-mazi-category":"image","x-mazi-maker":"Google","x-mazi-billing-unit":"image","type":"object","required":["model","input"],"properties":{"model":{"type":"string","const":"nano-banana-2.1"},"input":{"oneOf":[{"title":"nano-banana-2.1: text","type":"object","additionalProperties":false,"required":["mode","prompt"],"properties":{"mode":{"type":"string","const":"text"},"prompt":{"type":"string","minLength":2,"maxLength":20000,"description":"Text prompt."},"resolution":{"type":"string","enum":["1K","2K","4K"],"default":"1K"},"aspectRatio":{"type":"string","enum":["auto","1:1","4:5","5:4","3:4","4:3","9:16","16:9","2:3","3:2","21:9"],"default":"1:1"}}},{"title":"nano-banana-2.1: reference-images","type":"object","additionalProperties":false,"required":["mode","referenceImages","prompt"],"properties":{"mode":{"type":"string","const":"reference-images"},"referenceImages":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":10,"description":"Media id from POST /v1/media (field \"referenceImages\"). Accepts jpeg, png, webp, up to 30 MB, 64 to 8192 px per side."},"prompt":{"type":"string","minLength":2,"maxLength":20000,"description":"Text prompt."},"resolution":{"type":"string","enum":["1K","2K","4K"],"default":"1K"},"aspectRatio":{"type":"string","enum":["auto","1:1","4:5","5:4","3:4","4:3","9:16","16:9","2:3","3:2","21:9"],"default":"1:1"}}}],"discriminator":{"propertyName":"mode"}},"webhook_url":{"$ref":"#/components/schemas/WebhookUrl"},"wait_seconds":{"$ref":"#/components/schemas/WaitSeconds"}}},{"title":"GPT Image 2.5 Flare","description":"OpenAI, image.","x-mazi-category":"image","x-mazi-maker":"OpenAI","x-mazi-billing-unit":"image","type":"object","required":["model","input"],"properties":{"model":{"type":"string","const":"gpt-image-2.5-flare"},"input":{"oneOf":[{"title":"gpt-image-2.5-flare: text","type":"object","additionalProperties":false,"required":["mode","prompt"],"properties":{"mode":{"type":"string","const":"text"},"prompt":{"type":"string","minLength":2,"maxLength":32000,"description":"Text prompt."},"resolution":{"type":"string","enum":["1K","2K","4K"],"default":"1K"},"aspectRatio":{"type":"string","enum":["auto","1:1","3:2","2:3","16:9","9:16","4:3","3:4","21:9","27:16","16:27","9:8","8:9"],"default":"auto"}}},{"title":"gpt-image-2.5-flare: reference-images","type":"object","additionalProperties":false,"required":["mode","referenceImages","prompt"],"properties":{"mode":{"type":"string","const":"reference-images"},"referenceImages":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":16,"description":"Media id from POST /v1/media (field \"referenceImages\"). Accepts jpeg, png, webp, up to 50 MB, 64 to 8192 px per side."},"prompt":{"type":"string","minLength":2,"maxLength":32000,"description":"Text prompt."},"resolution":{"type":"string","enum":["1K","2K","4K"],"default":"1K"},"aspectRatio":{"type":"string","enum":["auto","1:1","3:2","2:3","16:9","9:16","4:3","3:4","21:9","27:16","16:27","9:8","8:9"],"default":"auto"}}}],"discriminator":{"propertyName":"mode"}},"webhook_url":{"$ref":"#/components/schemas/WebhookUrl"},"wait_seconds":{"$ref":"#/components/schemas/WaitSeconds"}}},{"title":"GPT Image 2.5 Sunburst","description":"OpenAI, image.","x-mazi-category":"image","x-mazi-maker":"OpenAI","x-mazi-billing-unit":"image","type":"object","required":["model","input"],"properties":{"model":{"type":"string","const":"gpt-image-2.5-sunburst"},"input":{"oneOf":[{"title":"gpt-image-2.5-sunburst: text","type":"object","additionalProperties":false,"required":["mode","prompt"],"properties":{"mode":{"type":"string","const":"text"},"prompt":{"type":"string","minLength":2,"maxLength":32000,"description":"Text prompt."},"resolution":{"type":"string","enum":["1K","2K","4K"],"default":"1K"},"aspectRatio":{"type":"string","enum":["auto","1:1","3:2","2:3","16:9","9:16","4:3","3:4","21:9","27:16","16:27","9:8","8:9"],"default":"auto"}}},{"title":"gpt-image-2.5-sunburst: reference-images","type":"object","additionalProperties":false,"required":["mode","referenceImages","prompt"],"properties":{"mode":{"type":"string","const":"reference-images"},"referenceImages":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":16,"description":"Media id from POST /v1/media (field \"referenceImages\"). Accepts jpeg, png, webp, up to 50 MB, 64 to 8192 px per side."},"prompt":{"type":"string","minLength":2,"maxLength":32000,"description":"Text prompt."},"resolution":{"type":"string","enum":["1K","2K","4K"],"default":"1K"},"aspectRatio":{"type":"string","enum":["auto","1:1","3:2","2:3","16:9","9:16","4:3","3:4","21:9","27:16","16:27","9:8","8:9"],"default":"auto"}}}],"discriminator":{"propertyName":"mode"}},"webhook_url":{"$ref":"#/components/schemas/WebhookUrl"},"wait_seconds":{"$ref":"#/components/schemas/WaitSeconds"}}}],"discriminator":{"propertyName":"model"}},"examples":{"seedance-2.5":{"summary":"Seedance 2.5","value":{"model":"seedance-2.5","input":{"mode":"text","prompt":"A slow dolly shot of a ceramic coffee cup on a sunlit kitchen counter, steam rising","resolution":"720p","aspectRatio":"9:16","duration":5,"audio":true,"numberResults":1}}},"nano-banana-2.1":{"summary":"Nano Banana 2.1","value":{"model":"nano-banana-2.1","input":{"mode":"text","prompt":"Product photo of a ceramic coffee cup on a sunlit kitchen counter, soft shadows","resolution":"1K","aspectRatio":"1:1"}}},"gpt-image-2.5-flare":{"summary":"GPT Image 2.5 Flare","value":{"model":"gpt-image-2.5-flare","input":{"mode":"text","prompt":"Product photo of a ceramic coffee cup on a sunlit kitchen counter, soft shadows","resolution":"1K","aspectRatio":"auto"}}},"gpt-image-2.5-sunburst":{"summary":"GPT Image 2.5 Sunburst","value":{"model":"gpt-image-2.5-sunburst","input":{"mode":"text","prompt":"Product photo of a ceramic coffee cup on a sunlit kitchen counter, soft shadows","resolution":"1K","aspectRatio":"auto"}}}}}}},"responses":{"200":{"description":"Job already existed for this Idempotency-Key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"201":{"description":"Job created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"},"example":{"id":"7d0c6f0e-3b0a-4f53-9a43-1f6a2c3b4d5e","object":"job","model":"seedance-2.5","status":"succeeded","progress":100,"credits":10,"input":{"mode":"text","prompt":"A slow dolly shot of a ceramic coffee cup on a sunlit kitchen counter, steam rising","resolution":"720p","aspectRatio":"9:16","duration":5,"audio":true,"numberResults":1},"error":null,"outputs":[{"id":"b2a7c1d0-1e2f-4a3b-8c4d-5e6f7a8b9c0d","type":"image","mime":"image/png","url":"https://media.joinmazi.ai/...","download_url":"https://media.joinmazi.ai/...","width":1024,"height":1024,"preview_url":"https://media.joinmazi.ai/..."}],"urls_expire_at":"2026-11-01T10:00:00.000Z","outputs_expire_at":"2027-01-29T10:00:00.000Z","created_at":"2026-10-31T10:00:00.000Z","finished_at":"2026-10-31T10:00:12.000Z"}}}},"400":{"description":"Invalid request or input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_input","message":"The input does not match the model. See details and GET /v1/models/{model_id}."}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unauthorized","message":"Missing or invalid API key. Send it as \"Authorization: Bearer mz_live_...\"."}}}}},"402":{"description":"Not enough mazi credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"insufficient_credits","message":"Not enough mazi credits for this generation. Top up in the mazi app and try again."}}}}},"403":{"description":"Terms not accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"terms_required","message":"Accept the Terms of Service in the mazi app (joinmazi.ai/app) before you generate."}}}}},"404":{"description":"Unknown model","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unknown_model","message":"No model with this id is available. See GET /v1/models."}}}}},"409":{"description":"Idempotency-Key reused with a different request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"idempotency_conflict","message":"This Idempotency-Key was already used with a different request."}}}}},"429":{"description":"Too many requests or too many open jobs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limited","message":"Too many requests. Wait a moment and retry."}}}}},"503":{"description":"Model temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"generation_unavailable","message":"This model is temporarily unavailable. Try again later or use another model."}}}}}},"callbacks":{"jobFinished":{"{$request.body#/webhook_url}":{"post":{"summary":"Job finished (webhook)","description":"Sent when the job succeeds or fails. Verify the Mazi-Signature header with your webhook signing secret. Answer with any 2xx status within 10 seconds; otherwise mazi retries after 1 min, 5 min, 30 min, 2 h, and 8 h.","parameters":[{"name":"Mazi-Signature","in":"header","required":true,"schema":{"type":"string"},"example":"t=1761904812,v1=5f2b…"},{"name":"Mazi-Event-Id","in":"header","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Mazi-Delivery-Attempt","in":"header","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Received"}}}}}}},"get":{"tags":["Jobs"],"operationId":"listJobs","summary":"List jobs","description":"Your jobs, newest first. Page with starting_after = next_cursor of the previous page.","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"status","in":"query","schema":{"type":"string","enum":["queued","processing","succeeded","failed"]}},{"name":"starting_after","in":"query","schema":{"type":"string","format":"uuid"},"description":"Job id to continue after (next_cursor)."}],"responses":{"200":{"description":"Jobs","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Job"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}}}}}}}},"/jobs/{job_id}":{"get":{"tags":["Jobs"],"operationId":"getJob","summary":"Get a job","description":"Status and outputs of a job. With wait_seconds the request stays open until the job finishes or the time is up (long polling, no tight loops needed).","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"wait_seconds","in":"query","schema":{"$ref":"#/components/schemas/WaitSeconds"}}],"responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"},"example":{"id":"7d0c6f0e-3b0a-4f53-9a43-1f6a2c3b4d5e","object":"job","model":"seedance-2.5","status":"succeeded","progress":100,"credits":10,"input":{"mode":"text","prompt":"A slow dolly shot of a ceramic coffee cup on a sunlit kitchen counter, steam rising","resolution":"720p","aspectRatio":"9:16","duration":5,"audio":true,"numberResults":1},"error":null,"outputs":[{"id":"b2a7c1d0-1e2f-4a3b-8c4d-5e6f7a8b9c0d","type":"image","mime":"image/png","url":"https://media.joinmazi.ai/...","download_url":"https://media.joinmazi.ai/...","width":1024,"height":1024,"preview_url":"https://media.joinmazi.ai/..."}],"urls_expire_at":"2026-11-01T10:00:00.000Z","outputs_expire_at":"2027-01-29T10:00:00.000Z","created_at":"2026-10-31T10:00:00.000Z","finished_at":"2026-10-31T10:00:12.000Z"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"not_found","message":"No job with this id on this account."}}}}}}}},"/media":{"post":{"tags":["Media"],"operationId":"uploadMedia","summary":"Upload an input image","description":"Uploads an image for one media field of a model and returns its media id. Use the id in the job input. Uploads are deleted after 90 days.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","model","field"],"properties":{"file":{"type":"string","format":"binary"},"model":{"type":"string"},"field":{"type":"string","description":"Media field name, see GET /v1/models/{model_id}."}}}},"application/json":{"schema":{"type":"object","required":["model","field"],"properties":{"model":{"type":"string"},"field":{"type":"string"},"url":{"type":"string","format":"uri","description":"Public https URL of the image."},"base64":{"type":"string","description":"Image bytes as base64 (data URL prefix allowed)."}}}}}},"responses":{"201":{"description":"Uploaded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Media"}}}},"404":{"description":"Unknown model or field","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"unknown_field","message":"This model has no media field with this name."}}}}},"413":{"description":"File too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"size","message":"The file is too large for this field."}}}}},"415":{"description":"Unsupported file type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"type","message":"Unsupported file type. Upload JPEG, PNG, or WebP."}}}}},"422":{"description":"Image outside the field limits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"dimensions","message":"The image is smaller or larger than this field allows (see min_px and max_px)."}}}}}}}},"/account":{"get":{"tags":["Account"],"operationId":"getAccount","summary":"Get your account","responses":{"200":{"description":"Account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"mz_live_…","description":"API key from the mazi app: Settings, API access."}},"schemas":{"WaitSeconds":{"type":"integer","minimum":0,"maximum":60,"default":0,"description":"Seconds to wait for the job to finish before responding."},"WebhookUrl":{"type":"string","format":"uri","description":"Public https URL that receives a signed POST when the job finishes."},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["unauthorized","account_blocked","terms_required","insufficient_credits","too_many_open_jobs","rate_limited","invalid_request","invalid_input","unknown_model","unknown_field","unsupported_media","media_not_found","type","dimensions","ratio","size","invalid_url","invalid_webhook_url","download_failed","idempotency_conflict","generation_unavailable","not_found","internal_error","content_rejected","provider_failed","submit_failed","timeout"]},"message":{"type":"string"},"details":{}}}}},"Output":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["image","video","audio"]},"mime":{"type":"string"},"url":{"type":"string","format":"uri","description":"Signed link, valid until urls_expire_at."},"download_url":{"type":"string","format":"uri","description":"Same file with a download file name."},"width":{"type":["integer","null"]},"height":{"type":["integer","null"]},"preview_url":{"type":["string","null"],"format":"uri"}}},"Job":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"job"},"model":{"type":"string"},"status":{"type":"string","enum":["queued","processing","succeeded","failed"]},"progress":{"type":["integer","null"],"minimum":0,"maximum":100},"credits":{"type":"integer","description":"Price in mazi credits (charged on success, refunded on failure)."},"input":{"type":"object"},"error":{"oneOf":[{"type":"null"},{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}]},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/Output"}},"urls_expire_at":{"type":["string","null"],"format":"date-time","description":"Fetch the job again for fresh links."},"outputs_expire_at":{"type":"string","format":"date-time","description":"Files are deleted after this date."},"created_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"}}},"Event":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"event"},"type":{"type":"string","enum":["job.succeeded","job.failed"]},"created_at":{"type":"string","format":"date-time"},"api_version":{"const":"v1"},"data":{"type":"object","properties":{"job":{"$ref":"#/components/schemas/Job"}}}}},"Field":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","integer","boolean","media_id","media_id[]"]},"required":{"type":"boolean"},"enum":{"type":"array","items":{"type":"string"}},"default":{},"minimum":{"type":"number"},"maximum":{"type":"number"},"min_length":{"type":"integer"},"max_length":{"type":"integer"},"media_type":{"type":"string"},"accept":{"type":"array","items":{"type":"string"}},"max_bytes":{"type":"integer"}}},"Model":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"model"},"name":{"type":"string"},"maker":{"type":"string"},"category":{"type":"string","enum":["video","image","audio"]},"description":{"type":["string","null"]},"billing_unit":{"type":"string","enum":["second","image"]},"modes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/Field"}}}}},"pricing":{"type":"array","items":{"type":"object","properties":{"mode":{"type":["string","null"]},"resolution":{"type":["string","null"]},"audio":{"type":["boolean","null"]},"credits":{"type":"number"},"per":{"type":"string","enum":["second","image"]}}}}}},"Estimate":{"type":"object","properties":{"object":{"const":"estimate"},"model":{"type":"string"},"credits":{"type":"integer"},"usd":{"type":"number"},"billing_unit":{"type":"string","enum":["second","image"]},"quantity":{"type":"number"},"credits_per_unit":{"type":"number"}}},"Media":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"object":{"const":"media"},"mime":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"model":{"type":"string"},"field":{"type":"string"}}},"Account":{"type":"object","properties":{"object":{"const":"account"},"id":{"type":"string"},"email":{"type":"string"},"credits":{"type":"object","properties":{"available":{"type":"integer"},"reserved":{"type":"integer","description":"Held for running jobs."}}},"credit_value_usd":{"type":"number"},"terms_accepted":{"type":"boolean"}}}}}}