{"openapi":"3.1.0","info":{"title":"Memeforge API","version":"1.1.0","description":"Agent-first meme generation API. Keyed REST; JSON errors everywhere; image endpoints return raw bytes by default or a base64 JSON envelope with Accept: application/json. Generation is synchronous and can take 30-120s -- set client timeouts to 180s+. Free tier: 50 generations/day per key. Filters: prompt-preset image styles (face swaps locked). Docs: https://memeforge-8dq.pages.dev/api.html"},"servers":[{"url":"https://memeforge-ai.nonhumanagent.workers.dev"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Memeforge API key (mf_live_...). /v1/health and /v1/openapi.json are keyless."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Template":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string","format":"uri"},"width":{"type":"integer"},"height":{"type":"integer"},"box_count":{"type":"integer"}}},"ImageJson":{"type":"object","properties":{"image_base64":{"type":"string"},"content_type":{"type":"string"},"model":{"type":"string"},"ms":{"type":"integer"},"note":{"type":"string"}}}}},"paths":{"/v1/health":{"get":{"summary":"Service status (keyless)","security":[],"responses":{"200":{"description":"ok"}}}},"/v1/openapi.json":{"get":{"summary":"This spec (keyless)","security":[],"responses":{"200":{"description":"OpenAPI 3.1 JSON"}}}},"/v1/templates":{"get":{"summary":"List meme templates","parameters":[{"name":"q","in":"query","schema":{"type":"string"},"description":"name search, e.g. ?q=drake"}],"responses":{"200":{"description":"templates"},"401":{"description":"bad key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/filters":{"get":{"summary":"List image filters (style filters available; face swaps locked)","responses":{"200":{"description":"filters"},"401":{"description":"bad key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/usage":{"get":{"summary":"Quota and usage for this key","responses":{"200":{"description":"usage"},"401":{"description":"bad key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/images/backdrop":{"post":{"summary":"Generate a fresh meme backdrop from a text prompt","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","maxLength":300}},"required":["prompt"]}}}},"responses":{"200":{"description":"image bytes, or base64 JSON envelope with Accept: application/json"},"400":{"description":"bad prompt"},"401":{"description":"bad key"},"429":{"description":"quota or budget exhausted"},"502":{"description":"model failed"}}}},"/v1/images/restyle":{"post":{"summary":"Reimagine an uploaded image from a text prompt (AI restyle, not a face-swap)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","maxLength":300},"image":{"type":"string","description":"data URL, max ~2.5MB decoded"}},"required":["prompt","image"]}}}},"responses":{"200":{"description":"image bytes, or base64 JSON envelope with Accept: application/json"},"400":{"description":"bad prompt/image"},"401":{"description":"bad key"},"429":{"description":"quota or budget exhausted"},"502":{"description":"model failed"}}}},"/v1/images/filter":{"post":{"summary":"Apply a style filter to an image (Memelord-style)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filter_id":{"type":"string","description":"from GET /v1/filters, e.g. wojakify"},"image":{"type":"string","description":"data URL, max ~2.5MB decoded"},"image_url":{"type":"string","format":"uri","description":"or a URL to the image"}},"required":["filter_id"]}}}},"responses":{"200":{"description":"filtered image bytes, or base64 JSON envelope with Accept: application/json"},"400":{"description":"bad filter/image, or filter unavailable"},"401":{"description":"bad key"},"429":{"description":"quota or budget exhausted"},"502":{"description":"model failed"}}}},"/v1/memes/caption":{"post":{"summary":"Magic Prompt: AI-caption an asset and render the finished meme in Impact style","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","maxLength":300,"description":"topic for the AI caption writer"},"template_id":{"type":"string","description":"meme template id"},"q":{"type":"string","description":"search templates by name"},"image_url":{"type":"string","format":"uri"},"image":{"type":"string","description":"data URL"},"top":{"type":"string","maxLength":90,"description":"own top caption, skips AI (free)"},"bottom":{"type":"string","maxLength":90,"description":"own bottom caption, skips AI (free)"}}}}}},"responses":{"200":{"description":"meme as SVG, or JSON envelope with Accept: application/json"},"400":{"description":"bad prompt/template/image"},"401":{"description":"bad key"},"429":{"description":"quota or budget exhausted"},"502":{"description":"caption model failed"}}}}}}