{"components":{"parameters":{"GenerationId":{"in":"path","name":"id","required":true,"schema":{"pattern":"^gen_","type":"string"}},"IdempotencyKey":{"in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":128,"minLength":1,"pattern":"^[\\x21-\\x7E]+$","type":"string"}}},"responses":{"GenerationAdmissionLimit":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/QueueLimitError"},{"$ref":"#/components/schemas/GenerationRateLimitError"}]}}},"description":"Generation submission is temporarily unavailable, the per-user queue limit was reached, the plan allowance is temporarily exhausted, or the server is busy parsing other submissions (submission_parser_busy).","headers":{"Retry-After":{"description":"Minimum seconds until another submission can be accepted; present for generation_rate_limit and submission_parser_busy.","schema":{"minimum":1,"type":"integer"}}}},"GenerationUnavailable":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ModelUnavailableError"},{"$ref":"#/components/schemas/PlanUnavailableError"}]}}},"description":"The selected model or the user's generation plan is temporarily unavailable"},"IdempotencyConflict":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The same Idempotency-Key was already used for a different normalized request"},"InvalidIdempotencyKey":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Idempotency-Key is missing, repeated, or malformed (details.reason is missing, multiple, or malformed), or the body is not valid JSON (malformed_json)."},"NotFound":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Resource does not exist or is not owned by the caller"},"PayloadTooLarge":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Authenticated JSON body exceeds the configured byte limit"},"Unauthorized":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid bearer credential"},"UnprocessableGeneration":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/VideoModelRequiresVideoEndpointError"},{"$ref":"#/components/schemas/ReferenceImageUnsupportedError"},{"$ref":"#/components/schemas/ReferenceImagesLimitExceededError"},{"$ref":"#/components/schemas/NegativePromptUnsupportedError"},{"$ref":"#/components/schemas/ModelArchivedError"},{"$ref":"#/components/schemas/GenerationRequestExceedsPlanLimitError"}]}}},"description":"Request validation failed, the selected model is archived or is a video model, the selected model does not support the requested reference image, reference count, or negative prompt, or the request exceeds the plan allowance"},"UnsupportedMediaType":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request body is not application/json."},"ValidationError":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Request validation failed"},"VideoAccessRequired":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoAccessRequiredError"}}},"description":"The caller does not hold Video Access"}},"schemas":{"Error":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"type":"object"}},"required":["code"],"type":"object"}},"required":["error"],"type":"object"},"Generation":{"properties":{"created_at":{"format":"date-time","type":"string"},"height":{"description":"Present after success. Height of the delivered image; equals upscale_height when upscaling was requested.","type":"integer"},"id":{"pattern":"^gen_","type":"string"},"image_url":{"description":"Present after success. Relative URL on the RushGen API origin; request it with UserBearer. It may redirect to a short-lived URL at a different origin; follow Location unchanged and without an Authorization header.","type":"string"},"model":{"examples":["qwen-image-2-1-int8-convrot"],"type":"string"},"queue_reason":{"description":"Present for queued work. Explains why the generation is still waiting.","type":"string"},"seed":{"type":"integer"},"status":{"enum":["queued","running","succeeded","failed","cancelled"],"type":"string"},"type":{"const":"image"},"upscale_height":{"description":"Present when upscaling was requested; echoes upscale_height.","type":"integer"},"upscale_width":{"description":"Present when upscaling was requested; echoes upscale_width.","type":"integer"},"width":{"description":"Present after success. Width of the delivered image; equals upscale_width when upscaling was requested.","type":"integer"}},"required":["id","type","model","status","created_at","seed"],"type":"object"},"GenerationRateLimitError":{"additionalProperties":false,"properties":{"error":{"additionalProperties":false,"properties":{"code":{"const":"generation_rate_limit"},"limit":{"minimum":1,"type":"integer"},"message":{"type":"string"},"remaining":{"minimum":0,"type":"integer"},"requested":{"minimum":1,"type":"integer"},"retry_after_seconds":{"minimum":1,"type":"integer"},"used":{"minimum":0,"type":"integer"},"window_seconds":{"const":3600}},"required":["code","message","limit","used","remaining","requested","window_seconds","retry_after_seconds"],"type":"object"}},"required":["error"],"type":"object"},"GenerationRequest":{"additionalProperties":false,"dependentRequired":{"upscale_height":["upscale_width"],"upscale_width":["upscale_height"]},"not":{"required":["reference_image","reference_images"]},"properties":{"height":{"default":1024,"maximum":1080,"minimum":1,"type":"integer"},"model":{"description":"Generation model identifier. When omitted, the current default is selected. Available models: ideogram-v4-fast, krea-2-turbo-int8-convrot, qwen-image-2-1-int8-convrot (default).","examples":["qwen-image-2-1-int8-convrot"],"maxLength":200,"minLength":1,"type":"string"},"negative_prompt":{"description":"Optional negative conditioning text. Blank values are treated as omitted. The selected model must support negative prompts.","maxLength":2000,"type":"string"},"output_format":{"default":"png","enum":["webp","png","jpeg"],"type":"string"},"prompt":{"maxLength":3000,"minLength":1,"type":"string"},"prompt_upsampling":{"default":true,"description":"When true or omitted, RushGen applies best-effort prompt improvement before generation. If prompt improvement cannot be used, generation continues with the original prompt unchanged. Set false to keep the original prompt unchanged.","type":"boolean"},"reference_image":{"contentEncoding":"base64","description":"Optional plain base64 (without a data-URL prefix) containing one non-animated PNG, JPEG, or WebP reference image, at most 7 MiB decoded. Actual dimensions must each be within 1..4096 and total area must not exceed 16777216 pixels. URLs and data URLs are rejected and never fetched. The selected model must support reference images.","maxLength":9786712,"type":"string"},"reference_images":{"description":"Ordered set of up to ten references with the same per-image bounds as reference_image. The selected model may accept fewer; exceeding its limit returns reference_images_limit_exceeded. Mutually exclusive with reference_image. All images condition each generated output.","items":{"contentEncoding":"base64","maxLength":9786712,"type":"string"},"maxItems":10,"minItems":1,"type":"array"},"seed":{"maximum":2147483647,"minimum":0,"type":"integer"},"type":{"const":"image","default":"image"},"upscale_height":{"description":"Optional Upscale Target height. Send together with upscale_width. Must be at least height and at most four times height; the same aspect ratio, minimum inference size and model rules as upscale_width apply.","maximum":1080,"minimum":1,"type":"integer"},"upscale_width":{"description":"Optional final image width after upscaling; width and height remain the generation size. Send together with upscale_height; omit both to disable upscaling. Must be at least width and at most four times width, and the target must keep the aspect ratio of width and height within two percent. width and height must each be at least 256. The selected model must support upscale. Upscaling increases generation time.","maximum":1920,"minimum":1,"type":"integer"},"width":{"default":1024,"maximum":1920,"minimum":1,"type":"integer"}},"required":["prompt"],"type":"object"},"GenerationRequestExceedsPlanLimitError":{"additionalProperties":false,"properties":{"error":{"additionalProperties":false,"properties":{"code":{"const":"generation_request_exceeds_plan_limit"},"limit":{"minimum":1,"type":"integer"},"message":{"type":"string"},"requested":{"minimum":1,"type":"integer"},"window_seconds":{"const":3600}},"required":["code","message","requested","limit","window_seconds"],"type":"object"}},"required":["error"],"type":"object"},"ModelArchivedError":{"additionalProperties":false,"description":"The requested model is archived and accepts no new generations. Retransmitting an earlier accepted request with its Idempotency-Key still returns the original generation. Choose another model or omit model to use the default.","properties":{"error":{"additionalProperties":false,"properties":{"code":{"const":"model_archived"}},"required":["code"],"type":"object"}},"required":["error"],"type":"object"},"ModelUnavailableError":{"additionalProperties":false,"properties":{"error":{"additionalProperties":false,"properties":{"code":{"const":"model_unavailable"},"model":{"examples":["qwen-image-2-1-int8-convrot"],"type":"string"}},"required":["code","model"],"type":"object"}},"required":["error"],"type":"object"},"NegativePromptUnsupportedError":{"additionalProperties":false,"properties":{"error":{"additionalProperties":false,"properties":{"code":{"const":"negative_prompt_unsupported"}},"required":["code"],"type":"object"}},"required":["error"],"type":"object"},"PlanUnavailableError":{"additionalProperties":false,"properties":{"error":{"additionalProperties":false,"properties":{"code":{"const":"plan_unavailable"},"message":{"const":"Generation plan is temporarily unavailable. Try again later."}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"},"QueueLimitError":{"additionalProperties":false,"properties":{"error":{"additionalProperties":false,"properties":{"code":{"const":"queue_limit"},"message":{"const":"Queued generation limit exceeded. Wait for queued generations to complete."}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"},"ReferenceImageUnsupportedError":{"additionalProperties":false,"properties":{"error":{"additionalProperties":false,"properties":{"code":{"const":"reference_image_unsupported"}},"required":["code"],"type":"object"}},"required":["error"],"type":"object"},"ReferenceImagesLimitExceededError":{"additionalProperties":false,"properties":{"error":{"additionalProperties":false,"properties":{"code":{"const":"reference_images_limit_exceeded"}},"required":["code"],"type":"object"}},"required":["error"],"type":"object"},"VideoAccessRequiredError":{"additionalProperties":false,"properties":{"error":{"additionalProperties":false,"properties":{"code":{"const":"video_access_required"}},"required":["code"],"type":"object"}},"required":["error"],"type":"object"},"VideoGeneration":{"properties":{"completed_at":{"description":"Present once the generation has finished.","format":"date-time","type":"string"},"created_at":{"format":"date-time","type":"string"},"duration_seconds":{"type":"integer"},"fps":{"const":24,"type":"integer"},"height":{"description":"Clip height: 480 for 480p, 704 for 720p.","type":"integer"},"id":{"pattern":"^gen_","type":"string"},"model":{"example":"ltx-2-5-distilled-int8-convrot","examples":["ltx-2-5-distilled-int8-convrot"],"type":"string"},"queue_reason":{"description":"Present for queued work, with the same customer-safe reasons as an image generation.","type":"string"},"seed":{"type":"integer"},"started_at":{"description":"Present once generation has started.","format":"date-time","type":"string"},"status":{"enum":["queued","running","succeeded","failed","cancelled"],"type":"string"},"video_url":{"description":"Present after success. Relative URL of the mp4 (H.264, no audio) on the RushGen API origin; request it with UserBearer like an image_url.","type":"string"},"width":{"description":"Clip width: 864 for 480p, 1280 for 720p.","type":"integer"}},"required":["id","model","status","created_at","seed","width","height","duration_seconds","fps"],"type":"object"},"VideoGenerationRequest":{"additionalProperties":false,"properties":{"duration_seconds":{"default":5,"description":"Clip length in seconds. Clips are 24 frames per second.","enum":[5],"type":"integer"},"first_frame_image":{"contentEncoding":"base64","description":"Optional plain base64 (without a data-URL prefix) of the first frame for image to video: one non-animated PNG, JPEG, or WebP image, at most 7 MiB decoded, with dimensions each within 1..4096 and at most 16777216 pixels. An image of another aspect ratio is center-cropped to the clip size, not rejected. URLs and data URLs are rejected and never fetched.","maxLength":9786712,"type":"string"},"model":{"description":"Video generation model identifier. When omitted, the current default video model is selected. Available models: ltx-2-5-distilled-int8-convrot.","example":"ltx-2-5-distilled-int8-convrot","examples":["ltx-2-5-distilled-int8-convrot"],"maxLength":200,"minLength":1,"type":"string"},"negative_prompt":{"description":"Optional negative conditioning text. Blank values are treated as omitted. The selected model must support negative prompts.","maxLength":2000,"type":"string"},"prompt":{"maxLength":3000,"minLength":1,"type":"string"},"resolution":{"description":"16:9 clip size: 480p is 864x480, 720p is 1280x704.","enum":["480p","720p"],"type":"string"},"seed":{"maximum":2147483647,"minimum":0,"type":"integer"}},"required":["prompt","resolution"],"type":"object"},"VideoModelRequiresVideoEndpointError":{"additionalProperties":false,"description":"The requested model is a video model; submit it to /v1/video-generations.","properties":{"error":{"additionalProperties":false,"properties":{"code":{"const":"video_model_requires_video_endpoint"},"endpoint":{"const":"/v1/video-generations"}},"required":["code","endpoint"],"type":"object"}},"required":["error"],"type":"object"}},"securitySchemes":{"UserBearer":{"bearerFormat":"rg_live_*","scheme":"bearer","type":"http"}}},"info":{"description":"Asynchronous public beta API for image and video generation.","title":"RushGen API","version":"0.2.0"},"openapi":"3.1.0","paths":{"/v1/files/{id}":{"get":{"description":"Authenticate this request with UserBearer. The response is either the file itself or a 307 Temporary Redirect to a short-lived URL at a different origin. Follow Location unchanged and without an Authorization header. Do not forward the RushGen Authorization header to the redirected origin.","operationId":"getFile","parameters":[{"in":"path","name":"id","required":true,"schema":{"pattern":"^file_","type":"string"}}],"responses":{"200":{"content":{"image/jpeg":{"schema":{"contentEncoding":"binary","type":"string"}},"image/png":{"schema":{"contentEncoding":"binary","type":"string"}},"image/webp":{"schema":{"contentEncoding":"binary","type":"string"}},"video/mp4":{"schema":{"contentEncoding":"binary","type":"string"}}},"description":"Generated image or video"},"307":{"description":"Temporary redirect to a short-lived URL at a different origin. Follow Location unchanged with GET and without an Authorization header. Do not copy the RushGen bearer token to the redirected origin.","headers":{"Location":{"description":"Short-lived download URL at a different origin.","schema":{"format":"uri","type":"string"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The file is temporarily unavailable; retry after the number of seconds in Retry-After.","headers":{"Retry-After":{"schema":{"minimum":1,"type":"integer"}}}}},"security":[{"UserBearer":[]}],"summary":"Download a generated image or video"}},"/v1/generations":{"post":{"description":"Queues one independent generation. prompt_upsampling defaults to true and applies best-effort prompt improvement; when it cannot be used, image generation continues with the original prompt unchanged. Set prompt_upsampling=false for exact pass-through.","operationId":"createGeneration","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}},"description":"Idempotent replay of the current original generation"},"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}},"description":"Generation accepted and queued."},"400":{"$ref":"#/components/responses/InvalidIdempotencyKey"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/UnprocessableGeneration"},"429":{"$ref":"#/components/responses/GenerationAdmissionLimit"},"503":{"$ref":"#/components/responses/GenerationUnavailable"}},"security":[{"UserBearer":[]}],"summary":"Queue one image generation"}},"/v1/generations/{id}":{"get":{"description":"Poll no more often than once per second while queued or running and honor Retry-After when present. After transport or server errors, use exponential backoff capped at 10 seconds.","operationId":"getGeneration","parameters":[{"$ref":"#/components/parameters/GenerationId"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}},"description":"Current generation state. Queued responses include Retry-After: 5; running responses include Retry-After: 1. Succeeded means the image is ready to download from image_url.","headers":{"Retry-After":{"description":"Minimum seconds before the next nonterminal status read","schema":{"minimum":1,"type":"integer"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Per-API-key status polling allowance exceeded; retry after the number of seconds in Retry-After.","headers":{"Retry-After":{"required":true,"schema":{"minimum":1,"type":"integer"}}}}},"security":[{"UserBearer":[]}],"summary":"Get an owned generation"}},"/v1/video-generations":{"post":{"description":"Limited access: available only to accounts with Video Access; other accounts receive 403 video_access_required. Queues one 16:9 video clip without audio: text to video, or image to video when first_frame_image is sent. A video generation consumes one generation of the same plan allowance as an image. Only the listed fields are accepted; image-only fields such as reference_images, upscale_width, prompt_upsampling, width, and height are rejected with validation_error. Video generations are polled at /v1/video-generations/{id} only; /v1/generations/{id} answers 404 for them.","operationId":"createVideoGeneration","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoGenerationRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoGeneration"}}},"description":"Idempotent replay of the current original video generation"},"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoGeneration"}}},"description":"Video generation accepted and queued."},"400":{"$ref":"#/components/responses/InvalidIdempotencyKey"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/VideoAccessRequired"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/UnprocessableGeneration"},"429":{"$ref":"#/components/responses/GenerationAdmissionLimit"},"503":{"$ref":"#/components/responses/GenerationUnavailable"}},"security":[{"UserBearer":[]}],"summary":"Queue one video generation (limited access)","x-access":"limited"}},"/v1/video-generations/{id}":{"get":{"description":"Limited access: requires Video Access. Poll no more often than once per second while queued or running and honor Retry-After when present; video generation takes longer than an image. After transport or server errors, use exponential backoff capped at 10 seconds. An image generation id answers 404.","operationId":"getVideoGeneration","parameters":[{"$ref":"#/components/parameters/GenerationId"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoGeneration"}}},"description":"Current video generation state. Queued responses include Retry-After: 5; running responses include Retry-After: 1. Succeeded means the mp4 is preserved and can be downloaded using video_url.","headers":{"Retry-After":{"description":"Minimum seconds before the next nonterminal status read","schema":{"minimum":1,"type":"integer"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/VideoAccessRequired"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Per-API-key status polling allowance exceeded; retry after the number of seconds in Retry-After.","headers":{"Retry-After":{"required":true,"schema":{"minimum":1,"type":"integer"}}}}},"security":[{"UserBearer":[]}],"summary":"Get an owned video generation (limited access)","x-access":"limited"}}}}