Overview
AI Meme Generator creates humorous memes by combining popular meme templates with your custom topics. The API automatically generates contextually appropriate text for both top and bottom panels that fits the chosen meme template and your specified topic.
How It Works
Choose a template - Select from popular meme formats (Drake, Distracted Boyfriend, etc.)
Provide a topic - Describe what the meme should be about
Optional web search - Enable AI to search for relevant context
API generates text - AI creates appropriate text for the meme panels
Download - Retrieve your completed meme
Use Cases
Social media content - Quick meme generation for engagement
Marketing campaigns - Relatable brand content
Internal communications - Team humor and culture building
Educational content - Making learning more engaging
Community management - Timely responses to trends
Best Practices
Topic Selection
Be specific about your topic - Clear topics generate more relevant and funny memes.
✅ Good topics:
“When the code finally works after 3 hours of debugging”
“Designers vs developers arguing about button placement”
“Coffee before and after the first sip”
“Me explaining my job to my parents”
❌ Avoid:
Vague topics like “work” or “life”
Topics requiring extensive context
Offensive or controversial subjects
Template Selection
Popular templates work best with their intended formats:
Template Best For Example Topic Drake Hotline Bling Preferences, choices ”Old code vs new refactored code” Distracted Boyfriend Conflicting interests ”Me, my project, new framework” Two Buttons Difficult decisions ”Fix bug or add feature” Expanding Brain Progressive ideas ”Levels of code optimization”
Web Search Option
Enable search_web: true when your topic references current events or trends
Disable search_web: false for general topics that don’t need context
Web search may add slight processing time but improves relevance
Code Examples
Basic Meme Generation
from magic_hour import Client
import os
client = Client( token = os.getenv( "MAGIC_HOUR_API_KEY" ))
result = client.v1.ai_meme_generator.generate(
style = {
"search_web" : False ,
"template" : "Drake Hotline Bling" ,
"topic" : "When the code finally works after hours of debugging"
},
name = "Code Works Meme" ,
wait_for_completion = True ,
download_outputs = True ,
download_directory = "./outputs/"
)
if result.status == "complete" :
print ( f "✅ Meme complete!" )
print ( f "Downloaded to: { result.downloaded_paths } " )
print ( f "Credits charged: { result.credits_charged } " )
else :
print ( f "❌ Job failed with status: { result.status } " )
if hasattr (result, 'error_message' ):
print ( f "Error: { result.error_message } " )
Random Template
result = client.v1.ai_meme_generator.generate(
style = {
"search_web" : False ,
"template" : "Random" ,
"topic" : "Forgetting to turn the stove off at 2am"
},
name = "Stove Meme" ,
wait_for_completion = True ,
download_outputs = True ,
download_directory = "./outputs/"
)
if result.status == "complete" :
print ( f "✅ Meme complete!" )
print ( f "Downloaded to: { result.downloaded_paths } " )
print ( f "Credits charged: { result.credits_charged } " )
else :
print ( f "❌ Job failed with status: { result.status } " )
if hasattr (result, 'error_message' ):
print ( f "Error: { result.error_message } " )
With Web Search
result = client.v1.ai_meme_generator.generate(
style = {
"search_web" : True ,
"template" : "Two Buttons" ,
"topic" : "The latest controversy in AI image generation"
},
name = "AI Controversy Meme" ,
wait_for_completion = True ,
download_outputs = True ,
download_directory = "./outputs/"
)
if result.status == "complete" :
print ( f "✅ Meme complete!" )
print ( f "Downloaded to: { result.downloaded_paths } " )
print ( f "Credits charged: { result.credits_charged } " )
else :
print ( f "❌ Job failed with status: { result.status } " )
if hasattr (result, 'error_message' ):
print ( f "Error: { result.error_message } " )
Pricing
Output Credits 1 meme 10 credits
API Reference
AI Meme Generator API Reference View full API specification