{"openapi":"3.1.0","info":{"title":"API Reference","version":"1.0.0"},"paths":{"/v1/uploads/presign":{"post":{"operationId":"createUploadPresign","summary":"Create a presigned upload URL for an input file","description":"Request a short-lived S3 PUT URL and a task ID for an image or video file. PUT the bytes to uploadUrl with the same Content-Type, then pass the task ID to createJob.\n","tags":["uploads"],"parameters":[{"name":"Authorization","in":"header","description":"Unrestricted secret `sk_live_...` or Cognito access token in `Authorization: Bearer ...`","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Presigned upload URL and object key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresignUploadResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication is missing, invalid, or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresignUploadRequest"}}}}}},"/v1/jobs":{"get":{"operationId":"listJobs","summary":"List jobs for the authenticated account","description":"List async segmentation jobs for the authenticated account.","tags":["jobs"],"parameters":[{"name":"limit","in":"query","description":"Maximum number of jobs to return.","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"nextToken","in":"query","description":"Opaque cursor for the next page of results.","required":false,"schema":{"type":"string"}},{"name":"jobId","in":"query","description":"Return the matching job identifier, if it belongs to the account.","required":false,"schema":{"type":"string"}},{"name":"mode","in":"query","description":"Filter jobs by processing mode.","required":false,"schema":{"$ref":"#/components/schemas/ProcessingMode"}},{"name":"status","in":"query","description":"Filter jobs by status.","required":false,"schema":{"$ref":"#/components/schemas/JobStatus"}},{"name":"Authorization","in":"header","description":"Unrestricted secret `sk_live_...` or Cognito access token in `Authorization: Bearer ...`","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Paginated job summaries","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobListResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication is missing, invalid, or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"createJob","summary":"Create an asynchronous segmentation job (image or video)","description":"Queue an image or video segmentation job from previously uploaded task IDs and text prompts. The job runs asynchronously. Poll retrieveJob until status is success, then fetch masks with retrieveJobResult or createJobDownload. Auth is required; there is no anonymous API.\n","tags":["jobs"],"parameters":[{"name":"Authorization","in":"header","description":"Unrestricted secret `sk_live_...` or Cognito access token in `Authorization: Bearer ...`","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Job accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncAcceptedResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication is missing, invalid, or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"402":{"description":"Trial access is expired, exhausted, or insufficient","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The provided taskId does not belong to the authenticated account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Request conflicts with the current resource state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Failed to enqueue job for background processing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Free trial queue capacity is temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCreateRequest"}}}}}},"/v1/jobs/{jobId}":{"get":{"operationId":"retrieveJob","summary":"Get async segmentation job status","description":"Return the current job status and per-task state. This response does not include masks. Poll until status is success or failed, then call retrieveJobResult or createJobDownload.\n","tags":["jobs"],"parameters":[{"name":"jobId","in":"path","description":"Async job identifier.","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Unrestricted secret `sk_live_...` or Cognito access token in `Authorization: Bearer ...`","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Current async job status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobStatusResponse"}}}},"401":{"description":"Authentication is missing, invalid, or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The requested resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/jobs/{jobId}/result":{"get":{"operationId":"retrieveJobResult","summary":"Retrieve a completed segmentation job result","description":"Returns the result manifest with short-lived signed URLs for owned output assets.","tags":["jobs"],"parameters":[{"name":"jobId","in":"path","description":"Async job identifier.","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Unrestricted secret `sk_live_...` or Cognito access token in `Authorization: Bearer ...`","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Completed result manifest and signed assets","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResultResponse"}}}},"401":{"description":"Authentication is missing, invalid, or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The requested resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Request conflicts with the current resource state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/jobs/{jobId}/download":{"get":{"operationId":"retrieveJobDownload","summary":"Get async job archive download status","description":"Poll an archive request started with createJobDownload. When status is ready, downloadUrl is a short-lived presigned zip containing output_manifest.json and mask artifacts.\n","tags":["jobs"],"parameters":[{"name":"jobId","in":"path","description":"Async job identifier.","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Unrestricted secret `sk_live_...` or Cognito access token in `Authorization: Bearer ...`","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Current job archive download status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobDownloadResponse"}}}},"401":{"description":"Authentication is missing, invalid, or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The requested resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Request conflicts with the current resource state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"createJobDownload","summary":"Create or reuse an async job archive download","description":"Start or reuse a zip archive of a successful job's outputs. Returns pending until the archive is built. The job must already be success; otherwise the API returns 409.\n","tags":["jobs"],"parameters":[{"name":"jobId","in":"path","description":"Async job identifier.","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Unrestricted secret `sk_live_...` or Cognito access token in `Authorization: Bearer ...`","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Archive download request accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobDownloadResponse"}}}},"401":{"description":"Authentication is missing, invalid, or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"The requested resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Request conflicts with the current resource state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/account":{"get":{"operationId":"getAccount","summary":"Retrieve the authenticated account","tags":["account"],"parameters":[{"name":"Authorization","in":"header","description":"Unrestricted secret `sk_live_...` or Cognito access token in `Authorization: Bearer ...`","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"description":"Authentication is missing, invalid, or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/account/overview":{"get":{"operationId":"getAccountOverview","summary":"Retrieve account usage and billing status","tags":["account"],"parameters":[{"name":"Authorization","in":"header","description":"Unrestricted secret `sk_live_...` or Cognito access token in `Authorization: Bearer ...`","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Overview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOverview"}}}},"401":{"description":"Authentication is missing, invalid, or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/api-keys":{"get":{"operationId":"listApiKeys","summary":"List API keys","tags":["apiKeys"],"parameters":[{"name":"Authorization","in":"header","description":"Unrestricted secret `sk_live_...` or Cognito access token in `Authorization: Bearer ...`","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Key metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}}},"401":{"description":"Authentication is missing, invalid, or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"createApiKey","summary":"Create an API key","tags":["apiKeys"],"parameters":[{"name":"Authorization","in":"header","description":"Unrestricted secret `sk_live_...` or Cognito access token in `Authorization: Bearer ...`","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"201":{"description":"Secret returned once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"401":{"description":"Authentication is missing, invalid, or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}}}},"/v1/api-keys/{keyId}":{"delete":{"operationId":"revokeApiKey","summary":"Revoke an API key","tags":["apiKeys"],"parameters":[{"name":"keyId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","description":"Unrestricted secret `sk_live_...` or Cognito access token in `Authorization: Bearer ...`","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyMutation"}}}},"401":{"description":"Authentication is missing, invalid, or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/billing/checkout":{"post":{"operationId":"createCheckout","summary":"Create a billing checkout session","tags":["billing"],"parameters":[{"name":"Authorization","in":"header","description":"Unrestricted secret `sk_live_...` or Cognito access token in `Authorization: Bearer ...`","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"201":{"description":"Checkout URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingUrl"}}}},"401":{"description":"Authentication is missing, invalid, or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/billing/portal":{"post":{"operationId":"createBillingPortal","summary":"Create a billing portal session","tags":["billing"],"parameters":[{"name":"Authorization","in":"header","description":"Unrestricted secret `sk_live_...` or Cognito access token in `Authorization: Bearer ...`","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"201":{"description":"Portal URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingUrl"}}}},"401":{"description":"Authentication is missing, invalid, or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"servers":[{"url":"https://api.segmentationapi.com","description":"Production"}],"components":{"schemas":{"PresignUploadRequest":{"type":"object","properties":{"contentType":{"type":"string","pattern":"^(image/[^;\\s]+|video/[^;\\s]+|application/octet-stream)$","description":"An image or video MIME type, or application/octet-stream."}},"required":["contentType"],"title":"PresignUploadRequest"},"PresignUploadResponse":{"type":"object","properties":{"uploadUrl":{"type":"string","format":"uri"},"taskId":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\.[a-z0-9][a-z0-9.-]{0,63}$","description":"Opaque upload id. Includes the file extension so create-job can address the object without listing the inputs prefix (for example a1b2c3d4-e5f6-7890-abcd-ef1234567890.png).\n"},"bucket":{"type":"string"},"expiresIn":{"type":"integer"}},"required":["uploadUrl","taskId","bucket","expiresIn"],"title":"PresignUploadResponse"},"ApiError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"remainingTokens":{"type":"integer","minimum":0},"requestedTokens":{"type":"integer","minimum":1},"expiresAt":{"type":"string","format":"date-time"},"activeJobId":{"type":"string"},"upgradeUrl":{"type":"string","format":"uri"},"retryAfterSeconds":{"type":"integer","minimum":1}},"required":["error"],"title":"ApiError"},"ProcessingMode":{"type":"string","enum":["single","batch","video"],"title":"ProcessingMode"},"JobStatus":{"type":"string","enum":["queued","processing","success","failed"],"title":"JobStatus"},"JobSummaryType":{"type":"string","enum":["image","video"],"title":"JobSummaryType"},"JobSummary":{"type":"object","properties":{"jobId":{"type":"string"},"type":{"$ref":"#/components/schemas/JobSummaryType"},"processingMode":{"$ref":"#/components/schemas/ProcessingMode"},"totalItems":{"type":"integer","minimum":0},"status":{"$ref":"#/components/schemas/JobStatus"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"error":{"type":["string","null"]}},"required":["jobId","type","processingMode","totalItems","status","createdAt","updatedAt"],"title":"JobSummary"},"JobListResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/JobSummary"}},"nextToken":{"type":["string","null"]}},"required":["items","nextToken"],"title":"JobListResponse"},"ImageJobCreateRequestType":{"type":"string","enum":["image"],"title":"ImageJobCreateRequestType"},"VideoJobCreateRequestType":{"type":"string","enum":["video"],"title":"VideoJobCreateRequestType"},"JobCreateRequest":{"oneOf":[{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ImageJobCreateRequestType"},"prompts":{"type":"array","items":{"type":"string","minLength":1},"description":"Required for all jobs and must include at least one non-empty prompt."},"generatePreview":{"type":"boolean","description":"When true, includes a composited preview image in the result."},"threshold":{"type":"number","format":"double","minimum":0,"maximum":1,"description":"Confidence threshold. Defaults to 0.5."},"maskThreshold":{"type":"number","format":"double","minimum":0,"maximum":1,"description":"Mask threshold. Defaults to 0.5."},"tasks":{"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\.[a-z0-9][a-z0-9.-]{0,63}$","minLength":1},"description":"Task ids returned by POST /v1/uploads/presign."}},"required":["type","prompts","tasks"],"description":"image variant"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/VideoJobCreateRequestType"},"prompts":{"type":"array","items":{"type":"string","minLength":1}},"generatePreview":{"type":"boolean","description":"When true, includes a baked preview video in the result."},"scoreThreshold":{"type":"number","format":"double","minimum":0,"maximum":1,"description":"Confidence threshold. Defaults to 0."},"fps":{"type":"number","format":"double","exclusiveMinimum":0,"description":"Sampling rate in frames per second. Mutually exclusive with numFrames."},"numFrames":{"type":"integer","minimum":1,"description":"Number of frames to sample. Mutually exclusive with fps."},"maxFrames":{"type":"integer","minimum":1,"description":"Upper bound on processed video frames."},"tasks":{"type":"array","items":{"type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\.[a-z0-9][a-z0-9.-]{0,63}$","minLength":1},"description":"Single task id returned by POST /v1/uploads/presign."}},"required":["type","prompts","tasks"],"description":"video variant"}],"discriminator":{"propertyName":"type"},"title":"JobCreateRequest"},"AsyncAcceptedResponseType":{"type":"string","enum":["image","video"],"title":"AsyncAcceptedResponseType"},"TrialAcceptedOverview":{"type":"object","properties":{"remainingTokens":{"type":"integer","minimum":0},"expiresAt":{"type":"string","format":"date-time"}},"required":["remainingTokens","expiresAt"],"title":"TrialAcceptedOverview"},"AsyncAcceptedResponse":{"type":"object","properties":{"jobId":{"type":"string"},"type":{"$ref":"#/components/schemas/AsyncAcceptedResponseType"},"totalItems":{"type":"integer","minimum":1},"trial":{"$ref":"#/components/schemas/TrialAcceptedOverview"}},"required":["jobId","type","totalItems"],"title":"AsyncAcceptedResponse"},"AsyncJobStatusResponseType":{"type":"string","enum":["image","video"],"title":"AsyncJobStatusResponseType"},"JobTaskStatus":{"type":"object","properties":{"taskId":{"type":"string"},"status":{"$ref":"#/components/schemas/JobStatus"},"error":{"type":["string","null"]}},"required":["taskId","status"],"title":"JobTaskStatus"},"AsyncJobStatusResponse":{"type":"object","properties":{"jobId":{"type":"string"},"type":{"$ref":"#/components/schemas/AsyncJobStatusResponseType"},"processingMode":{"$ref":"#/components/schemas/ProcessingMode"},"status":{"$ref":"#/components/schemas/JobStatus"},"totalItems":{"type":"integer","minimum":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"error":{"type":["string","null"]},"tasks":{"type":"array","items":{"$ref":"#/components/schemas/JobTaskStatus"},"description":"Per-task results for the job"}},"required":["jobId","type","processingMode","status","totalItems","createdAt","updatedAt","tasks"],"title":"AsyncJobStatusResponse"},"ImageOutputManifestType":{"type":"string","enum":["image"],"title":"ImageOutputManifestType"},"ImageMask":{"type":"object","properties":{"maskIndex":{"type":"integer","minimum":0},"confidence":{"type":"number","format":"double","minimum":0},"url":{"type":"string","format":"uri"}},"required":["maskIndex","confidence","url"],"title":"ImageMask"},"ImageOutputItem":{"type":"object","properties":{"taskId":{"type":"string"},"inputId":{"type":"string"},"units":{"type":"integer","minimum":0},"generatedAt":{"type":"string","format":"date-time"},"previewUrl":{"type":"string","format":"uri"},"masks":{"type":"array","items":{"$ref":"#/components/schemas/ImageMask"}}},"required":["taskId","inputId","units","generatedAt","masks"],"title":"ImageOutputItem"},"VideoOutputManifestType":{"type":"string","enum":["video"],"title":"VideoOutputManifestType"},"VideoOutputCounts":{"type":"object","properties":{"framesProcessed":{"type":"integer","minimum":0},"framesWithMasks":{"type":"integer","minimum":0},"totalMasks":{"type":"integer","minimum":0}},"required":["framesProcessed","framesWithMasks","totalMasks"],"title":"VideoOutputCounts"},"VideoOutputItem":{"type":"object","properties":{"taskId":{"type":"string"},"inputId":{"type":"string"},"units":{"type":"integer","minimum":0},"generatedAt":{"type":"string","format":"date-time"},"previewUrl":{"type":"string","format":"uri"},"masks":{"type":"string","format":"uri"},"fps":{"type":"number","format":"double","exclusiveMinimum":0},"numFrames":{"type":"integer","minimum":1},"maxFrames":{"type":"integer","minimum":1},"scoreThreshold":{"type":"number","format":"double","minimum":0,"maximum":1},"counts":{"$ref":"#/components/schemas/VideoOutputCounts"}},"required":["taskId","inputId","units","generatedAt","masks","scoreThreshold","counts"],"title":"VideoOutputItem"},"OutputManifest":{"oneOf":[{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ImageOutputManifestType"},"jobId":{"type":"string"},"prompts":{"type":"array","items":{"type":"string"}},"items":{"type":"array","items":{"$ref":"#/components/schemas/ImageOutputItem"}}},"required":["type","jobId","prompts","items"],"description":"image variant"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/VideoOutputManifestType"},"jobId":{"type":"string"},"prompts":{"type":"array","items":{"type":"string"}},"items":{"type":"array","items":{"$ref":"#/components/schemas/VideoOutputItem"}}},"required":["type","jobId","prompts","items"],"description":"video variant"}],"discriminator":{"propertyName":"type"},"title":"OutputManifest"},"ResultAsset":{"type":"object","properties":{"key":{"type":"string","description":"Job-relative output asset key."},"url":{"type":"string","format":"uri"}},"required":["key","url"],"title":"ResultAsset"},"JobResultResponse":{"type":"object","properties":{"manifest":{"$ref":"#/components/schemas/OutputManifest"},"assets":{"type":"array","items":{"$ref":"#/components/schemas/ResultAsset"}},"expiresIn":{"type":"integer","minimum":60}},"required":["manifest","assets","expiresIn"],"title":"JobResultResponse"},"JobDownloadResponseStatus":{"type":"string","enum":["pending","processing","ready","failed"],"title":"JobDownloadResponseStatus"},"JobDownloadResponse":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"$ref":"#/components/schemas/JobDownloadResponseStatus"},"expiresAt":{"type":["string","null"],"format":"date-time"},"downloadUrl":{"type":["string","null"],"format":"uri"},"retryAfterSeconds":{"type":["integer","null"]},"error":{"type":["string","null"]}},"required":["jobId","status","expiresAt","downloadUrl","retryAfterSeconds","error"],"title":"JobDownloadResponse"},"Account":{"type":"object","properties":{"accountId":{"type":"string"},"email":{"type":"string"},"emailVerified":{"type":"boolean"},"image":{"type":["string","null"]},"name":{"type":"string"},"status":{"type":"string"}},"required":["accountId","email","emailVerified","name","status"],"title":"Account"},"BillingOverview":{"type":"object","properties":{"accessStatus":{"type":"string"},"currentPeriodEnd":{"type":"string"},"latestInvoiceStatus":{"type":"string"},"stripeSubscriptionStatus":{"type":"string"}},"title":"BillingOverview"},"AccessOverviewMode":{"type":"string","enum":["paid","trial","blocked"],"title":"AccessOverviewMode"},"AccessOverviewReason":{"type":"string","enum":["paid_access","trial_eligible","trial_active","trial_exhausted","trial_expired","billing_delinquent"],"title":"AccessOverviewReason"},"AccessOverview":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/AccessOverviewMode"},"reason":{"$ref":"#/components/schemas/AccessOverviewReason"},"canCreateJobs":{"type":"boolean"},"videoAllowed":{"type":"boolean"},"downloadsAllowed":{"type":"boolean"},"maxImageTasksPerJob":{"type":"integer"},"maxActiveJobs":{"type":"integer"}},"required":["mode","reason","canCreateJobs","videoAllowed","downloadsAllowed","maxImageTasksPerJob","maxActiveJobs"],"title":"AccessOverview"},"TrialOverviewStatus":{"type":"string","enum":["eligible","active","exhausted","expired"],"title":"TrialOverviewStatus"},"TrialOverview":{"type":"object","properties":{"offerVersion":{"type":"string"},"status":{"$ref":"#/components/schemas/TrialOverviewStatus"},"grantTokens":{"type":"integer"},"consumedTokens":{"type":"integer"},"remainingTokens":{"type":"integer","minimum":0},"durationDays":{"type":"integer"},"startedAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"activeJobId":{"type":["string","null"]}},"required":["offerVersion","status","grantTokens","consumedTokens","remainingTokens","durationDays","startedAt","expiresAt","activeJobId"],"title":"TrialOverview"},"AccountOverview":{"type":"object","properties":{"tokenUsageLast24h":{"type":"integer"},"billing":{"$ref":"#/components/schemas/BillingOverview"},"access":{"$ref":"#/components/schemas/AccessOverview"},"trial":{"$ref":"#/components/schemas/TrialOverview"}},"required":["tokenUsageLast24h","billing","access","trial"],"title":"AccountOverview"},"ApiKey":{"type":"object","properties":{"keyId":{"type":"string"},"label":{"type":"string"},"prefix":{"type":"string"},"revoked":{"type":"boolean"},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["keyId","label","prefix","revoked","createdAt","updatedAt"],"title":"ApiKey"},"ApiKeyList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}},"required":["items"],"title":"ApiKeyList"},"CreateApiKeyRequest":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":64}},"required":["label"],"title":"CreateApiKeyRequest"},"CreateApiKeyResponse":{"type":"object","properties":{"apiKey":{"$ref":"#/components/schemas/ApiKey"},"secret":{"type":"string"},"secretUnavailable":{"type":"boolean"}},"required":["apiKey","secretUnavailable"],"title":"CreateApiKeyResponse"},"ApiKeyMutation":{"type":"object","properties":{"apiKey":{"$ref":"#/components/schemas/ApiKey"}},"required":["apiKey"],"title":"ApiKeyMutation"},"BillingUrl":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"title":"BillingUrl"}},"securitySchemes":{"Authorizer":{"type":"http","scheme":"bearer","description":"Unrestricted secret `sk_live_...` or Cognito access token in `Authorization: Bearer ...`"}}}}