{"openapi":"3.1.0","info":{"title":"MakeMidas API","version":"1.0.0","description":"Generate AI images and videos with your MakeMidas credits. Requests use the same credits, plans and models as the website."},"servers":[{"url":"https://makemidas.com/api/v1"}],"security":[{"apiKey":[]},{"oauth2":[]}],"externalDocs":{"url":"https://makemidas.com/developers"},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Create a key in Settings → API keys. `Authorization: Bearer mm_…` also works."},"oauth2":{"type":"oauth2","description":"Authorization code with PKCE (S256). Ask for resource=https://makemidas.com/api/mcp.","flows":{"authorizationCode":{"authorizationUrl":"https://makemidas.com/api/auth/oauth2/authorize","tokenUrl":"https://makemidas.com/api/auth/oauth2/token","refreshUrl":"https://makemidas.com/api/auth/oauth2/token","scopes":{"openid":"Sign in","profile":"Name","email":"Email address","offline_access":"Stay signed in (refresh token)"}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["invalid_inputs","invalid_file","not_found","upgrade_required","busy","insufficient_credits","price_changed","generation_failed","unavailable","unauthorized","email_not_verified"]},"message":{"type":"string"},"credits":{"type":"integer","description":"Current price, sent with price_changed"}}}}},"Generation":{"type":"object","required":["id","kind","model","status","credits","outputs"],"properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["image","video"]},"model":{"type":"string"},"modelLabel":{"type":"string","description":"Display name"},"prompt":{"type":"string"},"params":{"type":"object","additionalProperties":true},"count":{"type":"integer"},"credits":{"type":"integer","description":"Credits charged"},"status":{"type":"string","enum":["running","done","failed"]},"watermarked":{"type":"boolean"},"outputs":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string","enum":["running","done","failed"]},"url":{"type":"string","format":"uri","description":"Signed link, valid for one hour"}}}},"error":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"webUrl":{"type":"string","format":"uri"}}},"GenerationInput":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["image","video"]},"prompt":{"type":"string","minLength":1,"maxLength":4000},"model":{"type":"string","minLength":1},"aspectRatio":{"type":"string","enum":["1:1","2:3","3:2","3:4","4:3","4:5","5:4","9:16","16:9","21:9","9:21"]},"resolution":{"anyOf":[{"type":"string","enum":["1K","2K","4K","480p","720p","768p","1080p"]},{"type":"null"}]},"count":{"type":"integer","minimum":1,"maximum":4},"referenceIds":{"maxItems":10,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"enhance":{"type":"boolean"},"style":{"anyOf":[{"type":"string","enum":["photo","cinematic","film","aerial","anime","animation_3d","comic","watercolor","oil","sketch","pixel","cyberpunk","fantasy","pop_art","minimal"]},{"type":"null"}]},"duration":{"type":"integer","minimum":1,"maximum":30},"frameMode":{"type":"string","enum":["none","first","first_last","reference"]},"audio":{"type":"boolean"},"quotedCredits":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["kind","prompt"]}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/me":{"get":{"summary":"The account behind the key or token","responses":{"200":{"description":"Account","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","description":"Masked"},"plan":{"type":["string","null"]},"paid":{"type":"boolean"},"via":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/credits":{"get":{"summary":"Credit balance and plan limits","responses":{"200":{"description":"Credits","content":{"application/json":{"schema":{"type":"object","properties":{"balance":{"type":"integer"},"expiring":{"type":"array","items":{"type":"object"}},"plan":{"type":["string","null"]},"paid":{"type":"boolean"},"watermarked":{"type":"boolean"},"concurrency":{"type":"integer"},"maxOutputs":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/models":{"get":{"summary":"Models, their options and credit prices","parameters":[{"name":"kind","in":"query","schema":{"type":"string","enum":["image","video"]}}],"responses":{"200":{"description":"Models","content":{"application/json":{"schema":{"type":"object","properties":{"models":{"type":"array","items":{"type":"object"}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/uploads":{"post":{"summary":"Upload a reference image (JPG, PNG or WebP, under 10 MB)","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":"Upload id for referenceIds, kept about a day","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/generations":{"get":{"summary":"Your generations, newest first","parameters":[{"name":"before","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"Generations","content":{"application/json":{"schema":{"type":"object","properties":{"generations":{"type":"array","items":{"$ref":"#/components/schemas/Generation"}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"summary":"Generate images or a video","description":"Images finish within the request (201). Videos return running (202); poll GET /generations/{id}?wait=40.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerationInput"}}}},"responses":{"201":{"description":"Finished","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"202":{"description":"Running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"502":{"$ref":"#/components/responses/Error"}}}},"/generations/{id}":{"get":{"summary":"One generation, brought up to date","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"wait","in":"query","description":"Seconds to wait for a running video","schema":{"type":"integer","minimum":0,"maximum":40}}],"responses":{"200":{"description":"Generation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/auth/revoke":{"post":{"summary":"Sign this OAuth app out","security":[{"oauth2":[]}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"type":"object","properties":{"revoked":{"type":"boolean"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}}}}