{"openapi":"3.1.0","info":{"title":"Memegician API","version":"1.1.0","description":"Generate memes from text with AI, search 550+ templates, and render your own captions onto any template. Image URLs are permanent. Authenticate with `Authorization: Bearer <API key>` (create keys at https://memegician.ai/api-access). Responses include X-RateLimit-Limit / X-RateLimit-Remaining / X-RateLimit-Reset headers. An MCP server for AI assistants is available at https://memegician.ai/mcp.","contact":{"name":"Memegician","url":"https://memegician.ai/contact","email":"support@memegician.ai"}},"servers":[{"url":"https://memegician.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your Memegician API key"}},"schemas":{"Error":{"type":"object","required":["status","type","message"],"properties":{"status":{"type":"integer"},"type":{"type":"string","enum":["validation_error","unauthorized","forbidden","not_found","quota_exceeded","rate_limited","internal_error"]},"message":{"type":"string"},"error":{"type":"string","description":"Same as message (kept for older clients)"},"requestId":{"type":"string"},"timestamp":{"type":"string","format":"date-time"}}},"TemplateSummary":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"category":{"type":"string"},"boxCount":{"type":"integer","description":"Number of text slots"},"imageUrl":{"type":"string","format":"uri","description":"Blank template image (permanent)"},"pageUrl":{"type":"string","format":"uri"}}},"TextSlot":{"type":"object","description":"Where a caption goes. x/y are the CENTER of the box; all values are fractions (0-1) of the image size.","properties":{"index":{"type":"integer"},"label":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"}}},"TemplateDetail":{"allOf":[{"$ref":"#/components/schemas/TemplateSummary"},{"type":"object","properties":{"width":{"type":["integer","null"]},"height":{"type":["integer","null"]},"description":{"type":["string","null"]},"whenToUse":{"type":["string","null"]},"exampleCaptions":{"type":"array","items":{"type":"string"}},"textSlots":{"type":"array","items":{"$ref":"#/components/schemas/TextSlot"}}}}]},"RenderedMeme":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Permanent PNG URL"},"templateId":{"type":"integer"},"templateName":{"type":"string"},"captions":{"type":"array","items":{"type":"string"}},"width":{"type":"integer"},"height":{"type":"integer"},"watermarked":{"type":"boolean"}}}}},"paths":{"/api/v1/memes/text-to-meme":{"post":{"summary":"Text to memes (AI picks templates and writes captions)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string","minLength":1,"maxLength":2500,"description":"A topic, situation or idea"},"count":{"type":"integer","minimum":1,"maximum":12,"default":6},"aspectRatio":{"type":"string","enum":["1:1","3:4","4:3","9:16","16:9"],"description":"Pad the finished meme to this aspect ratio."},"paddingColor":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$","default":"#FFFFFF"}}}}}},"responses":{"200":{"description":"Rendered memes","content":{"application/json":{"schema":{"type":"object","properties":{"memes":{"type":"array","items":{"type":"string","format":"uri"},"description":"Permanent PNG URLs"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan has no API access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Monthly API quota used up","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/memes/text-to-meme/raw":{"post":{"summary":"Text to captions + blank templates (render them yourself)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string","minLength":1,"maxLength":2500},"count":{"type":"integer","minimum":1,"maximum":12,"default":6}}}}}},"responses":{"200":{"description":"Captions per template","content":{"application/json":{"schema":{"type":"object","properties":{"memes":{"type":"array","items":{"type":"object","properties":{"captions":{"type":"array","items":{"type":"string"}},"templateId":{"type":"integer"},"templateName":{"type":"string"},"templateImage":{"type":"string","format":"uri"}}}},"originalText":{"type":"string"},"languageCode":{"type":"string"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan has no API access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Monthly API quota used up","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/memes/render":{"post":{"summary":"Render your captions onto a template (no AI)","description":"Fetch a template's textSlots first (GET /api/v1/templates/{id}) and pass one caption per slot, in order.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["templateId","captions"],"properties":{"templateId":{"type":"integer"},"captions":{"type":"array","minItems":1,"maxItems":12,"items":{"type":"string","maxLength":200}},"aspectRatio":{"type":"string","enum":["1:1","3:4","4:3","9:16","16:9"],"description":"Pad the finished meme to this aspect ratio."},"paddingColor":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$","default":"#FFFFFF"}}}}}},"responses":{"200":{"description":"Rendered meme","content":{"application/json":{"schema":{"type":"object","properties":{"meme":{"$ref":"#/components/schemas/RenderedMeme"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan has no API access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Monthly API quota used up","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/memes/text-to-visual":{"post":{"summary":"AI-generated original meme images","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string","minLength":1,"maxLength":2500},"count":{"type":"integer","minimum":1,"maximum":3,"default":1},"aspectRatio":{"type":"string","enum":["1:1","3:4","4:3","9:16","16:9"],"description":"Pad the finished meme to this aspect ratio."},"style":{"type":"string","enum":["clean","cartoon","realistic","pixel"]}}}}}},"responses":{"200":{"description":"Generated images","content":{"application/json":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"string","format":"uri"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan has no API access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Monthly API quota used up","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/templates/search":{"get":{"summary":"Semantic template search (free, doesn't use quota)","parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string"},"description":"Emotion, situation or template name"},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":20}}],"responses":{"200":{"description":"Matching templates","content":{"application/json":{"schema":{"type":"object","properties":{"templates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"category":{"type":"string"},"boxCount":{"type":"integer"},"imageUrl":{"type":"string","format":"uri"}}}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan has no API access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Monthly API quota used up","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/templates/{id}":{"get":{"summary":"Template detail with text-slot positions (free, doesn't use quota)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Template","content":{"application/json":{"schema":{"type":"object","properties":{"template":{"$ref":"#/components/schemas/TemplateDetail"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Plan has no API access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Monthly API quota used up","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/templates/trending":{"get":{"summary":"Most-searched meme templates this month (public, no key needed)","security":[],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":25,"default":10}}],"responses":{"200":{"description":"From the monthly Meme Trends report (Google search volume, US)","content":{"application/json":{"schema":{"type":"object","properties":{"month":{"type":["string","null"]},"templates":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"pageUrl":{"type":"string"},"monthlySearches":{"type":"integer"},"changePct":{"type":["integer","null"]}}}},"risers":{"type":"array","items":{"type":"object"}}}}}}}}}}}}