{"openapi":"3.1.0","info":{"title":"ZeroGen API","version":"v1","description":"Generate images and video with every model in ZeroGen from your own servers. Generated from the API's contracts by `npm run openapi` in apps/web; do not edit by hand."},"servers":[{"url":"https://api.zerogen.com/v1"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Account","description":"The calling key and the organization's balance."},{"name":"Models","description":"The models an organization can run and their schemas."},{"name":"Generations","description":"Quote, create, read, list and cancel generations."},{"name":"Uploads","description":"Upload files into the Library to use as inputs."}],"paths":{"/me":{"get":{"operationId":"getMe","tags":["Account"],"summary":"Read the calling key","description":"The calling API key, its organization and its owner. `scopes` lists what the key can do now: its scopes that the owner's role still allows.\n\nNeeds no scope.","responses":{"200":{"description":"The calling key.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/balance":{"get":{"operationId":"getBalance","tags":["Account"],"summary":"Read the organization's balance","description":"The organization's funds and monthly limits, shared by every member and project. A new generation's quote must fit within `availableMicroUsd`.\n\nNeeds the `account:read` scope.","parameters":[{"name":"projectId","in":"query","required":false,"description":"Also report this project's monthly budget","schema":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"}}],"responses":{"200":{"description":"The organization's balance.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/models":{"get":{"operationId":"listModels","tags":["Models"],"summary":"List models","description":"The models this organization can run, one entry per model and operation. Read a model to get the JSON Schema its requests follow.\n\nNeeds the `models:read` scope.","parameters":[{"name":"capability","in":"query","required":false,"schema":{"type":"string","enum":["image","video"]}},{"name":"operation","in":"query","required":false,"description":"The model ID's operation segment","schema":{"type":"string","enum":["generate","edit","inpaint","remix","text-to-vector","text-to-video","image-to-video","first-last-frame-to-video","reference-to-video","audio-to-video","video-to-video","extend-video","motion-control","clean-plate","render-to-real","hdr","outpaint","reference-video-to-video"]}},{"name":"q","in":"query","required":false,"description":"Search model IDs and labels, including the maker and related operations","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"frames","in":"query","required":false,"description":"Video models accepting at least these frame slots","schema":{"type":"string","enum":["start","start-end"]}},{"name":"audio","in":"query","required":false,"description":"Video models that can generate audio","schema":{"type":"string","const":"true"}},{"name":"referenceKind","in":"query","required":false,"description":"Models accepting reference media of this kind","schema":{"type":"string","enum":["image","video","audio"]}},{"name":"limit","in":"query","required":false,"description":"Models per page; default 20","schema":{"type":"integer","minimum":1,"maximum":50}},{"name":"cursor","in":"query","required":false,"description":"nextCursor from the previous page, with the same filters","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of models.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/models/{vendor}/{model}/{operation}":{"get":{"operationId":"getModel","tags":["Models"],"summary":"Read a model","description":"One model and the JSON Schema (2020-12) that `POST /generations` validates its requests against. A deprecated model sends `Deprecation` and `Sunset`.\n\nNeeds the `models:read` scope.","parameters":[{"name":"vendor","in":"path","required":true,"description":"The company that makes the model, such as `google`","schema":{"type":"string"}},{"name":"model","in":"path","required":true,"description":"The model, such as `nano-banana-2`","schema":{"type":"string"}},{"name":"operation","in":"path","required":true,"description":"The operation, such as `generate`","schema":{"type":"string"}}],"responses":{"200":{"description":"The model.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelDetail"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/generations/quote":{"post":{"operationId":"quoteGeneration","tags":["Generations"],"summary":"Quote a generation","description":"Validates and prices a request exactly as create would, and returns the maximum charge create would reserve. Nothing starts and nothing is held.\n\nNeeds the `generations:create` scope.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGenerationRequest"},"example":{"model":"black-forest-labs/flux-2-pro/generate","prompt":"A lighthouse at dawn, fog over the water","output":{"count":1}}}}},"responses":{"200":{"description":"The quote.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/generations":{"post":{"operationId":"createGeneration","tags":["Generations"],"summary":"Create a generation","description":"Validates, prices, reserves and starts one generation in a single call. Send `Prefer: wait=N` to hold the response until it ends. Nothing is charged unless every check passes.\n\nNeeds the `generations:create` scope.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/Prefer"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGenerationRequest"},"example":{"model":"black-forest-labs/flux-2-pro/generate","prompt":"A lighthouse at dawn, fog over the water","output":{"count":1}}}}},"responses":{"200":{"description":"The generation has ended, within the requested wait.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"Location":{"$ref":"#/components/headers/Location"},"Preference-Applied":{"$ref":"#/components/headers/Preference-Applied"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"202":{"description":"The generation started and has not ended yet.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"Location":{"$ref":"#/components/headers/Location"},"Preference-Applied":{"$ref":"#/components/headers/Preference-Applied"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}},"get":{"operationId":"listGenerations","tags":["Generations"],"summary":"List generations","description":"The calling key owner's generations, newest first.\n\nNeeds the `generations:read` scope.","parameters":[{"name":"projectId","in":"query","required":false,"description":"Only generations in this project","schema":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"}},{"name":"folderId","in":"query","required":false,"description":"Only generations filed in this folder; needs projectId","schema":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"}},{"name":"limit","in":"query","required":false,"description":"Generations per page; default 10","schema":{"type":"integer","minimum":1,"maximum":20}},{"name":"cursor","in":"query","required":false,"description":"nextCursor from the previous page, with the same filters","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of generations.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/generations/{id}":{"get":{"operationId":"getGeneration","tags":["Generations"],"summary":"Read a generation","description":"One generation and each output's status, asset and error. Send `Prefer: wait=N` to hold the response until it ends. Reads never start or repeat work.\n\nNeeds the `generations:read` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The generation's ID","schema":{"type":"string"}},{"$ref":"#/components/parameters/Prefer"}],"responses":{"200":{"description":"The generation.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Preference-Applied":{"$ref":"#/components/headers/Preference-Applied"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"202":{"description":"With `Prefer: wait`, the generation had not ended when the wait ran out.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Preference-Applied":{"$ref":"#/components/headers/Preference-Applied"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/generations/{id}/cancel":{"post":{"operationId":"cancelGeneration","tags":["Generations"],"summary":"Cancel a generation","description":"Stops the generation's unfinished outputs. Outputs a vendor already finished are kept and charged; cancelling a finished generation returns it unchanged. Takes no body.\n\nNeeds the `generations:cancel` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The generation's ID","schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"The generation.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"Deprecation":{"$ref":"#/components/headers/Deprecation"},"Sunset":{"$ref":"#/components/headers/Sunset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/uploads":{"post":{"operationId":"createUpload","tags":["Uploads"],"summary":"Create an upload","description":"Starts an upload into the Library. PUT the file's exact bytes to the returned target, then complete the upload. With `sha256`, an identical file already in the project comes back ready, with nothing to send.\n\nNeeds the `uploads:create` scope.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUploadRequest"},"example":{"filename":"reference.png","contentType":"image/png","sizeBytes":482113}}}},"responses":{"200":{"description":"An identical file is already in the project.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"201":{"description":"PUT the bytes, then complete.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"},"Location":{"$ref":"#/components/headers/Location"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/uploads/{id}":{"get":{"operationId":"getUpload","tags":["Uploads"],"summary":"Read an upload","description":"One of the caller's uploads and, once ready, its Library asset.\n\nNeeds the `uploads:create` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The upload's ID, as create returned it","schema":{"type":"string"}}],"responses":{"200":{"description":"The upload.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}},"/uploads/{id}/complete":{"post":{"operationId":"completeUpload","tags":["Uploads"],"summary":"Complete an upload","description":"Checks the uploaded bytes and makes them a Library asset to use as a generation input. Completing again returns the same asset. Takes no body.\n\nNeeds the `uploads:create` scope.","parameters":[{"name":"id","in":"path","required":true,"description":"The upload's ID, as create returned it","schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"The ready upload.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Idempotent-Replayed":{"$ref":"#/components/headers/Idempotent-Replayed"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"429":{"$ref":"#/components/responses/TooManyRequests"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"A ZeroGen API key: zg_ for a live key, zg_test_ for a test key."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Makes retries safe: a retry with the same key and body returns the first response for 24 hours instead of repeating the work. Reusing a key with a different body returns 409.","schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[\\x21-\\x7e]+$"}},"Prefer":{"name":"Prefer","in":"header","required":false,"description":"wait=N holds the response up to N seconds (at most 60) until the generation ends.","schema":{"type":"string","pattern":"^wait=\\d+$","example":"wait=30"}}},"headers":{"Request-Id":{"description":"Identifies the request; quote it when contacting support.","schema":{"type":"string"}},"RateLimit-Limit":{"description":"Requests the key may make in the current window.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the current window resets.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}},"Location":{"description":"Where to read the created resource.","schema":{"type":"string"}},"Idempotent-Replayed":{"description":"true when this response replays an earlier request with the same Idempotency-Key.","schema":{"type":"string","enum":["true"]}},"Preference-Applied":{"description":"The wait applied, such as wait=30.","schema":{"type":"string"}},"Deprecation":{"description":"When the model was deprecated, as @ followed by Unix seconds.","schema":{"type":"string"}},"Sunset":{"description":"When the deprecated model stops accepting requests (HTTP date).","schema":{"type":"string"}},"WWW-Authenticate":{"description":"Bearer realm=\"ZeroGen API\".","schema":{"type":"string"}}},"responses":{"BadRequest":{"description":"The request is malformed or invalid: invalid_request, validation_failed, model_unavailable or input_import_failed.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"invalid_api_key: the key is missing, revoked or expired.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PaymentRequired":{"description":"insufficient_balance or spend_limit_reached: the available balance or a spend limit cannot cover the quote. cost_limit_exceeded: the quote is above maxCostMicroUsd.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Forbidden":{"description":"permission_denied: the key lacks the scope this endpoint needs, the request came from a browser, or the API isn't enabled for the organization.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"not_found: no such resource for this caller, including a projectId the caller can't use.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Conflict":{"description":"idempotency_conflict: the Idempotency-Key was used for a different request. idempotency_in_progress: the first request with this key hasn't finished. invalid_state: the request can't go ahead as things stand, such as a generation that needs a person's approval in ZeroGen.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"PayloadTooLarge":{"description":"The request body is larger than 128 KB.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"UnsupportedMediaType":{"description":"Send the body as application/json.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"TooManyRequests":{"description":"rate_limited: the key or its owner is over the rate limit, or the organization is at its running cap. Retry after Retry-After seconds.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"InternalError":{"description":"internal: something went wrong. Retry.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ServiceUnavailable":{"description":"unavailable or pricing_unavailable: API keys, billing or pricing can't be reached right now. Retry.","headers":{"Request-Id":{"$ref":"#/components/headers/Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"CreateGenerationRequest":{"type":"object","properties":{"model":{"type":"string","maxLength":200,"pattern":"^[a-z0-9]+(?:[.-][a-z0-9]+)*\\/[a-z0-9]+(?:[.-][a-z0-9]+)*\\/[a-z0-9]+(?:[.-][a-z0-9]+)*$"},"prompt":{"type":"string","maxLength":20000},"inputs":{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"object","properties":{"role":{"type":"string","enum":["source","reference","face-reference","start-frame","end-frame","mask"]},"asset":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Library asset ID"}},"required":["role","asset"],"additionalProperties":false},{"type":"object","properties":{"role":{"type":"string","enum":["source","reference","face-reference","start-frame","end-frame","mask"]},"url":{"type":"string","maxLength":2048,"format":"uri","description":"An https URL ZeroGen imports into the library before use","pattern":"^https://"}},"required":["role","url"],"additionalProperties":false}]}},"output":{"type":"object","properties":{"count":{"type":"integer","minimum":1,"maximum":4},"size":{"description":"Image size: auto or WIDTHxHEIGHT in pixels, such as 1024x1536","type":"string","maxLength":40},"quality":{"type":"string","maxLength":40},"background":{"type":"string","maxLength":40},"format":{"type":"string","enum":["png","jpeg","webp"]},"aspectRatio":{"type":"string","maxLength":20},"resolution":{"type":"string","maxLength":20},"durationSeconds":{"type":"number","exclusiveMinimum":0,"maximum":600},"includeAudio":{"type":"boolean"}},"additionalProperties":false},"parameters":{"type":"object","propertyNames":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,63}$"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":200},{"type":"number"},{"type":"boolean"}]},"description":"Only the parameters the model's schema lists"},"maxCostMicroUsd":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Refuse to start when the quote exceeds this amount"},"test":{"type":"object","properties":{"outputs":{"minItems":1,"maxItems":4,"type":"array","items":{"type":"string","enum":["succeeded","provider_error","provider_timeout","content_moderation","input_rejected"]},"description":"Each output's outcome, in order: succeeded, or the error code a live output can end with. Outputs left out succeed"},"reject":{"type":"string","enum":["insufficient_balance","rate_limited","model_unavailable"],"description":"Create only: refuse with this live response and start nothing (402 insufficient_balance, 429 rate_limited with Retry-After, 400 model_unavailable)"},"delaySeconds":{"type":"integer","minimum":0,"maximum":60,"description":"Seconds before each output ends, to rehearse polling and Prefer: wait"}},"additionalProperties":false,"description":"Test keys only: rehearse each output's outcome; live keys are refused when it is present"},"projectId":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"The project the outputs land in; the organization's default project when omitted. Test keys use their sandbox."},"folderId":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"},{"type":"null"}],"description":"A folder in that project to file the outputs in; null or omitted for Unfiled"},"naming":{"type":"object","properties":{"presetId":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"A naming preset in the generation's project"},"values":{"type":"object","propertyNames":{"type":"string","maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":80},{"type":"integer","minimum":0,"maximum":99999999}]},"maxProperties":12,"description":"Field values by field ID; fields left out take the preset's defaults"}},"required":["presetId","values"],"additionalProperties":false}},"required":["model"],"additionalProperties":false},"CreateUploadRequest":{"type":"object","properties":{"projectId":{"description":"The project to upload into; omit for the organization's default project.","type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"},"folderId":{"description":"Add the asset to this folder in the project.","type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"},"filename":{"type":"string","maxLength":1024,"minLength":1,"pattern":"^(?:.*[\\\\/])?[^\\\\/]{1,255}$"},"contentType":{"type":"string","enum":["audio/aac","audio/aiff","audio/flac","audio/mp4","audio/mpeg","audio/ogg","audio/wav","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/tiff","image/webp","video/mp4","video/quicktime","video/webm","video/x-matroska","video/x-msvideo"]},"sizeBytes":{"type":"integer","minimum":1,"maximum":5368709120},"sha256":{"description":"Lowercase hex SHA-256 of the file, to reuse an identical file in the project.","type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["filename","contentType","sizeBytes"],"additionalProperties":false},"Me":{"type":"object","properties":{"apiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"mode":{"type":"string","enum":["live","test"],"description":"test keys run on placeholder providers, charge nothing and stay in the sandbox"},"scopes":{"type":"array","items":{"type":"string"},"description":"What this key can do now: its scopes that its owner's role still allows"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the key stops working; null for never"}},"required":["id","name","mode","scopes","createdAt","expiresAt"],"additionalProperties":false},"organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"user":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"],"additionalProperties":false,"description":"The key's owner, whom it acts as"},"sandbox":{"anyOf":[{"type":"object","properties":{"projectId":{"type":"string"}},"required":["projectId"],"additionalProperties":false},{"type":"null"}],"description":"Test keys only: the project every request of the key is confined to"}},"required":["apiKey","organization","user","sandbox"],"additionalProperties":false},"Balance":{"type":"object","properties":{"currency":{"type":"string","const":"USD"},"balanceMicroUsd":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"heldMicroUsd":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Reserved for generations that have not settled; a hold is not a charge"},"availableMicroUsd":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What a new generation's quote must fit within; it can be negative"},"unlimited":{"type":"boolean","description":"The funds check is bypassed; usage is still charged"},"limits":{"type":"object","properties":{"organizationMonthly":{"anyOf":[{"type":"object","properties":{"limitMicroUsd":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"spentMicroUsd":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"This UTC month's spend, as admission counts it"},"enforced":{"type":"boolean"}},"required":["limitMicroUsd","spentMicroUsd","enforced"],"additionalProperties":false},{"type":"null"}]},"projectMonthly":{"anyOf":[{"type":"object","properties":{"limitMicroUsd":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"spentMicroUsd":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["limitMicroUsd","spentMicroUsd"],"additionalProperties":false},{"type":"null"}],"description":"With projectId, that project's monthly budget"}},"required":["organizationMonthly","projectMonthly"],"additionalProperties":false}},"required":["currency","balanceMicroUsd","heldMicroUsd","availableMicroUsd","unlimited","limits"],"additionalProperties":false},"Model":{"type":"object","properties":{"id":{"type":"string","maxLength":200,"pattern":"^[a-z0-9]+(?:[.-][a-z0-9]+)*\\/[a-z0-9]+(?:[.-][a-z0-9]+)*\\/[a-z0-9]+(?:[.-][a-z0-9]+)*$"},"name":{"type":"string"},"capability":{"type":"string","enum":["image","video"]},"operation":{"type":"string","enum":["generate","edit","inpaint","remix","text-to-vector","text-to-video","image-to-video","first-last-frame-to-video","reference-to-video","audio-to-video","video-to-video","extend-video","motion-control","clean-plate","render-to-real","hdr","outpaint","reference-video-to-video"]},"status":{"type":"string","enum":["active","deprecated"]},"sunsetAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"A deprecated model refuses new requests from this time"}},"required":["id","name","capability","operation","status","sunsetAt"],"additionalProperties":false},"ModelList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}},"nextCursor":{"description":"Pass as cursor for the next page of models; null on the last page","type":["string","null"]}},"required":["data","nextCursor"],"additionalProperties":false},"ModelDetail":{"type":"object","properties":{"id":{"type":"string","maxLength":200,"pattern":"^[a-z0-9]+(?:[.-][a-z0-9]+)*\\/[a-z0-9]+(?:[.-][a-z0-9]+)*\\/[a-z0-9]+(?:[.-][a-z0-9]+)*$"},"name":{"type":"string"},"capability":{"type":"string","enum":["image","video"]},"operation":{"type":"string","enum":["generate","edit","inpaint","remix","text-to-vector","text-to-video","image-to-video","first-last-frame-to-video","reference-to-video","audio-to-video","video-to-video","extend-video","motion-control","clean-plate","render-to-real","hdr","outpaint","reference-video-to-video"]},"status":{"type":"string","enum":["active","deprecated"]},"sunsetAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"A deprecated model refuses new requests from this time"},"requestSchema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"JSON Schema (2020-12) for POST /v1/generations with this model; x-roles lists each input role's accepted media and limits"}},"required":["id","name","capability","operation","status","sunsetAt","requestSchema"],"additionalProperties":false},"Quote":{"type":"object","properties":{"model":{"type":"string","maxLength":200,"pattern":"^[a-z0-9]+(?:[.-][a-z0-9]+)*\\/[a-z0-9]+(?:[.-][a-z0-9]+)*\\/[a-z0-9]+(?:[.-][a-z0-9]+)*$"},"billing":{"type":"object","properties":{"mode":{"type":"string","enum":["platform","byok","test"]},"quotedMicroUsd":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Reserved maximum expected charge"}},"required":["mode","quotedMicroUsd"],"additionalProperties":false}},"required":["model","billing"],"additionalProperties":false},"Generation":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string","description":"The project that holds the outputs"},"model":{"anyOf":[{"type":"string","maxLength":200,"pattern":"^[a-z0-9]+(?:[.-][a-z0-9]+)*\\/[a-z0-9]+(?:[.-][a-z0-9]+)*\\/[a-z0-9]+(?:[.-][a-z0-9]+)*$"},{"type":"null"}]},"modelVersion":{"type":["string","null"]},"status":{"type":"string","enum":["queued","running","succeeded","partial","failed","cancelled"]},"outputs":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":9007199254740991},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled"]},"asset":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"mimeType":{"type":"string"},"width":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"resourceUri":{"type":"string","description":"Where this transport's client reads the asset, such as an MCP resource"}},"required":["id","mimeType","width","height","durationMs"],"additionalProperties":false},{"type":"null"}]},"error":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"description":"What the provider ignored, such as an unused reference"},"draft":{"type":"object","properties":{"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When upscaling this output closes"},"upscalable":{"type":"boolean","description":"A final can be requested now: unexpired, with no final in progress"},"upscale":{"anyOf":[{"type":"string","enum":["upscaling","upscaled"]},{"type":"null"}],"description":"The newest final's state, or null when none was requested"},"finalResolution":{"type":"string","description":"That final's resolution, one the model's draft control lists"},"finalAssetId":{"type":"string","description":"The newest finished final's asset"}},"required":["expiresAt","upscalable","upscale"],"additionalProperties":false,"description":"A 480p Draft output; upscaling it makes a final with the same seed, at a resolution the model's draft control lists"}},"required":["index","status","asset","error"],"additionalProperties":false}},"error":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"type":"null"}]},"billing":{"type":"object","properties":{"mode":{"type":"string","enum":["platform","byok","test"]},"state":{"anyOf":[{"type":"string","enum":["held","charged","released"]},{"type":"null"}],"description":"held: an amount is reserved and nothing is charged yet; charged: chargedMicroUsd is the final charge; released: the hold ended with no charge; null: billing never admitted the generation, so nothing was held or charged"},"hold":{"type":"object","properties":{"state":{"type":"string","enum":["running","ended","needs_attention"],"description":"running: the generation has not ended; ended: it ended and the hold is still pending; needs_attention: it has stayed pending 30 minutes after ending, or 24 hours after admission with no end recorded (endedAt then stays null), so ZeroGen is looking into it"},"endedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}],"description":"When the generation ended; null while it runs or when no end was recorded"}},"required":["state","endedAt"],"additionalProperties":false,"description":"While held, where the generation stands. It reports facts, not what settlement will do"},"quotedMicroUsd":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"Reserved maximum expected charge"},"heldMicroUsd":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"While held, the amount reserved now; it is never a charge"},"chargedMicroUsd":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The final charge once charged, zero once released; it can rarely exceed the quote"}},"required":["mode","state","quotedMicroUsd","heldMicroUsd","chargedMicroUsd"],"additionalProperties":false},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"startedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"finishedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","projectId","model","modelVersion","status","outputs","error","billing","createdAt","startedAt","finishedAt"],"additionalProperties":false},"GenerationList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Generation"}},"nextCursor":{"description":"Pass as cursor for the next page of generations; null on the last page","type":["string","null"]}},"required":["data","nextCursor"],"additionalProperties":false},"Upload":{"type":"object","properties":{"id":{"type":"string","description":"The upload's ID, which completes it"},"projectId":{"type":"string"},"status":{"type":"string","enum":["upload_required","ready"],"description":"upload_required: PUT the bytes, then complete; ready: the asset can be used"},"assetId":{"description":"Once ready, the Library asset to send as a generation input; an identical file already in the project is reused","type":["string","null"]},"upload":{"anyOf":[{"type":"object","properties":{"method":{"type":"string","const":"PUT"},"url":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["method","url","headers","expiresAt"],"additionalProperties":false},{"type":"null"}],"description":"Where to PUT the file's exact bytes, with these headers, before expiresAt"},"folder":{"description":"Whether the asset was added to the folder named at create","type":"object","properties":{"id":{"type":"string"},"filed":{"type":"boolean"},"error":{"type":"string"}},"required":["id","filed"],"additionalProperties":false}},"required":["id","projectId","status","assetId","upload"],"additionalProperties":false},"Error":{"type":"object","properties":{"code":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,79}$"},"message":{"type":"string"},"param":{"type":"string"},"retryable":{"type":"boolean"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message","retryable"],"additionalProperties":false},"ErrorResponse":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/Error"}},"required":["error"],"additionalProperties":false}}}}