{"openapi":"3.1.1","info":{"title":"pixler API","description":"Three verbs queue a job, one endpoint collects it.","version":"v1"},"servers":[{"url":"/","description":"pixler API"}],"paths":{"/api/v1/generate":{"post":{"tags":["Generations"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateRequestV1"}},"text/json":{"schema":{"$ref":"#/components/schemas/GenerateRequestV1"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/GenerateRequestV1"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/QueuedJobV1"}},"application/json":{"schema":{"$ref":"#/components/schemas/QueuedJobV1"}},"text/json":{"schema":{"$ref":"#/components/schemas/QueuedJobV1"}}}}}}},"/api/v1/edit":{"post":{"tags":["Generations"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditRequestV1"}},"text/json":{"schema":{"$ref":"#/components/schemas/EditRequestV1"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/EditRequestV1"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/QueuedJobV1"}},"application/json":{"schema":{"$ref":"#/components/schemas/QueuedJobV1"}},"text/json":{"schema":{"$ref":"#/components/schemas/QueuedJobV1"}}}}}}},"/api/v1/animate":{"post":{"tags":["Animations"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnimateRequestV1"}},"text/json":{"schema":{"$ref":"#/components/schemas/AnimateRequestV1"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/AnimateRequestV1"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/QueuedJobV1"}},"application/json":{"schema":{"$ref":"#/components/schemas/QueuedJobV1"}},"text/json":{"schema":{"$ref":"#/components/schemas/QueuedJobV1"}}}}}}},"/api/v1/jobs/{jobId}":{"get":{"tags":["Jobs"],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/JobV1"}},"application/json":{"schema":{"$ref":"#/components/schemas/JobV1"}},"text/json":{"schema":{"$ref":"#/components/schemas/JobV1"}}}}}}},"/api/v1/jobs":{"get":{"tags":["Jobs"],"parameters":[{"name":"limit","in":"query","schema":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32","default":20}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/JobPageV1"}},"application/json":{"schema":{"$ref":"#/components/schemas/JobPageV1"}},"text/json":{"schema":{"$ref":"#/components/schemas/JobPageV1"}}}}}}},"/api/v1/jobs/{jobId}/images/{index}":{"get":{"tags":["Jobs"],"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}},{"name":"index","in":"path","required":true,"schema":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK"}}}},"/api/v1/quota":{"get":{"tags":["Account"],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/QuotaV1"}},"application/json":{"schema":{"$ref":"#/components/schemas/QuotaV1"}},"text/json":{"schema":{"$ref":"#/components/schemas/QuotaV1"}}}}}}}},"components":{"schemas":{"AnimateRequestV1":{"required":["jobId"],"type":"object","properties":{"jobId":{"type":"string"},"imageIndex":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32","default":0},"preset":{"$ref":"#/components/schemas/AnimationPreset"},"frameCount":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32","default":8},"customPrompt":{"type":["null","string"]}}},"AnimationPreset":{"enum":["Idle","Attack","Cast","Float","Turnaround","Walk","Run","Jump","Hurt","Death","Crouch","Custom"],"default":"Idle"},"AssetType":{"enum":["Sprite","Item","Tile","Background"]},"BalanceType":{"enum":["Daily","Monthly"]},"EditRequestV1":{"required":["jobId","instruction"],"type":"object","properties":{"jobId":{"type":"string"},"instruction":{"type":"string"},"imageIndex":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32","default":0}}},"GenerateRequestV1":{"required":["type","prompt","width","height"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/AssetType"},"prompt":{"type":"string"},"width":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32"},"height":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32"},"count":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32","default":1},"transparent":{"type":"boolean","default":true},"maxColors":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["null","integer","string"],"format":"int32"},"palette":{"type":["null","string"]}}},"JobImageV1":{"required":["index","url"],"type":"object","properties":{"index":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32"},"url":{"type":"string"},"urlExpiresAt":{"type":["null","string"],"format":"date-time"}}},"JobPageV1":{"required":["items","nextCursor"],"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/JobV1"}},"nextCursor":{"type":["null","string"]}}},"JobSheetV1":{"required":["frameCount","loops"],"type":"object","properties":{"frameCount":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32"},"loops":{"type":"boolean"}}},"JobType":{"enum":["Generation","Animation"]},"JobV1":{"required":["id","type","status","prompt","name","width","height","images","sheet","createdAt","completedAt","error"],"type":"object","properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/JobType"},"status":{"$ref":"#/components/schemas/Status"},"prompt":{"type":"string"},"name":{"type":["null","string"]},"width":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32"},"height":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32"},"images":{"type":"array","items":{"$ref":"#/components/schemas/JobImageV1"}},"sheet":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/JobSheetV1"}]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":["null","string"],"format":"date-time"},"error":{"type":["null","string"]}}},"QueuedJobV1":{"required":["id","type","status","remainingQuota"],"type":"object","properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/JobType"},"status":{"$ref":"#/components/schemas/Status"},"remainingQuota":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32"}}},"QuotaV1":{"required":["remaining","total","type","resetAt","animationsRemaining","animationsTotal"],"type":"object","properties":{"remaining":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32"},"total":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32"},"type":{"$ref":"#/components/schemas/BalanceType"},"resetAt":{"type":["null","string"],"format":"date-time"},"animationsRemaining":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32"},"animationsTotal":{"pattern":"^-?(?:0|[1-9]\\d*)$","type":["integer","string"],"format":"int32"}}},"Status":{"enum":["Queued","Running","Processing","Completed","Failed"]}},"securitySchemes":{"Bearer":{"type":"http","description":"Paste a pixler API token, for example pxl_live_...","scheme":"bearer","bearerFormat":"pixler API token"}}},"security":[{"Bearer":[]}],"tags":[{"name":"Generations"},{"name":"Animations"},{"name":"Jobs"},{"name":"Account"}]}