{"openapi":"3.2.0","info":{"title":"MasterA AI GPU Inference API","description":"High-speed AI image & video generation on our own NVIDIA RTX GPUs (RTX 5090, RTX 5080 & RTX 4070 Ti Super) — Flux.1-Schnell, SDXL-Turbo, and LTX-Video. One API key, EU data locality, solar-powered 24/7.","version":"1.0.0"},"servers":[{"url":"https://hqjqb.jojapi.net"}],"security":[{"ApiKeyAuth":[]}],"tags":[{"name":"Image Generation"},{"name":"Video Generation"}],"x-agent-commerce":{"catalog_url":"https://hqjqb.jojapi.net/_jojapi/agent/plans","discovery_url":"https://hqjqb.jojapi.net/.well-known/x402","directory_url":"https://agents.jojapi.net/apis/mastera-ai-gpu-image-and-video","docs":"https://docs.jojapi.com/consumers/agents"},"paths":{"/v1/ltx/generate":{"post":{"operationId":"post_v1_ltx_generate","summary":"ltx-text-to-video","description":"Generate a short video (~4s clip) from a text prompt using LTXV-13B-0.9.8-distilled. Returns a task_id immediately — poll GET /v1/tasks/{task_id} for the result.","tags":["Image Generation"],"responses":{"200":{"description":"Generation started. Poll GET /v1/tasks/{task_id} for the result.","content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"}}},"examples":{"Example_1":{"value":{"task_id":"a1b2c3d4e5f6","status":"processing","message":"Generation started. Poll GET /v1/tasks/{task_id} for result."}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}},"examples":{"Example_1":{"value":{"error":"Invalid or missing API key"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","description":"The text description of the video to generate."},"negative_prompt":{"type":"string","description":"What to avoid in the generated video.","default":""},"width":{"type":"integer","description":"Output video width in pixels.","default":768,"minimum":256,"maximum":1024},"height":{"type":"integer","description":"Output video height in pixels.","default":512,"minimum":256,"maximum":1024},"length":{"type":"integer","description":"Video duration in frames (25 fps). 97 frames is ~4s. Snapped to a valid n*8+1 value.","default":97,"minimum":9,"maximum":161},"steps":{"type":"integer","description":"Number of inference steps.","default":8,"minimum":1,"maximum":15},"cfg":{"type":"number","description":"Guidance scale (1.0 recommended for the distilled model).","default":1},"fps":{"type":"number","description":"Frames per second of the output video.","default":25},"seed":{"type":"integer","description":"Random seed for reproducible generation.","default":0}}},"example":{"prompt":"Ocean waves at sunset, cinematic, slow camera pan","negative_prompt":"","width":0,"height":0,"length":0,"steps":0,"cfg":0,"fps":0,"seed":0}}}}}},"/v1/tasks/{task_id}":{"get":{"operationId":"get_v1_tasks_task_id","summary":"get-task-status","description":"Poll generation progress. All generation endpoints are asynchronous and return immediately with a task_id — use this endpoint to check status and retrieve the final result. Status values: processing (queued), generating (running on GPU), completed (ready, with output_url), error (failed).","tags":["Image Generation"],"responses":{"200":{"description":"Task status and result (if completed).","content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string"},"status":{"type":"string","enum":["processing","generating","completed","error"]},"type":{"type":"string","enum":["flux_t2i","sdxl_t2i","ltx_t2v"]},"output_url":{"type":"string","description":"URL to the generated file (only when status=completed)."},"error":{"type":"string","description":"Error message (only when status=error)."},"message":{"type":"string","description":"Human-readable progress message."}}},"examples":{"Example_1":{"value":{"task_id":"a1b2c3d4e5f6","status":"processing","type":"flux_t2i","output_url":"","error":"","message":""}}}}}},"404":{"description":"Task ID not found.","content":{"application/json":{"examples":{"Example_1":{"value":{}}}}}}},"parameters":[{"name":"task_id","in":"path","description":"The task ID returned by a generation POST endpoint.","required":true,"schema":{"type":"string"}}]}},"/v1/health":{"get":{"operationId":"get_v1_health","summary":"video-health","description":"GPU, service and loaded-model health for the video server.","tags":["Image Generation"],"responses":{"200":{"description":"Health status.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"models":{"type":"array","items":{"type":"string"}}}},"examples":{"Example_1":{"value":{"status":"","models":[]}}}}}}}}},"/v1/files/{filename}":{"get":{"operationId":"get_v1_files_filename","summary":"get-file","description":"Download a generated image (PNG) or video (MP4). The filename is taken from the output_url returned by GET /v1/tasks/{task_id} when status=completed.","tags":["Image Generation"],"responses":{"200":{"description":"The generated media file.","content":{"application/json":{"examples":{"Example_1":{"value":{}}}}}},"404":{"description":"File not found.","content":{"application/json":{"examples":{"Example_1":{"value":{}}}}}}},"parameters":[{"name":"filename","in":"path","description":"The filename portion of the output_url.","required":true,"schema":{"type":"string"}}]}},"/v1/flux/generate":{"post":{"operationId":"post_v1_flux_generate","summary":"flux-text-to-image","description":"Generate a high-quality image from a text prompt using Flux.1-Schnell. Returns a task_id immediately — poll GET /v1/tasks/{task_id} for the result.","tags":["Image Generation"],"responses":{"200":{"description":"Generation started. Poll GET /v1/tasks/{task_id} for the result.","content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"}}},"examples":{"Example_1":{"value":{"task_id":"a1b2c3d4e5f6","status":"processing","message":"Generation started. Poll GET /v1/tasks/{task_id} for result."}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}},"examples":{"Example_1":{"value":{"error":"Invalid or missing API key"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","description":"The text description of the image to generate."},"width":{"type":"integer","description":"Output image width in pixels.","default":1024,"minimum":256,"maximum":1536},"height":{"type":"integer","description":"Output image height in pixels.","default":768,"minimum":256,"maximum":1536},"seed":{"type":"integer","description":"Random seed for reproducible generation.","default":0},"steps":{"type":"integer","description":"Number of inference steps.","default":4,"minimum":1,"maximum":20}}},"example":{"prompt":"A serene mountain lake at sunset, oil painting style","width":0,"height":0,"seed":0,"steps":0}}}}}},"/v1/sdxl/generate":{"post":{"operationId":"post_v1_sdxl_generate","summary":"sdxl-text-to-image","description":"Generate an image in ~2 seconds using SDXL-Turbo. Best for high-volume, real-time, and prototyping use cases. Returns a task_id immediately — poll GET /v1/tasks/{task_id} for the result.","tags":["Image Generation"],"responses":{"200":{"description":"Generation started. Poll GET /v1/tasks/{task_id} for the result.","content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"}}},"examples":{"Example_1":{"value":{"task_id":"a1b2c3d4e5f6","status":"processing","message":"Generation started. Poll GET /v1/tasks/{task_id} for result."}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}},"examples":{"Example_1":{"value":{"error":"Invalid or missing API key"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","description":"The text description of the image to generate."},"negative_prompt":{"type":"string","description":"What to avoid in the generated image.","default":""},"width":{"type":"integer","description":"Output image width in pixels (SDXL-Turbo is tuned for 512).","default":512,"minimum":256,"maximum":1536},"height":{"type":"integer","description":"Output image height in pixels (SDXL-Turbo is tuned for 512).","default":512,"minimum":256,"maximum":1536},"seed":{"type":"integer","description":"Random seed for reproducible generation.","default":0},"steps":{"type":"integer","description":"Number of inference steps (1-4 recommended for Turbo).","default":4,"minimum":1,"maximum":20}}},"example":{"prompt":"A red sports car on a coastal road, golden hour","negative_prompt":"","width":0,"height":0,"seed":0,"steps":0}}}}}},"/v1/status":{"get":{"operationId":"get_v1_status","summary":"model-status","description":"Returns which model is currently loaded on the GPU and its idle time.","tags":["Image Generation"],"responses":{"200":{"description":"Current GPU model load status.","content":{"application/json":{"schema":{"type":"object"},"examples":{"Example_1":{"value":{}}}}}}}}},"/v1/video/tasks/{task_id}":{"get":{"operationId":"get_v1_video_tasks_task_id","summary":"video-get-task","description":"Returns the current status of a video generation task. When completed, includes the output_url.","tags":["Video Generation"],"responses":{"200":{"description":"Task status.","content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string"},"status":{"type":"string","enum":["queued","generating","completed","error"]},"output_url":{"type":"string","description":"Public URL of the finished MP4 (present when completed)."},"elapsed_s":{"type":"number"},"error":{"type":"string"}}},"examples":{"Example_1":{"value":{"task_id":"","status":"queued","output_url":"","elapsed_s":0,"error":""}}}}}}},"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string"}}]}},"/v1/video/generate":{"post":{"operationId":"post_v1_video_generate","summary":"video-generate","description":"Starts a text-to-video generation job using LTX-2 19B (distilled). Returns a task_id immediately.\nPoll GET /v1/video/tasks/{task_id} every 3-5 seconds until it reports completed, then read the\noutput_url for the finished MP4.","tags":["Video Generation"],"responses":{"200":{"description":"Generation job started.","content":{"application/json":{"schema":{"type":"object","properties":{"task_id":{"type":"string","description":"Unique task identifier to poll."},"status":{"type":"string"},"message":{"type":"string"}}},"examples":{"Example_1":{"value":{"task_id":"","status":"queued","message":""}}}}}},"400":{"description":"Bad request (missing prompt or invalid params).","content":{"application/json":{"examples":{"Example_1":{"value":{}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"examples":{"Example_1":{"value":{}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","description":"Text description of the video to generate."},"model":{"type":"string","description":"Video model to use.","default":"ltx2","enum":["ltx2","wan5b"]},"quality":{"type":"string","description":"Generation quality (inference steps).","default":"fast","enum":["fast","balanced","best"]},"resolution":{"type":"string","description":"Output resolution.","default":"sd","enum":["sd","hd"]},"length":{"type":"integer","description":"Approximate duration in seconds (3, 5 or 10).","default":5,"minimum":3,"maximum":10},"seed":{"type":"integer","description":"Random seed for reproducible generation.","default":0}}},"example":{"prompt":"A red fox running through fresh snow, slow motion, cinematic lighting","model":"ltx2","quality":"fast","resolution":"sd","length":0,"seed":0}}}}}},"/v1/video/files/{filename}":{"get":{"operationId":"get_v1_video_files_filename","summary":"video-get-file","description":"Downloads a generated MP4 by filename (the basename of output_url).","tags":["Video Generation"],"responses":{"200":{"description":"MP4 video file.","content":{"application/json":{"examples":{"Example_1":{"value":{}}}}}}},"parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string"}}]}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-JoJAPI-Key","description":"Your JoJ API key."}}}}