AI Meme API
Generate memes programmatically using the Memelord API
01Quick Start
Generate a rendered meme and get back a download URL:
curl -X POST https://www.memelord.com/api/v1/ai-meme \
-H "Authorization: Bearer mlord_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "developer fixing bugs at 3am"}'Endpoint:
POST /api/v1/ai-meme— Generates and renders memes, returns hosted download URLs with template metadata.
02Authentication
All API requests require an API key passed in the Authorization header.
Get your API key: Visit Developer Settings to create and manage your API keys.
Authorization: Bearer mlord_live_xxxxxxxxxxxxxxxxxxxxxx
03Endpoint
POST /api/v1/ai-meme
Generates memes with AI-powered text, renders them server-side, and returns signed download URLs along with full template metadata.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | Topic or idea for the meme |
| count | number | No | Number of memes to generate (default: 1, max: 10) |
| category | string | No | Filter templates by category: "trending" or "classic". Omit for all templates. |
| include_nsfw | boolean | No | Include NSFW templates (default: true) |
Example Request
{
"prompt": "when the code works on the first try",
"count": 2,
"category": "trending"
}Response (200)
{
"success": true,
"prompt": "when the code works on the first try",
"total_generated": 2,
"total_requested": 2,
"results": [
{
"success": true,
"url": "https://...supabase.co/storage/v1/object/sign/...",
"expires_in": 86400,
"template_url": "https://...original-template-image...",
"template_name": "Drake Hotline Bling",
"template_id": "abc-123",
"template_data": {
"render_mode": "template",
"width": 800,
"height": 600,
"template": [
{ "id": "top", "x": 400, "y": 50, "w": 350, "text": "writing clean code" },
{ "id": "bottom", "x": 400, "y": 350, "w": 350, "text": "shipping it at 3am" }
],
"caption": null,
"expanded_height": null
}
}
]
}Note: Signed URLs expire after 24 hours. Download or cache the image before the URL expires.
04Error Codes
| Status | Error | Description |
|---|---|---|
| 400 | Missing prompt / Invalid category | The prompt field is required. Category must be "trending" or "classic". |
| 401 | Invalid or missing API key | Check your API key is correct and not revoked |
| 402 | Insufficient API credits | Purchase more credits at Developer Settings |
| 403 | Subscription required | An active subscription is required to use the API |
05Code Examples
cURL
curl -X POST https://www.memelord.com/api/v1/ai-meme \
-H "Authorization: Bearer mlord_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "monday morning meetings", "count": 3}'JavaScript / Node.js
const response = await fetch('https://www.memelord.com/api/v1/ai-meme', {
method: 'POST',
headers: {
'Authorization': 'Bearer mlord_live_YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
prompt: 'monday morning meetings',
count: 2,
category: 'trending'
})
});
const data = await response.json();
// Download the rendered meme
console.log(data.results[0].url);
// => "https://...supabase.co/storage/v1/object/sign/..."
// Access the template metadata
console.log(data.results[0].template_name);
// => "Drake Hotline Bling"
console.log(data.results[0].template_data.render_mode);
// => "template"Python
import requests
response = requests.post(
'https://www.memelord.com/api/v1/ai-meme',
headers={
'Authorization': 'Bearer mlord_live_YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'prompt': 'monday morning meetings',
'count': 2,
'include_nsfw': False
}
)
data = response.json()
print(data['results'][0]['url']) # signed URL, valid 24h
print(data['results'][0]['template_name']) # e.g. "Drake Hotline Bling"06Rate Limits
- 60 requests per minute per API key
- Requests beyond the limit will receive a 429 response