{"openapi":"3.1.0","info":{"title":"Apiframe API","version":"2.0.0","description":"Unified HTTP API for AI image, video and music generation across 60+ models. Submit a job, poll `GET /v2/jobs/{id}` (or wait for a webhook), and consume the result. See the official Node.js SDK at https://www.npmjs.com/package/@apiframe-ai/sdk.","termsOfService":"https://apiframe.ai/terms","license":{"name":"Proprietary"},"contact":{"name":"Apiframe Support","url":"https://apiframe.ai","email":"support@apiframe.ai"}},"servers":[{"url":"https://api.apiframe.ai","description":"Production"},{"url":"http://localhost:3000","description":"Local development"}],"tags":[{"name":"Account","description":"Caller info and curated model catalog."},{"name":"Models","description":"Public model catalog (no auth required)."},{"name":"Images","description":"Image generation, editing, upscaling, and background removal."},{"name":"Videos","description":"Video generation, editing, and upscaling."},{"name":"Music","description":"Music generation across Suno, Udio, Producer, Lyria, ElevenLabs."},{"name":"Jobs","description":"Job lifecycle — list, retrieve, status."},{"name":"Uploads","description":"Short-lived multipart uploads to the CDN for use as inputs."},{"name":"LoRAs","description":"Train and manage Flux LoRAs (replaces v1 AI Photos)."},{"name":"Assets","description":"Provider asset registration (Kie / Seedance flow)."}],"externalDocs":{"description":"Full developer documentation","url":"https://apiframe.ai/docs"},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key created in the Apiframe dashboard. Format: `afk_...`. Pass on every request as the `X-API-Key` header."},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Supabase JWT for first-party dashboard requests. SDK consumers should use `ApiKeyAuth` instead."}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional client-supplied key (max 255 chars). Replaying the same key within 24 hours returns the original job rather than creating a duplicate. Strongly recommended for any non-idempotent network: cron jobs, browser retries, mobile clients.","schema":{"type":"string","maxLength":255}}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"description":"Generic error envelope returned for most failure cases."},"ValidationError":{"type":"object","properties":{"error":{"type":"string"},"details":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Per-field validation errors keyed by JSON path."}},"required":["error"],"description":"Returned by every job-creating route when the request body fails Zod validation."},"InsufficientCredits":{"type":"object","properties":{"error":{"type":"string","enum":["Insufficient credits"]},"creditsRequired":{"type":"integer","minimum":0},"creditsAvailable":{"type":"integer","minimum":0}},"required":["error","creditsRequired","creditsAvailable"],"description":"Team does not have enough credits to run this job. The numbers are in the API’s smallest credit unit."},"JobAccepted":{"type":"object","properties":{"jobId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["QUEUED","PROCESSING","COMPLETED","FAILED"],"description":"Status at the moment the job record was persisted. Almost always `QUEUED`; idempotent replays may return the original status."}},"required":["jobId","status"],"description":"Returned by every successful job submission."},"Job":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["QUEUED","PROCESSING","COMPLETED","FAILED","CANCELLED"]},"model":{"type":"string"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100},"input":{"type":["object","null"],"additionalProperties":{}},"result":{},"error":{"type":["string","null"]},"creditCost":{"type":["integer","null"]},"webhookStatus":{"type":["string","null"],"enum":["pending","delivered","failed",null]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"expired":{"type":"boolean","description":"`true` once a COMPLETED job's CDN assets have been purged (default 24h retention). `result` URLs may 404."}},"required":["id","status","model","progress","error","creditCost","webhookStatus","createdAt","completedAt"],"description":"Generation job returned by `GET /v2/jobs` and `GET /v2/jobs/:id`."},"Me":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email"},"role":{"anyOf":[{"type":"string","enum":["ADMIN","MEMBER","OWNER"]},{"type":"string"}]}},"required":["id","email","role"]},"team":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"credits":{"type":"integer","minimum":0},"plan":{"type":"string"},"customerId":{"type":["string","null"]}},"required":["id","name","credits","plan","customerId"]},"apiKey":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"prefix":{"type":"string"}},"required":["id","name","prefix"]}},"required":["user","team","apiKey"],"description":"Authenticated caller — user, team and (when API-key auth is used) the key making the request."},"JobList":{"type":"object","properties":{"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["QUEUED","PROCESSING","COMPLETED","FAILED","CANCELLED"]},"model":{"type":"string"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100},"result":{},"error":{"type":["string","null"]},"creditCost":{"type":["integer","null"]},"webhookStatus":{"type":["string","null"],"enum":["pending","delivered","failed",null]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"expired":{"type":"boolean"}},"required":["id","status","model","progress","error","creditCost","webhookStatus","createdAt","completedAt","expired"]}},"nextCursor":{"type":["string","null"]},"hasMore":{"type":"boolean"},"models":{"type":"array","items":{"type":"string"}}},"required":["jobs","nextCursor","hasMore"],"description":"Paginated list of jobs scoped to the caller (or to the whole team for admins)."},"ModelCatalogEntry":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"modality":{"type":"string","enum":["image","video","music"]},"description":{"type":"string"},"pricingMode":{"type":"string","enum":["flat","per-second","per-output"]},"costMin":{"type":"number"},"costMax":{"type":"number"}},"required":["id","label","modality"],"additionalProperties":{},"description":"Curated, creator-facing model entry. Schema is intentionally loose — extra fields are allowed."},"ModelCatalog":{"type":"object","properties":{"models":{"type":"array","items":{"$ref":"#/components/schemas/ModelCatalogEntry"}}},"required":["models"]},"Upload":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"kind":{"type":"string","enum":["image","video","audio"]},"contentType":{"type":"string"},"byteSize":{"type":"integer","minimum":0},"expiresAt":{"type":"string","format":"date-time"}},"required":["id","url","kind","contentType","byteSize","expiresAt"],"description":"Short-lived CDN-hosted upload. The URL drops straight into any `start_image` / `image` / `video` field in the generation schemas."},"Lora":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"teamId":{"type":"string","format":"uuid"},"name":{"type":"string"},"subjectKind":{"type":"string","enum":["person","style","object"]},"gender":{"type":["string","null"]},"ethnicity":{"type":["string","null"]},"age":{"type":["string","null"]},"status":{"type":"string","enum":["PENDING","UPLOADING","TRAINING","READY","FAILED","ARCHIVED"]},"imageCount":{"type":"integer","minimum":0},"steps":{"type":"integer","minimum":500,"maximum":3000},"loraRank":{"type":"integer","minimum":8,"maximum":64},"isReady":{"type":"boolean"},"error":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"hasWeights":{"type":"boolean"},"triggerWord":{"type":["string","null"]}},"required":["id","userId","teamId","name","subjectKind","gender","ethnicity","age","status","imageCount","steps","loraRank","isReady","error","createdAt","startedAt","completedAt","hasWeights","triggerWord"],"description":"A user-trained Flux LoRA — the persistent artifact behind the AI Photos feature."},"LoraCreated":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["PENDING"]},"imageCount":{"type":"integer","minimum":15,"maximum":30}},"required":["id","status","imageCount"],"description":"Returned by `POST /v2/loras` once the upload has been spooled and training queued."},"LoraList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Lora"}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"AssetCreated":{"type":"object","properties":{"assetId":{"type":"string"}},"required":["assetId"]},"CreateAssetRequest":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"type":{"type":"string","enum":["image","video","audio"]}},"required":["url","type"]},"GenerateImageRequest":{"oneOf":[{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["midjourney"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"midjourneyParams":{"type":"object","properties":{"aspect_ratio":{"type":"string","pattern":"^\\d+:\\d+$"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["nano-banana"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"nanoBananaParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"output_format":{"type":"string","enum":["jpg","png","webp"]},"image_input":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":14},"resolution":{"type":"string","enum":["512px","1K","2K","4K"]},"google_search":{"type":"boolean"},"image_search":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["nano-banana-pro"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"nanoBananaParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"output_format":{"type":"string","enum":["jpg","png","webp"]},"image_input":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":14},"resolution":{"type":"string","enum":["512px","1K","2K","4K"]},"google_search":{"type":"boolean"},"image_search":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["nano-banana-2"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"nanoBananaParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"output_format":{"type":"string","enum":["jpg","png","webp"]},"image_input":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":14},"resolution":{"type":"string","enum":["512px","1K","2K","4K"]},"google_search":{"type":"boolean"},"image_search":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["flux-1.1-pro"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"fluxParams":{"type":"object","properties":{"aspect_ratio":{"type":"string","pattern":"^\\d+:\\d+$"},"output_format":{"type":"string","enum":["jpg","png","webp"]},"output_quality":{"type":"integer","minimum":0,"maximum":100},"seed":{"type":"integer"},"width":{"type":"integer","minimum":256,"maximum":2048},"height":{"type":"integer","minimum":256,"maximum":2048},"image_prompt":{"type":"string","format":"uri"},"image_prompt_strength":{"type":"number","minimum":0,"maximum":1},"raw":{"type":"boolean"},"input_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10},"resolution":{"type":"string"},"steps":{"type":"integer","minimum":1,"maximum":50},"guidance":{"type":"number","minimum":1.5,"maximum":10},"go_fast":{"type":"boolean"},"prompt_upsampling":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["flux-1.1-pro-ultra"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"fluxParams":{"type":"object","properties":{"aspect_ratio":{"type":"string","pattern":"^\\d+:\\d+$"},"output_format":{"type":"string","enum":["jpg","png","webp"]},"output_quality":{"type":"integer","minimum":0,"maximum":100},"seed":{"type":"integer"},"width":{"type":"integer","minimum":256,"maximum":2048},"height":{"type":"integer","minimum":256,"maximum":2048},"image_prompt":{"type":"string","format":"uri"},"image_prompt_strength":{"type":"number","minimum":0,"maximum":1},"raw":{"type":"boolean"},"input_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10},"resolution":{"type":"string"},"steps":{"type":"integer","minimum":1,"maximum":50},"guidance":{"type":"number","minimum":1.5,"maximum":10},"go_fast":{"type":"boolean"},"prompt_upsampling":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["flux-2-pro"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"fluxParams":{"type":"object","properties":{"aspect_ratio":{"type":"string","pattern":"^\\d+:\\d+$"},"output_format":{"type":"string","enum":["jpg","png","webp"]},"output_quality":{"type":"integer","minimum":0,"maximum":100},"seed":{"type":"integer"},"width":{"type":"integer","minimum":256,"maximum":2048},"height":{"type":"integer","minimum":256,"maximum":2048},"image_prompt":{"type":"string","format":"uri"},"image_prompt_strength":{"type":"number","minimum":0,"maximum":1},"raw":{"type":"boolean"},"input_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10},"steps":{"type":"integer","minimum":1,"maximum":50},"guidance":{"type":"number","minimum":1.5,"maximum":10},"go_fast":{"type":"boolean"},"prompt_upsampling":{"type":"boolean"},"resolution":{"type":"string","enum":["0.5MP","1MP","2MP","4MP","match_input_image"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["flux-2-dev"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"fluxParams":{"type":"object","properties":{"aspect_ratio":{"type":"string","pattern":"^\\d+:\\d+$"},"output_format":{"type":"string","enum":["jpg","png","webp"]},"output_quality":{"type":"integer","minimum":0,"maximum":100},"seed":{"type":"integer"},"width":{"type":"integer","minimum":256,"maximum":2048},"height":{"type":"integer","minimum":256,"maximum":2048},"image_prompt":{"type":"string","format":"uri"},"image_prompt_strength":{"type":"number","minimum":0,"maximum":1},"raw":{"type":"boolean"},"input_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10},"resolution":{"type":"string"},"steps":{"type":"integer","minimum":1,"maximum":50},"guidance":{"type":"number","minimum":1.5,"maximum":10},"go_fast":{"type":"boolean"},"prompt_upsampling":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["flux-2-flex"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"fluxParams":{"type":"object","properties":{"aspect_ratio":{"type":"string","pattern":"^\\d+:\\d+$"},"output_format":{"type":"string","enum":["jpg","png","webp"]},"output_quality":{"type":"integer","minimum":0,"maximum":100},"seed":{"type":"integer"},"width":{"type":"integer","minimum":256,"maximum":2048},"height":{"type":"integer","minimum":256,"maximum":2048},"image_prompt":{"type":"string","format":"uri"},"image_prompt_strength":{"type":"number","minimum":0,"maximum":1},"raw":{"type":"boolean"},"input_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10},"steps":{"type":"integer","minimum":1,"maximum":50},"guidance":{"type":"number","minimum":1.5,"maximum":10},"go_fast":{"type":"boolean"},"prompt_upsampling":{"type":"boolean"},"resolution":{"type":"string","enum":["0.5MP","1MP","2MP","4MP","match_input_image"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["flux-2-max"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"fluxParams":{"type":"object","properties":{"aspect_ratio":{"type":"string","pattern":"^\\d+:\\d+$"},"output_format":{"type":"string","enum":["jpg","png","webp"]},"output_quality":{"type":"integer","minimum":0,"maximum":100},"seed":{"type":"integer"},"width":{"type":"integer","minimum":256,"maximum":2048},"height":{"type":"integer","minimum":256,"maximum":2048},"image_prompt":{"type":"string","format":"uri"},"image_prompt_strength":{"type":"number","minimum":0,"maximum":1},"raw":{"type":"boolean"},"input_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10},"steps":{"type":"integer","minimum":1,"maximum":50},"guidance":{"type":"number","minimum":1.5,"maximum":10},"go_fast":{"type":"boolean"},"prompt_upsampling":{"type":"boolean"},"resolution":{"type":"string","enum":["0.5MP","1MP","2MP","4MP","match_input_image"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["seedream-3"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"seedreamParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"seed":{"type":"integer"},"size":{"type":"string"},"width":{"type":"integer","minimum":512,"maximum":4096},"height":{"type":"integer","minimum":512,"maximum":4096},"guidance_scale":{"type":"number","minimum":1,"maximum":10},"resolution":{"type":"string"},"use_pre_llm":{"type":"boolean"},"enhance_prompt":{"type":"boolean"},"image_input":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":14},"output_format":{"type":"string","enum":["jpg","png"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["seedream-3.1"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"seedreamParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"seed":{"type":"integer"},"size":{"type":"string"},"width":{"type":"integer","minimum":512,"maximum":4096},"height":{"type":"integer","minimum":512,"maximum":4096},"guidance_scale":{"type":"number","minimum":1,"maximum":10},"resolution":{"type":"string"},"use_pre_llm":{"type":"boolean"},"enhance_prompt":{"type":"boolean"},"image_input":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":14},"output_format":{"type":"string","enum":["jpg","png"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["seedream-4"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"seedreamParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"seed":{"type":"integer"},"size":{"type":"string"},"width":{"type":"integer","minimum":512,"maximum":4096},"height":{"type":"integer","minimum":512,"maximum":4096},"guidance_scale":{"type":"number","minimum":1,"maximum":10},"resolution":{"type":"string"},"use_pre_llm":{"type":"boolean"},"enhance_prompt":{"type":"boolean"},"image_input":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":14},"output_format":{"type":"string","enum":["jpg","png"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["seedream-4.5"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"seedreamParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"seed":{"type":"integer"},"size":{"type":"string"},"width":{"type":"integer","minimum":512,"maximum":4096},"height":{"type":"integer","minimum":512,"maximum":4096},"guidance_scale":{"type":"number","minimum":1,"maximum":10},"resolution":{"type":"string"},"use_pre_llm":{"type":"boolean"},"enhance_prompt":{"type":"boolean"},"image_input":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":14},"output_format":{"type":"string","enum":["jpg","png"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["seedream-5-lite"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"seedreamParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"seed":{"type":"integer"},"size":{"type":"string"},"width":{"type":"integer","minimum":512,"maximum":4096},"height":{"type":"integer","minimum":512,"maximum":4096},"guidance_scale":{"type":"number","minimum":1,"maximum":10},"resolution":{"type":"string"},"use_pre_llm":{"type":"boolean"},"enhance_prompt":{"type":"boolean"},"image_input":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":14},"output_format":{"type":"string","enum":["jpg","png"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["ideogram-v2"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"ideogramParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"resolution":{"type":"string"},"seed":{"type":"integer"},"style_type":{"type":"string"},"magic_prompt_option":{"type":"string","enum":["Auto","On","Off"]},"negative_prompt":{"type":"string"},"image":{"type":"string","format":"uri"},"mask":{"type":"string","format":"uri"},"style_preset":{"type":"string"},"style_reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3},"rendering_speed":{"type":"string","enum":["default","turbo","quality"]},"character_reference_image":{"type":"string","format":"uri"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["ideogram-v2-turbo"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"ideogramParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"resolution":{"type":"string"},"seed":{"type":"integer"},"style_type":{"type":"string"},"magic_prompt_option":{"type":"string","enum":["Auto","On","Off"]},"negative_prompt":{"type":"string"},"image":{"type":"string","format":"uri"},"mask":{"type":"string","format":"uri"},"style_preset":{"type":"string"},"style_reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3},"rendering_speed":{"type":"string","enum":["default","turbo","quality"]},"character_reference_image":{"type":"string","format":"uri"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["ideogram-v2a"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"ideogramParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"resolution":{"type":"string"},"seed":{"type":"integer"},"style_type":{"type":"string"},"magic_prompt_option":{"type":"string","enum":["Auto","On","Off"]},"negative_prompt":{"type":"string"},"image":{"type":"string","format":"uri"},"mask":{"type":"string","format":"uri"},"style_preset":{"type":"string"},"style_reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3},"rendering_speed":{"type":"string","enum":["default","turbo","quality"]},"character_reference_image":{"type":"string","format":"uri"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["ideogram-v2a-turbo"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"ideogramParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"resolution":{"type":"string"},"seed":{"type":"integer"},"style_type":{"type":"string"},"magic_prompt_option":{"type":"string","enum":["Auto","On","Off"]},"negative_prompt":{"type":"string"},"image":{"type":"string","format":"uri"},"mask":{"type":"string","format":"uri"},"style_preset":{"type":"string"},"style_reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3},"rendering_speed":{"type":"string","enum":["default","turbo","quality"]},"character_reference_image":{"type":"string","format":"uri"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["ideogram-v3-balanced"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"ideogramParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"resolution":{"type":"string"},"seed":{"type":"integer"},"style_type":{"type":"string"},"magic_prompt_option":{"type":"string","enum":["Auto","On","Off"]},"negative_prompt":{"type":"string"},"image":{"type":"string","format":"uri"},"mask":{"type":"string","format":"uri"},"style_preset":{"type":"string"},"style_reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3},"rendering_speed":{"type":"string","enum":["default","turbo","quality"]},"character_reference_image":{"type":"string","format":"uri"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["ideogram-v3-turbo"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"ideogramParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"resolution":{"type":"string"},"seed":{"type":"integer"},"style_type":{"type":"string"},"magic_prompt_option":{"type":"string","enum":["Auto","On","Off"]},"negative_prompt":{"type":"string"},"image":{"type":"string","format":"uri"},"mask":{"type":"string","format":"uri"},"style_preset":{"type":"string"},"style_reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3},"rendering_speed":{"type":"string","enum":["default","turbo","quality"]},"character_reference_image":{"type":"string","format":"uri"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["ideogram-v3-quality"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"ideogramParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"resolution":{"type":"string"},"seed":{"type":"integer"},"style_type":{"type":"string"},"magic_prompt_option":{"type":"string","enum":["Auto","On","Off"]},"negative_prompt":{"type":"string"},"image":{"type":"string","format":"uri"},"mask":{"type":"string","format":"uri"},"style_preset":{"type":"string"},"style_reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3},"rendering_speed":{"type":"string","enum":["default","turbo","quality"]},"character_reference_image":{"type":"string","format":"uri"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["ideogram-character"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"ideogramParams":{"type":"object","properties":{"aspect_ratio":{"type":"string"},"resolution":{"type":"string"},"seed":{"type":"integer"},"style_type":{"type":"string"},"magic_prompt_option":{"type":"string","enum":["Auto","On","Off"]},"negative_prompt":{"type":"string"},"image":{"type":"string","format":"uri"},"mask":{"type":"string","format":"uri"},"style_preset":{"type":"string"},"style_reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3},"rendering_speed":{"type":"string","enum":["default","turbo","quality"]},"character_reference_image":{"type":"string","format":"uri"}},"required":["character_reference_image"],"additionalProperties":false}},"required":["prompt","model","ideogramParams"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["imagen-3"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"imagenParams":{"type":"object","properties":{"aspect_ratio":{"type":"string","enum":["1:1","9:16","16:9","3:4","4:3"]},"output_format":{"type":"string","enum":["jpg","png"]},"image_size":{"type":"string","enum":["1K","2K"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["imagen-3-fast"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"imagenParams":{"type":"object","properties":{"aspect_ratio":{"type":"string","enum":["1:1","9:16","16:9","3:4","4:3"]},"output_format":{"type":"string","enum":["jpg","png"]},"image_size":{"type":"string","enum":["1K","2K"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["imagen-4"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"imagenParams":{"type":"object","properties":{"aspect_ratio":{"type":"string","enum":["1:1","9:16","16:9","3:4","4:3"]},"output_format":{"type":"string","enum":["jpg","png"]},"image_size":{"type":"string","enum":["1K","2K"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["imagen-4-ultra"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"imagenParams":{"type":"object","properties":{"aspect_ratio":{"type":"string","enum":["1:1","9:16","16:9","3:4","4:3"]},"output_format":{"type":"string","enum":["jpg","png"]},"image_size":{"type":"string","enum":["1K","2K"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["imagen-4-fast"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"imagenParams":{"type":"object","properties":{"aspect_ratio":{"type":"string","enum":["1:1","9:16","16:9","3:4","4:3"]},"output_format":{"type":"string","enum":["jpg","png"]},"image_size":{"type":"string","enum":["1K","2K"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["dall-e-3"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"dalleParams":{"type":"object","properties":{"aspect_ratio":{"type":"string","enum":["1:1","3:2","2:3"]},"style":{"type":"string","enum":["vivid","natural"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["dall-e-2"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"dalleParams":{"type":"object","properties":{"aspect_ratio":{"type":"string","enum":["1:1","3:2","2:3"]},"style":{"type":"string","enum":["vivid","natural"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["gpt-image-1.5"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"gptImageParams":{"type":"object","properties":{"quality":{"type":"string","enum":["low","medium","high","auto"]},"aspect_ratio":{"type":"string","enum":["1:1","3:2","2:3"]},"output_format":{"type":"string","enum":["png","jpeg","webp"]},"background":{"type":"string","enum":["auto","transparent","opaque"]},"input_images":{"type":["array","null"],"items":{"type":"string","format":"uri"}},"input_fidelity":{"type":"string","enum":["low","high"]},"number_of_images":{"type":"integer","minimum":1,"maximum":10}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["gpt-image-2"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"gptImage2Params":{"type":"object","properties":{"quality":{"type":"string","enum":["low","medium","high","auto"]},"aspect_ratio":{"type":"string","enum":["1:1","3:2","2:3"]},"output_format":{"type":"string","enum":["png","jpeg","webp"]},"background":{"type":"string","enum":["auto","opaque"]},"moderation":{"type":"string","enum":["auto","low"]},"input_images":{"type":["array","null"],"items":{"type":"string","format":"uri"}},"number_of_images":{"type":"integer","minimum":1,"maximum":10}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["kling-image"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"klingImageParams":{"type":"object","properties":{"model_name":{"type":"string","enum":["kling-v1","kling-v1-5","kling-v2"]},"negative_prompt":{"type":"string","maxLength":2500},"image":{"type":"string","format":"uri"},"image_fidelity":{"type":"number","minimum":0,"maximum":1},"n":{"type":"integer","minimum":1,"maximum":4},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4","3:2","2:3"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["qwen-image"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"qwenImageParams":{"type":"object","properties":{"task_type":{"type":"string","enum":["text-to-image","image-to-image","image-edit"]},"image_url":{"type":"string","format":"uri"},"image_size":{"type":"string","enum":["square","square_hd","portrait_4_3","portrait_16_9","landscape_4_3","landscape_16_9"]},"negative_prompt":{"type":"string","maxLength":500},"output_format":{"type":"string","enum":["png","jpeg"]},"seed":{"type":"integer"},"num_inference_steps":{"type":"integer","minimum":2,"maximum":250},"guidance_scale":{"type":"number","minimum":0,"maximum":20},"acceleration":{"type":"string","enum":["none","regular","high"]},"strength":{"type":"number","minimum":0,"maximum":1},"num_images":{"type":"integer","minimum":1,"maximum":4}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["qwen-image-2"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"qwenImage2Params":{"type":"object","properties":{"image":{"type":"string","format":"uri"},"aspect_ratio":{"type":"string","enum":["1:1","2:3","3:2","3:4","4:3","9:16","16:9","21:9","2:1","1:2"]},"negative_prompt":{"type":"string","maxLength":500},"seed":{"type":"integer"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["qwen-image-2-pro"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"qwenImage2Params":{"type":"object","properties":{"image":{"type":"string","format":"uri"},"aspect_ratio":{"type":"string","enum":["1:1","2:3","3:2","3:4","4:3","9:16","16:9","21:9","2:1","1:2"]},"negative_prompt":{"type":"string","maxLength":500},"seed":{"type":"integer"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["wan-image-2.6"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"wanImageParams":{"type":"object","properties":{"image":{"type":"string","format":"uri"},"aspect_ratio":{"type":"string","enum":["1:1","2:3","3:2","3:4","4:3","9:16","16:9","21:9"]},"negative_prompt":{"type":"string","maxLength":500},"seed":{"type":"integer","minimum":0,"maximum":2147483647},"prompt_extend":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":5000},"model":{"type":"string","enum":["wan-image-2.7"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"wanImage27Params":{"type":"object","properties":{"image":{"type":"string","format":"uri"},"aspect_ratio":{"type":"string","enum":["1:1","2:3","3:2","3:4","4:3","9:16","16:9","21:9"]},"seed":{"type":"integer","minimum":0,"maximum":2147483647},"thinking_mode":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":5000},"model":{"type":"string","enum":["wan-image-2.7-pro"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"wanImage27Params":{"type":"object","properties":{"image":{"type":"string","format":"uri"},"aspect_ratio":{"type":"string","enum":["1:1","2:3","3:2","3:4","4:3","9:16","16:9","21:9"]},"seed":{"type":"integer","minimum":0,"maximum":2147483647},"thinking_mode":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["grok-imagine-image"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"grokImagineParams":{"type":"object","properties":{"image":{"type":"string","format":"uri"},"aspect_ratio":{"type":"string","enum":["1:1","2:3","3:2","16:9","9:16"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["reve-create"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"reveParams":{"type":"object","properties":{"aspect_ratio":{"type":"string","enum":["16:9","9:16","3:2","2:3","4:3","3:4","1:1"]},"seed":{"type":"integer"},"version":{"type":"string"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["flux-lora"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"fluxLoraParams":{"type":"object","properties":{"loraId":{"type":"string","format":"uuid"},"num_outputs":{"type":"integer","minimum":1,"maximum":4},"aspect_ratio":{"type":"string","enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3"]},"output_format":{"type":"string","enum":["png","jpg","webp"]},"lora_strength":{"type":"number","minimum":0,"maximum":1.5},"guidance_scale":{"type":"number","minimum":1,"maximum":10},"num_inference_steps":{"type":"integer","minimum":4,"maximum":50},"seed":{"type":"integer"}},"required":["loraId"],"additionalProperties":false}},"required":["prompt","model","fluxLoraParams"],"additionalProperties":false}],"description":"Discriminated by `model`. Each model gates a specific `<model>Params` block (Midjourney, Flux, Seedream, Ideogram, Imagen, DALL-E, GPT Image, Kling Image, Qwen, Wan, Grok, Reve, Nano Banana, Flux LoRA)."},"ImageUpscaleRequest":{"oneOf":[{"type":"object","properties":{"model":{"type":"string","enum":["topaz-image-upscale"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"topazUpscaleParams":{"type":"object","properties":{"image":{"type":"string","format":"uri"},"model_type":{"type":"string","enum":["standard-v2","low-res-v2","cgi","high-fidelity-v2","text-refine","redefine"]},"upscale_factor":{"anyOf":[{"type":"number","enum":[1]},{"type":"number","enum":[2]},{"type":"number","enum":[4]},{"type":"number","enum":[6]}]},"face_enhance":{"type":"boolean"},"face_enhance_strength":{"type":"number","minimum":0,"maximum":1},"face_enhance_creativity":{"type":"number","minimum":0,"maximum":1},"output_format":{"type":"string","enum":["jpg","png"]},"seed":{"type":"integer"}},"required":["image"],"additionalProperties":false}},"required":["model","topazUpscaleParams"],"additionalProperties":false},{"type":"object","properties":{"model":{"type":"string","enum":["clarity-upscale"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"clarityUpscaleParams":{"type":"object","properties":{"image":{"type":"string","format":"uri"},"prompt":{"type":"string","maxLength":2000},"negative_prompt":{"type":"string","maxLength":2000},"scale_factor":{"anyOf":[{"type":"number","enum":[1]},{"type":"number","enum":[2]},{"type":"number","enum":[4]},{"type":"number","enum":[8]}]},"creativity":{"type":"number","minimum":0,"maximum":1},"resemblance":{"type":"number","minimum":0,"maximum":3},"dynamic":{"type":"number","minimum":1,"maximum":50},"num_inference_steps":{"type":"integer","minimum":1,"maximum":100},"seed":{"type":"integer"},"output_format":{"type":"string","enum":["png","jpg","webp"]},"sharpen":{"type":"number","minimum":0,"maximum":10}},"required":["image"],"additionalProperties":false}},"required":["model","clarityUpscaleParams"],"additionalProperties":false}],"description":"Image upscale via Topaz (per-megapixel) or Clarity (flat)."},"ImageEditRequest":{"oneOf":[{"type":"object","properties":{"model":{"type":"string","enum":["flux-fill-pro"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"fluxFillParams":{"type":"object","properties":{"image":{"type":"string","format":"uri"},"prompt":{"type":"string","minLength":1,"maxLength":2000},"mode":{"type":"string","enum":["inpaint","outpaint"]},"mask":{"type":"string","format":"uri"},"outpaint":{"type":"string","enum":["Zoom out 1.5x","Zoom out 2x","Make square","Left outpaint","Right outpaint","Top outpaint","Bottom outpaint"]},"steps":{"type":"integer","minimum":1,"maximum":50},"guidance":{"type":"number","minimum":2,"maximum":5},"safety_tolerance":{"type":"integer","minimum":1,"maximum":6},"output_format":{"type":"string","enum":["jpg","png"]},"seed":{"type":"integer"},"prompt_upsampling":{"type":"boolean"}},"required":["image","prompt","mode"],"additionalProperties":false}},"required":["model","fluxFillParams"],"additionalProperties":false}],"description":"Inpaint or outpaint via Flux Fill Pro."},"ImageBackgroundRemoveRequest":{"oneOf":[{"type":"object","properties":{"model":{"type":"string","enum":["bria-bg-remove"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"briaBgRemoveParams":{"type":"object","properties":{"image":{"type":"string","format":"uri"},"content_moderation":{"type":"boolean"}},"required":["image"],"additionalProperties":false}},"required":["model","briaBgRemoveParams"],"additionalProperties":false},{"type":"object","properties":{"model":{"type":"string","enum":["851-bg-remove"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"lab851BgRemoveParams":{"type":"object","properties":{"image":{"type":"string","format":"uri"},"format":{"type":"string","enum":["png","jpg"]},"threshold":{"type":"number","minimum":0,"maximum":1},"reverse":{"type":"boolean"},"background_type":{"type":"string","enum":["rgba","map","green","white","blur","overlay"]}},"required":["image"],"additionalProperties":false}},"required":["model","lab851BgRemoveParams"],"additionalProperties":false}],"description":"Background removal via Bria RMBG 2.0 or 851-labs."},"GenerateVideoRequest":{"oneOf":[{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["kling-2.1"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"klingParams":{"type":"object","properties":{"start_image":{"type":"string","format":"uri"},"end_image":{"type":"string","format":"uri"},"negative_prompt":{"type":"string","maxLength":2500},"mode":{"type":"string","enum":["standard","pro"]},"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[10]}]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["kling-2.1-master"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"klingParams":{"type":"object","properties":{"start_image":{"type":"string","format":"uri"},"negative_prompt":{"type":"string","maxLength":2500},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"]},"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[10]}]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["kling-2.5-turbo-pro"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"klingParams":{"type":"object","properties":{"start_image":{"type":"string","format":"uri"},"end_image":{"type":"string","format":"uri"},"negative_prompt":{"type":"string","maxLength":2500},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"]},"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[10]}]},"guidance_scale":{"type":"number","minimum":0,"maximum":1}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["kling-2.6"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"klingParams":{"type":"object","properties":{"start_image":{"type":"string","format":"uri"},"negative_prompt":{"type":"string","maxLength":2500},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"]},"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[10]}]},"generate_audio":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["kling-3.0"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"klingParams":{"type":"object","properties":{"start_image":{"type":"string","format":"uri"},"end_image":{"type":"string","format":"uri"},"negative_prompt":{"type":"string","maxLength":2500},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"]},"duration":{"type":"integer","minimum":3,"maximum":15},"mode":{"type":"string","enum":["standard","pro","4k"]},"generate_audio":{"type":"boolean"},"multi_prompt":{"type":"string"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["sora-2"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"soraParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[4]},{"type":"number","enum":[8]},{"type":"number","enum":[10]},{"type":"number","enum":[12]},{"type":"number","enum":[15]}]},"aspect_ratio":{"anyOf":[{"type":"string","enum":["16:9"]},{"type":"string","enum":["9:16"]}]},"resolution":{"type":"string","enum":["standard","high"]},"start_image":{"type":"string","format":"uri"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["sora-2-pro"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"soraParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[4]},{"type":"number","enum":[8]},{"type":"number","enum":[10]},{"type":"number","enum":[12]},{"type":"number","enum":[15]}]},"aspect_ratio":{"anyOf":[{"type":"string","enum":["16:9"]},{"type":"string","enum":["9:16"]}]},"resolution":{"type":"string","enum":["standard","high"]},"start_image":{"type":"string","format":"uri"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["seedance-1-lite"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"seedanceParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[10]}]},"aspect_ratio":{"anyOf":[{"type":"string","enum":["21:9"]},{"type":"string","enum":["16:9"]},{"type":"string","enum":["4:3"]},{"type":"string","enum":["1:1"]},{"type":"string","enum":["3:4"]},{"type":"string","enum":["9:16"]},{"type":"string","enum":["9:21"]}]},"resolution":{"type":"string","enum":["480p","720p","1080p"]},"start_image":{"type":"string","format":"uri"},"end_image":{"type":"string","format":"uri"},"seed":{"type":"integer"},"camera_fixed":{"type":"boolean"},"generate_audio":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["seedance-1-pro"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"seedanceParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[10]}]},"aspect_ratio":{"anyOf":[{"type":"string","enum":["21:9"]},{"type":"string","enum":["16:9"]},{"type":"string","enum":["4:3"]},{"type":"string","enum":["1:1"]},{"type":"string","enum":["3:4"]},{"type":"string","enum":["9:16"]},{"type":"string","enum":["9:21"]}]},"resolution":{"type":"string","enum":["480p","720p","1080p"]},"start_image":{"type":"string","format":"uri"},"end_image":{"type":"string","format":"uri"},"seed":{"type":"integer"},"camera_fixed":{"type":"boolean"},"generate_audio":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["seedance-1-pro-fast"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"seedanceParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[10]}]},"aspect_ratio":{"anyOf":[{"type":"string","enum":["21:9"]},{"type":"string","enum":["16:9"]},{"type":"string","enum":["4:3"]},{"type":"string","enum":["1:1"]},{"type":"string","enum":["3:4"]},{"type":"string","enum":["9:16"]},{"type":"string","enum":["9:21"]}]},"resolution":{"type":"string","enum":["480p","720p","1080p"]},"start_image":{"type":"string","format":"uri"},"end_image":{"type":"string","format":"uri"},"seed":{"type":"integer"},"camera_fixed":{"type":"boolean"},"generate_audio":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["seedance-1.5-pro"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"seedanceParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[4]},{"type":"number","enum":[8]},{"type":"number","enum":[12]}]},"aspect_ratio":{"anyOf":[{"type":"string","enum":["21:9"]},{"type":"string","enum":["16:9"]},{"type":"string","enum":["4:3"]},{"type":"string","enum":["1:1"]},{"type":"string","enum":["3:4"]},{"type":"string","enum":["9:16"]}]},"resolution":{"type":"string","enum":["480p","720p","1080p"]},"start_image":{"type":"string","format":"uri"},"end_image":{"type":"string","format":"uri"},"seed":{"type":"integer"},"camera_fixed":{"type":"boolean"},"generate_audio":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["seedance-2"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"seedanceParams":{"type":"object","properties":{"duration":{"type":"integer","minimum":4,"maximum":15},"aspect_ratio":{"anyOf":[{"type":"string","enum":["21:9"]},{"type":"string","enum":["16:9"]},{"type":"string","enum":["4:3"]},{"type":"string","enum":["1:1"]},{"type":"string","enum":["3:4"]},{"type":"string","enum":["9:16"]},{"type":"string","enum":["adaptive"]}]},"start_image":{"type":"string","format":"uri"},"end_image":{"type":"string","format":"uri"},"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":9},"reference_video_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3},"reference_audio_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3},"generate_audio":{"type":"boolean"},"return_last_frame":{"type":"boolean"},"web_search":{"type":"boolean"},"seed":{"type":"integer"},"camera_fixed":{"type":"boolean"},"resolution":{"type":"string","enum":["480p","720p","1080p"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["seedance-2-fast"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"seedanceParams":{"type":"object","properties":{"duration":{"type":"integer","minimum":4,"maximum":15},"aspect_ratio":{"anyOf":[{"type":"string","enum":["21:9"]},{"type":"string","enum":["16:9"]},{"type":"string","enum":["4:3"]},{"type":"string","enum":["1:1"]},{"type":"string","enum":["3:4"]},{"type":"string","enum":["9:16"]},{"type":"string","enum":["adaptive"]}]},"start_image":{"type":"string","format":"uri"},"end_image":{"type":"string","format":"uri"},"reference_image_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":9},"reference_video_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3},"reference_audio_urls":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3},"generate_audio":{"type":"boolean"},"return_last_frame":{"type":"boolean"},"web_search":{"type":"boolean"},"seed":{"type":"integer"},"camera_fixed":{"type":"boolean"},"resolution":{"type":"string","enum":["480p","720p"]}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["midjourney-video"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"midjourneyVideoParams":{"type":"object","properties":{"start_image":{"type":"string","format":"uri"},"motion":{"type":"string","enum":["low","high"]},"resolution":{"type":"string","enum":["sd","hd"]}},"required":["start_image"],"additionalProperties":false}},"required":["prompt","model","midjourneyVideoParams"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["veo-2"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"veoParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[6]},{"type":"number","enum":[7]},{"type":"number","enum":[8]}]},"aspect_ratio":{"type":"string","pattern":"^\\d+:\\d+$"},"seed":{"type":"integer"},"image":{"type":"string","format":"uri"},"resolution":{"type":"string","enum":["720p","1080p"]},"generate_audio":{"type":"boolean"},"negative_prompt":{"type":"string","maxLength":2000},"last_frame":{"type":"string","format":"uri"},"reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["veo-3"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"veoParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[4]},{"type":"number","enum":[6]},{"type":"number","enum":[8]}]},"aspect_ratio":{"type":"string","pattern":"^\\d+:\\d+$"},"seed":{"type":"integer"},"image":{"type":"string","format":"uri"},"resolution":{"type":"string","enum":["720p","1080p"]},"generate_audio":{"type":"boolean"},"negative_prompt":{"type":"string","maxLength":2000},"last_frame":{"type":"string","format":"uri"},"reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["veo-3-fast"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"veoParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[4]},{"type":"number","enum":[6]},{"type":"number","enum":[8]}]},"aspect_ratio":{"type":"string","pattern":"^\\d+:\\d+$"},"seed":{"type":"integer"},"image":{"type":"string","format":"uri"},"resolution":{"type":"string","enum":["720p","1080p"]},"generate_audio":{"type":"boolean"},"negative_prompt":{"type":"string","maxLength":2000},"last_frame":{"type":"string","format":"uri"},"reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["veo-3.1"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"veoParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[4]},{"type":"number","enum":[6]},{"type":"number","enum":[8]}]},"aspect_ratio":{"type":"string","pattern":"^\\d+:\\d+$"},"seed":{"type":"integer"},"image":{"type":"string","format":"uri"},"resolution":{"type":"string","enum":["720p","1080p"]},"generate_audio":{"type":"boolean"},"negative_prompt":{"type":"string","maxLength":2000},"last_frame":{"type":"string","format":"uri"},"reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["veo-3.1-fast"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"veoParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[4]},{"type":"number","enum":[6]},{"type":"number","enum":[8]}]},"aspect_ratio":{"type":"string","pattern":"^\\d+:\\d+$"},"seed":{"type":"integer"},"image":{"type":"string","format":"uri"},"resolution":{"type":"string","enum":["720p","1080p"]},"generate_audio":{"type":"boolean"},"negative_prompt":{"type":"string","maxLength":2000},"last_frame":{"type":"string","format":"uri"},"reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":3}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":5000},"model":{"type":"string","enum":["grok-imagine-video"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"grokImagineVideoParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[6]},{"type":"number","enum":[10]},{"type":"number","enum":[15]}]},"aspect_ratio":{"type":"string","enum":["1:1","16:9","9:16","4:3","3:4","3:2","2:3"]},"reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":7}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["hailuo-02"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"hailuoParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[6]},{"type":"number","enum":[10]}]},"resolution":{"type":"string","enum":["768p","1080p"]},"image":{"type":"string","format":"uri"},"prompt_optimizer":{"type":"boolean"},"end_image":{"type":"string","format":"uri"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["hailuo-2.3"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"hailuoParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[6]},{"type":"number","enum":[10]}]},"resolution":{"type":"string","enum":["768p","1080p"]},"image":{"type":"string","format":"uri"},"prompt_optimizer":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":2000},"model":{"type":"string","enum":["hailuo-2.3-fast"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"hailuoParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[6]},{"type":"number","enum":[10]}]},"resolution":{"type":"string","enum":["768p","1080p"]},"image":{"type":"string","format":"uri"},"prompt_optimizer":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["luma-ray-2"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"lumaParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[9]}]},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4","21:9"]},"start_image":{"type":"string","format":"uri"},"end_image":{"type":"string","format":"uri"},"loop":{"type":"boolean"},"concepts":{"type":"array","items":{"type":"string","enum":["truck_left","truck_right","pan_left","pan_right","pedestal_up","pedestal_down","tilt_up","tilt_down","roll_left","roll_right","zoom_in","zoom_out","push_in","pull_out","dolly_zoom","orbit_left","orbit_right","crane_up","crane_down","aerial","aerial_drone","low_angle","high_angle","eye_level","ground_level","over_the_shoulder","pov","selfie","handheld","static","bolt_cam","overhead","elevator_doors","tiny_planet"]}}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["luma-ray-flash-2"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"lumaParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[9]}]},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4","21:9"]},"start_image":{"type":"string","format":"uri"},"end_image":{"type":"string","format":"uri"},"loop":{"type":"boolean"},"concepts":{"type":"array","items":{"type":"string","enum":["truck_left","truck_right","pan_left","pan_right","pedestal_up","pedestal_down","tilt_up","tilt_down","roll_left","roll_right","zoom_in","zoom_out","push_in","pull_out","dolly_zoom","orbit_left","orbit_right","crane_up","crane_down","aerial","aerial_drone","low_angle","high_angle","eye_level","ground_level","over_the_shoulder","pov","selfie","handheld","static","bolt_cam","overhead","elevator_doors","tiny_planet"]}}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["wan-2.5"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"wanParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[10]}]},"image":{"type":"string","format":"uri"},"negative_prompt":{"type":"string","maxLength":2500},"resolution":{"type":"string","enum":["480p","720p","1080p"]},"audio":{"type":"string","format":"uri"},"seed":{"type":"integer"},"enable_prompt_expansion":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["wan-2.5-fast"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"wanParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[10]}]},"image":{"type":"string","format":"uri"},"negative_prompt":{"type":"string","maxLength":2500},"resolution":{"type":"string","enum":["720p","1080p"]},"audio":{"type":"string","format":"uri"},"seed":{"type":"integer"},"enable_prompt_expansion":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["wan-2.6"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"wanParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[10]},{"type":"number","enum":[15]}]},"multi_shots":{"type":"boolean"},"image":{"type":"string","format":"uri"},"negative_prompt":{"type":"string","maxLength":2500},"resolution":{"type":"string","enum":["720p","1080p"]},"audio":{"type":"string","format":"uri"},"seed":{"type":"integer"},"enable_prompt_expansion":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["wan-2.6-flash"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"wanParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[10]},{"type":"number","enum":[15]}]},"multi_shots":{"type":"boolean"},"audio_enabled":{"type":"boolean"},"image":{"type":"string","format":"uri"},"negative_prompt":{"type":"string","maxLength":2500},"resolution":{"type":"string","enum":["720p","1080p"]},"audio":{"type":"string","format":"uri"},"seed":{"type":"integer"},"enable_prompt_expansion":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":5000},"model":{"type":"string","enum":["wan-2.7"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"wan27Params":{"type":"object","properties":{"image":{"type":"string","format":"uri"},"last_frame":{"type":"string","format":"uri"},"first_clip":{"type":"string","format":"uri"},"audio":{"type":"string","format":"uri"},"negative_prompt":{"type":"string","maxLength":2500},"resolution":{"type":"string","enum":["720p","1080p"]},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4"]},"duration":{"type":"integer","minimum":2,"maximum":15},"enable_prompt_expansion":{"type":"boolean"},"seed":{"type":"integer"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":5000},"model":{"type":"string","enum":["wan-2.7-r2v"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"wan27R2vParams":{"type":"object","properties":{"reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":5},"reference_videos":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":5},"negative_prompt":{"type":"string","maxLength":2500},"resolution":{"type":"string","enum":["720p","1080p"]},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4"]},"duration":{"type":"integer","minimum":2,"maximum":10},"shot_type":{"type":"string","enum":["single","multi"]},"seed":{"type":"integer"}},"additionalProperties":false}},"required":["prompt","model","wan27R2vParams"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["runway-gen4-turbo"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"runwayParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[10]}]},"image":{"type":"string","format":"uri"},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4","21:9"]},"seed":{"type":"integer"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","enum":["runway-gen4.5"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"runwayParams":{"type":"object","properties":{"duration":{"anyOf":[{"type":"number","enum":[5]},{"type":"number","enum":[10]}]},"image":{"type":"string","format":"uri"},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1","4:3","3:4","21:9"]},"seed":{"type":"integer"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false}],"description":"Discriminated by `model`. Covers Kling 2.1-3.0, Veo 2/3, Sora 2, Seedance 1-2, Hailuo, Luma, Wan 2.5-2.7, Runway Gen4, Midjourney Video, Grok Imagine Video."},"VideoUpscaleRequest":{"oneOf":[{"type":"object","properties":{"model":{"type":"string","enum":["topaz-video-upscale"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"topazVideoParams":{"type":"object","properties":{"video":{"type":"string","format":"uri"},"target_resolution":{"type":"string","enum":["720p","1080p","4k"]},"target_fps":{"anyOf":[{"type":"number","enum":[24]},{"type":"number","enum":[30]},{"type":"number","enum":[60]}]},"enhance_model":{"type":"string","enum":["auto","theia-fine-tune-detail","theia-fine-tune-fidelity","apollo","rhea","iris"]},"subject_detection":{"type":"string","enum":["all","foreground","background","none"]}},"required":["video","target_resolution","target_fps"],"additionalProperties":false}},"required":["model","topazVideoParams"],"additionalProperties":false}],"description":"Video upscale via Topaz Video."},"VideoEditRequest":{"oneOf":[{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":5000},"model":{"type":"string","enum":["wan-2.7-videoedit"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"wan27VideoeditParams":{"type":"object","properties":{"video":{"type":"string","format":"uri"},"reference_image":{"type":"string","format":"uri"},"negative_prompt":{"type":"string","maxLength":2500},"resolution":{"type":"string","enum":["720p","1080p"]},"aspect_ratio":{"type":"string","enum":["auto","16:9","9:16","1:1","4:3","3:4"]},"audio_setting":{"type":"string","enum":["auto","origin"]},"duration":{"type":"integer","minimum":2,"maximum":10},"seed":{"type":"integer"}},"required":["video"],"additionalProperties":false}},"required":["prompt","model","wan27VideoeditParams"],"additionalProperties":false}],"description":"Instruction-based video editing via Wan 2.7 VideoEdit."},"GenerateMusicRequest":{"oneOf":[{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":5000},"model":{"type":"string","enum":["suno"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"sunoParams":{"type":"object","properties":{"custom_mode":{"type":"boolean","default":false},"instrumental":{"type":"boolean","default":false},"model_version":{"type":"string","enum":["V4","V4_5","V4_5ALL","V4_5PLUS","V5","V5_5"],"default":"V4_5PLUS"},"title":{"type":"string","maxLength":80},"style":{"type":"string","maxLength":1000},"negative_tags":{"type":"string","maxLength":500},"vocal_gender":{"type":"string","enum":["m","f"]},"style_weight":{"type":"number","minimum":0,"maximum":1},"weirdness_constraint":{"type":"number","minimum":0,"maximum":1},"auto_lyrics":{"type":"boolean"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":5000},"model":{"type":"string","enum":["udio"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"udioParams":{"type":"object","properties":{"lyrics_type":{"type":"string","enum":["generate","user","instrumental"],"default":"generate"},"negative_tags":{"type":"string","maxLength":500},"seed":{"type":"integer"},"title":{"type":"string","maxLength":80},"style":{"type":"string","maxLength":1000}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":5000},"model":{"type":"string","enum":["producer"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"producerParams":{"type":"object","properties":{"model_version":{"type":"string","enum":["FUZZ_2_PRO","FUZZ_2","FUZZ_2_RAW","FUZZ_1_1_PRO","FUZZ_1_PRO","FUZZ_1"],"default":"FUZZ_2_PRO"},"lyrics":{"type":"string","maxLength":5000},"instrumental":{"type":"boolean","default":false},"title":{"type":"string","maxLength":80},"seed":{"type":"string"},"lyrics_strength":{"type":"number","minimum":0,"maximum":1},"sound_strength":{"type":"number","minimum":0.2,"maximum":1},"weirdness":{"type":"number","minimum":0,"maximum":1}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":5000},"model":{"type":"string","enum":["lyria-3-clip"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"lyriaParams":{"type":"object","properties":{"reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":5000},"model":{"type":"string","enum":["lyria-3-pro"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"lyriaParams":{"type":"object","properties":{"reference_images":{"type":"array","items":{"type":"string","format":"uri"},"maxItems":10}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false},{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":5000},"model":{"type":"string","enum":["elevenlabs-music"]},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"array","items":{"type":"string","enum":["progress","completed","failed"]},"minItems":1},"elevenlabsParams":{"type":"object","properties":{"music_length_ms":{"type":"integer","minimum":5000,"maximum":300000},"force_instrumental":{"type":"boolean","default":false},"output_format":{"type":"string","enum":["mp3_standard","mp3_high_quality","wav_16khz","wav_22khz","wav_24khz","wav_cd_quality"],"default":"mp3_high_quality"}},"additionalProperties":false}},"required":["prompt","model"],"additionalProperties":false}],"description":"Discriminated by `model`. Covers Suno, Udio, Producer, Lyria 3 (clip + pro), and ElevenLabs Music."}}},"paths":{"/v2/me":{"get":{"tags":["Account"],"summary":"Get the authenticated caller","description":"Returns the user, their team (with credit balance + plan) and — when authenticated via API key — the key making the request. Useful for verifying credentials and rendering \"logged-in as\" headers.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"responses":{"200":{"description":"Caller information.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/models":{"get":{"tags":["Models"],"summary":"List the curated model catalog","description":"Public, no auth required. Returns the curated, creator-facing model catalog (id, label, description, control surface and cost range). Filter by `modality=image|video|music`.","security":[],"parameters":[{"schema":{"type":"string","enum":["image","video","music"]},"required":false,"name":"modality","in":"query"}],"responses":{"200":{"description":"Catalog entries.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelCatalog"}}}},"400":{"description":"Invalid `modality` value.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}},"/v2/jobs":{"get":{"tags":["Jobs"],"summary":"List jobs","description":"Paginated list of generation jobs. Defaults to the caller's own jobs; admins can pass `scope=team` to see every job in the team. Cursor pagination keyed on `(createdAt desc, id desc)`.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["QUEUED","PROCESSING","COMPLETED","FAILED","CANCELLED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"model","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","enum":["user","team"],"default":"user"},"required":false,"name":"scope","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"false"},"required":false,"name":"include_models","in":"query"}],"responses":{"200":{"description":"A page of jobs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobList"}}}},"400":{"description":"Invalid query parameters or cursor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Non-admin tried to use `scope=team`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/jobs/{id}":{"get":{"tags":["Jobs"],"summary":"Get a job","description":"Returns the current status, progress, and (when complete) the result for a single job. SDK consumers typically wrap this in a polling loop — see `client.jobs.waitFor()`.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Job state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"`id` is not a valid UUID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Job not found, or owned by a different user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/images/generate":{"post":{"tags":["Images"],"summary":"Submit an image generation job","description":"Creates an image generation job. The `model` discriminator selects the family (Midjourney, Flux, Seedream, Ideogram, Imagen, DALL-E, GPT Image, Kling Image, Qwen, Wan, Grok, Reve, Nano Banana, Flux LoRA) and unlocks the matching `<model>Params` block.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateImageRequest"}}}},"responses":{"202":{"description":"Job accepted and queued. Track via `GET /v2/jobs/{id}` or webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAccepted"}}}},"400":{"description":"Request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Team has insufficient credits to run this model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable (queue / DB outage). Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/images/upscale":{"post":{"tags":["Images"],"summary":"Submit an image upscale job","description":"Creates an upscale job. Topaz is priced by output megapixels; Clarity is flat. The route probes the input image to compute pricing — failures return 400 before any credits are deducted.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageUpscaleRequest"}}}},"responses":{"202":{"description":"Job accepted and queued. Track via `GET /v2/jobs/{id}` or webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAccepted"}}}},"400":{"description":"Request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Team has insufficient credits to run this model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable (queue / DB outage). Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/images/edit":{"post":{"tags":["Images"],"summary":"Submit an inpaint or outpaint job","description":"Today wired to BFL Flux Fill Pro. `mode: \"inpaint\"` requires a `mask`; `mode: \"outpaint\"` requires an `outpaint` preset. Pricing is flat regardless of mode.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageEditRequest"}}}},"responses":{"202":{"description":"Job accepted and queued. Track via `GET /v2/jobs/{id}` or webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAccepted"}}}},"400":{"description":"Request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Team has insufficient credits to run this model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable (queue / DB outage). Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/images/background-remove":{"post":{"tags":["Images"],"summary":"Submit a background-removal job","description":"Two tiers behind the `model` discriminator: `bria-bg-remove` (state-of-the-art alpha matting, commercially licensed) and `851-bg-remove` (sub-cent fast path). Both return a transparent PNG.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageBackgroundRemoveRequest"}}}},"responses":{"202":{"description":"Job accepted and queued. Track via `GET /v2/jobs/{id}` or webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAccepted"}}}},"400":{"description":"Request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Team has insufficient credits to run this model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable (queue / DB outage). Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/videos/generate":{"post":{"tags":["Videos"],"summary":"Submit a video generation job","description":"Creates a video job. The `model` discriminator selects the family (Kling 2.1-3.0, Veo 2/3, Sora 2, Seedance 1-2, Hailuo, Luma, Wan 2.5-2.7, Runway Gen4, Midjourney Video, Grok Imagine Video) and unlocks the matching `<model>Params` block. Pricing for many video models is per-second; the route layer computes the multiplier from the requested `duration`.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateVideoRequest"}}}},"responses":{"202":{"description":"Job accepted and queued. Track via `GET /v2/jobs/{id}` or webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAccepted"}}}},"400":{"description":"Request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Team has insufficient credits to run this model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable (queue / DB outage). Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/videos/upscale":{"post":{"tags":["Videos"],"summary":"Submit a video upscale job","description":"Today wired to Topaz Video. Variant key encodes resolution + fps (`1080p_30`, etc.); the route probes the input video duration via ffprobe to compute the per-second multiplier.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoUpscaleRequest"}}}},"responses":{"202":{"description":"Job accepted and queued. Track via `GET /v2/jobs/{id}` or webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAccepted"}}}},"400":{"description":"Request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Team has insufficient credits to run this model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable (queue / DB outage). Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/videos/edit":{"post":{"tags":["Videos"],"summary":"Submit an instruction-based video edit job","description":"Today wired to Wan 2.7 VideoEdit. Per-second pricing — `duration` is required, otherwise the route probes the input video and bills its length.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoEditRequest"}}}},"responses":{"202":{"description":"Job accepted and queued. Track via `GET /v2/jobs/{id}` or webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAccepted"}}}},"400":{"description":"Request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Team has insufficient credits to run this model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable (queue / DB outage). Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/music/generate":{"post":{"tags":["Music"],"summary":"Submit a music generation job","description":"Creates a music job across Suno, Udio, Producer, Lyria 3 and ElevenLabs Music. Suno and Udio always return TWO songs per call — the result is an array.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateMusicRequest"}}}},"responses":{"202":{"description":"Job accepted and queued. Track via `GET /v2/jobs/{id}` or webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAccepted"}}}},"400":{"description":"Request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Team has insufficient credits to run this model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service temporarily unavailable (queue / DB outage). Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/uploads":{"post":{"tags":["Uploads"],"summary":"Upload a file to short-lived CDN storage","description":"Single-file multipart upload (max 25 MB image / audio, 50 MB video). Magic-byte sniffed — declared content-type is ignored. Returns a CDN URL drop-in for any image / video / audio input field. Files live ~1-2h before the cleanup worker reaps them.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"PNG, JPEG, WebP, GIF, MP4, WebM, MOV, MP3, WAV, OGG, M4A."}}}}}},"responses":{"201":{"description":"Uploaded file metadata + CDN URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"400":{"description":"No file, oversize, or unsupported file type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Upstream CDN upload failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/loras":{"post":{"tags":["LoRAs"],"summary":"Create and train a Flux LoRA","description":"Multipart-form request with 15-30 training images plus metadata fields. Deducts 2 credits up-front (refunded on any subsequent failure) and queues a training job. The returned `id` becomes the `loraId` you pass to `flux-lora` inference.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["name","images"],"properties":{"name":{"type":"string","minLength":1,"maxLength":60},"subjectKind":{"type":"string","enum":["person","style","object"],"default":"person"},"gender":{"type":"string","enum":["female","male","non-binary"],"description":"Required when `subjectKind === \"person\"`."},"ethnicity":{"type":"string","minLength":1,"maxLength":40,"description":"Required when `subjectKind === \"person\"`."},"age":{"type":"string","minLength":1,"maxLength":40},"steps":{"type":"integer","minimum":500,"maximum":3000},"loraRank":{"type":"integer","minimum":8,"maximum":64},"webhookUrl":{"type":"string","format":"uri"},"webhookEvents":{"type":"string","description":"Comma-separated list, e.g. `completed,failed`."},"images":{"type":"array","description":"15-30 training images (JPEG / PNG / WebP, max 10 MB each, 100 MB total).","items":{"type":"string","format":"binary"},"minItems":15,"maxItems":30}}}}}},"responses":{"202":{"description":"LoRA created and training queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoraCreated"}}}},"400":{"description":"Validation failed (bad metadata, unsupported file, or wrong number of images).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Insufficient credits.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientCredits"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit hit OR per-team in-flight training cap reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Failed to enqueue training.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["LoRAs"],"summary":"List the team's LoRAs","description":"Paginated listing of LoRAs scoped to the caller's team. Archived LoRAs are hidden by default.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":24},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"false"},"required":false,"name":"includeArchived","in":"query"}],"responses":{"200":{"description":"A page of LoRAs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoraList"}}}},"400":{"description":"Invalid query parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/loras/{id}":{"get":{"tags":["LoRAs"],"summary":"Get a single LoRA","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"LoRA detail.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lora"}}}},"400":{"description":"`id` is not a valid UUID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"LoRA not found, or owned by a different team.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["LoRAs"],"summary":"Archive a LoRA","description":"Soft-delete (status flipped to `ARCHIVED`). Best-effort cleanup of the upstream destination model on the trainer. Idempotent — deleting an already-archived LoRA also returns 204.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Archived."},"400":{"description":"`id` is not a valid UUID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"LoRA not found, or owned by a different team.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/assets/create":{"post":{"tags":["Assets"],"summary":"Register an asset with the upstream provider","description":"Some video providers (Kie / Seedance) require assets to be pre-registered before they can be used as inputs. This endpoint forwards the URL to the provider and stores the returned asset ID so it can be reused across multiple jobs.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAssetRequest"}}}},"responses":{"201":{"description":"Asset registered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetCreated"}}}},"400":{"description":"Invalid URL or type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Upstream asset creation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v2/assets/{assetId}":{"get":{"tags":["Assets"],"summary":"Get an upstream asset","description":"Returns the provider's asset object verbatim (opaque, provider-specific shape). Only assets registered by the caller's team are accessible.","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"assetId","in":"path"}],"responses":{"200":{"description":"Provider asset object (passthrough).","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"`assetId` missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication failed (missing / invalid API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Authenticated but the API key is inactive or lacks permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Asset not found, or owned by a different team.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded. Retry after the `Retry-After` seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Upstream asset query failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"webhooks":{}}