{"openapi":"3.1.0","info":{"title":"Rimp API","version":"1.0.0","description":"AI generation API across 8 modalities — image, video, voice, music, avatar, chat, 3D and upscale. Multi-model side-by-side comparisons, unified billing, one API key."},"servers":[{"url":"https://api.rimp.io","description":"Production"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"param":{"type":"string"},"request_id":{"type":"string"}},"required":["type","code","message"]}}},"Generation":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["generation"]},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"modality":{"type":"string","enum":["image","video","voice","music","avatar","chat","3d","upscale"]},"prompt":{"type":"string"},"params":{"type":"object","additionalProperties":true},"reserved_credits":{"type":"integer"},"charged_credits":{"type":"integer"},"refunded_credits":{"type":"integer"},"cache_hit":{"type":"boolean"},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/GenerationOutput"}}}},"GenerationOutput":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","audio","thumbnail"]},"mime":{"type":"string"},"width":{"type":"integer","nullable":true},"height":{"type":"integer","nullable":true},"duration_s":{"type":"string","nullable":true},"url":{"type":"string","format":"uri"},"moderation_status":{"type":"string","enum":["pending","approved","flagged","blocked"]}}},"Model":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"provider":{"type":"string"},"display_name":{"type":"string"},"modality":{"type":"string","enum":["image","video","voice","music","avatar","chat","3d","upscale"]},"capabilities":{"type":"array","items":{"type":"string"}},"quality_tier":{"type":"string","enum":["fast","standard","pro"]},"pricing":{"type":"object","properties":{"unit":{"type":"string","enum":["second","image","megapixel","character","minute","song","video","token","model_3d"]},"unit_cost_usd":{"type":"number"}}}}},"Comparison":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["comparison"]},"status":{"type":"string","enum":["queued","running","succeeded","partial","failed"]},"prompt":{"type":"string"},"params_shared":{"type":"object","additionalProperties":true},"reserved_credits":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"finished_at":{"type":"string","format":"date-time","nullable":true},"generations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"model":{"type":"string"},"status":{"type":"string"},"charged_credits":{"type":"integer"},"refunded_credits":{"type":"integer"},"error_code":{"type":"string","nullable":true},"outputs":{"type":"array","items":{"$ref":"#/components/schemas/GenerationOutput"}}}}}}},"ChatCompletion":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["chat.completion"]},"status":{"type":"string","enum":["succeeded","failed"]},"modality":{"type":"string","enum":["chat"]},"message":{"type":"object","properties":{"role":{"type":"string","enum":["assistant"]},"content":{"type":"string"}}},"charged_credits":{"type":"integer"},"refunded_credits":{"type":"integer"},"error_message":{"type":"string"}}}}},"security":[{"bearerAuth":[]}],"paths":{"/v1/images":{"post":{"summary":"Generate an image (synchronous)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string"},"prompt":{"type":"string"},"aspect_ratio":{"type":"string","enum":["1:1","3:2","2:3","16:9","9:16"]},"num_outputs":{"type":"integer","minimum":1,"maximum":4},"negative_prompt":{"type":"string"},"seed":{"type":"integer"}}}}}},"responses":{"200":{"description":"Generation completed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"402":{"description":"Insufficient credits.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/videos":{"post":{"summary":"Queue a video generation (async)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string"},"prompt":{"type":"string"},"duration_s":{"type":"integer","minimum":2,"maximum":10},"aspect_ratio":{"type":"string","enum":["16:9","9:16","1:1"]},"resolution":{"type":"string","enum":["720p","1080p"]},"image_url":{"type":"string","format":"uri"},"seed":{"type":"integer"}}}}}},"responses":{"202":{"description":"Generation queued. Poll /v1/generations/{id} or subscribe via webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}}}}},"/v1/voice":{"post":{"summary":"Synthesize speech from text (TTS)","description":"Generate spoken audio with Inworld, MiniMax, OpenAI TTS and other voice providers.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","text"],"properties":{"model":{"type":"string"},"text":{"type":"string","maxLength":5000},"voice_id":{"type":"string"},"language":{"type":"string"},"speed":{"type":"number","minimum":0.5,"maximum":2}}}}}},"responses":{"200":{"description":"Speech synthesized. Audio returned in `outputs` with a signed URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"402":{"description":"Insufficient credits.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/music":{"post":{"summary":"Generate music from text prompt","description":"Full-length songs with vocals via MiniMax Music and Google Lyria.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string"},"prompt":{"type":"string"},"duration_s":{"type":"integer","minimum":15,"maximum":180},"with_vocals":{"type":"boolean"}}}}}},"responses":{"202":{"description":"Music generation queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}}}}},"/v1/chat":{"post":{"summary":"Chat completion (synchronous)","description":"Synchronous LLM chat completion across GPT-5, Claude, Gemini, Llama, DeepSeek, Mistral, Qwen and Grok. Credits are charged per output token (reconciled on completion).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string"},"messages":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string","maxLength":50000}}}},"max_tokens":{"type":"integer","minimum":1,"maximum":8000},"temperature":{"type":"number","minimum":0,"maximum":2},"system_prompt":{"type":"string","maxLength":8000}}}}}},"responses":{"200":{"description":"Completion returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}}}},"402":{"description":"Insufficient credits.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/three-d":{"post":{"summary":"Generate a 3D model (async)","description":"Text-to-3D and image-to-3D via TRELLIS, Hunyuan 3D and Rodin. Output is a GLB mesh URL. Some models (Rodin) produce rigged characters.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string"},"prompt":{"type":"string","maxLength":4000},"image_url":{"type":"string","format":"uri"},"texture_size":{"type":"string","enum":["1024","2048","4096"]},"mesh_complexity":{"type":"string","enum":["low","medium","high"]},"rigged":{"type":"boolean"},"seed":{"type":"integer"}}}}}},"responses":{"202":{"description":"3D generation queued. Poll /v1/generations/{id} or subscribe via webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}}}}},"/v1/upscale":{"post":{"summary":"Upscale or restore an image (async)","description":"Image upscaling (2x / 4x) and face restoration via Real-ESRGAN, Clarity, Topaz, Recraft and GFPGAN.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","image_url"],"properties":{"model":{"type":"string"},"image_url":{"type":"string","format":"uri"},"scale_factor":{"type":"string","enum":["2","4"]},"face_enhance":{"type":"boolean"}}}}}},"responses":{"202":{"description":"Upscale queued. Poll /v1/generations/{id} or subscribe via webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}}}}},"/v1/avatars":{"post":{"summary":"Generate a talking avatar video","description":"Lipsync + avatar generation via HeyGen and Sync Labs.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model"],"properties":{"model":{"type":"string"},"text":{"type":"string","maxLength":5000},"voice_id":{"type":"string"},"avatar_id":{"type":"string"},"video_url":{"type":"string","format":"uri"},"audio_url":{"type":"string","format":"uri"}}}}}},"responses":{"202":{"description":"Avatar generation queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}}}}},"/v1/generations/{id}":{"get":{"summary":"Get a generation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Generation found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}}}}},"/v1/generations/{id}/cancel":{"post":{"summary":"Cancel a queued or running generation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Canceled."},"409":{"description":"Generation is not in a cancelable state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/comparisons":{"post":{"summary":"Run a multi-model comparison (async)","description":"Send one prompt to N models and reserve credits for all of them atomically. If the wallet cannot cover the sum, nothing is charged and the call returns 402. The number of models is capped by your plan (Free 2, Pro 3, Studio 6, Team 12).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt","models"],"properties":{"prompt":{"type":"string","maxLength":4000},"models":{"type":"array","minItems":2,"maxItems":12,"items":{"type":"string"}},"params_shared":{"type":"object","additionalProperties":true}}}}}},"responses":{"202":{"description":"Comparison queued. Poll /v1/comparisons/{id} or subscribe via webhook.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comparison"}}}},"402":{"description":"Insufficient credits — nothing was charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/comparisons/{id}":{"get":{"summary":"Get a comparison with all child generations","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Comparison found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comparison"}}}},"404":{"description":"Comparison not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models":{"get":{"summary":"List available models","description":"Returns the live catalog of available models across all modalities with current pricing. Optionally filter by modality.","parameters":[{"name":"modality","in":"query","schema":{"type":"string","enum":["image","video","voice","music","avatar","chat","3d","upscale"]}}],"responses":{"200":{"description":"List of models","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}}}}}}}},"/v1/uploads":{"post":{"summary":"Create a presigned upload URL for input assets","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content_type"],"properties":{"content_type":{"type":"string"}}}}}},"responses":{"200":{"description":"Upload session."}}}},"/v1/webhooks":{"get":{"summary":"List webhooks","responses":{"200":{"description":"OK"}}},"post":{"summary":"Create a webhook","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Created — secret returned once."}}},"delete":{"summary":"Delete a webhook","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted"}}}},"/v1/usage":{"get":{"summary":"Aggregate PAYG usage","parameters":[{"name":"start","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"end","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"group_by","in":"query","schema":{"type":"string","enum":["day","model","api_key"]}}],"responses":{"200":{"description":"Aggregated usage."}}}}}}