free · no API key · llms.txt

Memes for AI agents

Every meme is a URL, so an agent that can send one request can make one. Point your agent at /llms.txt, or paste the ready-made instructions into its prompt.

This guide is written for AI agents and the people who build them. The raw markdown lives at https://memegenscript.com/llms.txt. The OpenAPI document is at https://memegenscript.com/docs/openapi.json.

Make a meme in one request

Send the raw text and let the server do the escaping:

POST https://memegenscript.com/images
Content-Type: application/json

{"template_id": "drake", "text": ["Paying for a meme API", "Writing a URL & done"]}

The response is 201 with the finished image URL:

{"url": "https://memegenscript.com/images/drake/paying_for_a_meme_api/writing_a_url_~a_done.png"}

That URL is the meme. Use it as it is: embed it, post it, or download the bytes. The same URL always renders the same image, and rendered images are cached, so reuse a URL instead of creating it again.

Choose a template

Search by describing the meme or the situation. Every word must match the template's name, aliases, tags, example text, or description:

GET https://memegenscript.com/templates?q=guy+looking+at+girl

Each result has what you need to choose and to build the meme:

FieldMeaning
idThe template ID. It goes after /images/ and in template_id
name, aliasesWhat people call the meme
descriptionWhat the meme shows and when it is used. Read this to check the joke fits
linesThe number of text slots. Send at most this many strings
example.textA caption that works, which shows what goes in each slot
example.urlA rendered example. It is guaranteed to work
stylesAllowed values for style=

If nothing matches, try fewer or different words: search for the feeling (regret, choice, panic) and not only the picture. GET https://memegenscript.com/templates returns every template without descriptions (about 200 KB), and GET https://memegenscript.com/templates/{id} returns one.

Write text that fits

Build the URL yourself

You can skip the POST and write the URL directly:

https://memegenscript.com/images/{id}/{line_1}/{line_2}.{ext}

{ext} is png, jpg, gif, or webp. Escape each line with these rules:

CharacterWrite it as
space_
underscore ___
dash ---
?~q
&~a
%~p
#~h
/~s
\~b
< and >~l and ~g
"'' (two single quotes)
line break~n
empty linea single _ as the whole segment

Example: https://memegenscript.com/images/fry/not_sure_if_bug/or_feature~q.png

If the text has any punctuation, prefer the POST. It applies these rules for you.

Options

Add these as query parameters to any image URL, including a URL that the POST returned:

OptionEffect
width=800, height=800Output size in pixels. With both, the image is padded to fit
font=impactAnother font. The list is at GET https://memegenscript.com/fonts
color=white,yellowText color for each line, as a color name or a hex code
style=NAMEA variant of the template, from its styles list
layout=topPut all the text at the top of the image

The POST body also accepts font, style, layout, and extension, and puts them in the URL for you.

The extension sets the format: png and jpg are still images, gif and webp are animated. Templates with an animated style default to gif, which is larger and slower to render. Send "extension": "png" when you want a still image.

Use your own image

Put text on any image with the custom template:

POST https://memegenscript.com/images/custom
Content-Type: application/json

{"background": "https://example.com/photo.jpg", "text": ["top text", "bottom text"]}

The image URL must be public. Keep the image small: a large photo is slow to download and render.

Post it

Errors

Check the HTTP status code. A failed image URL still returns an image (a picture of the error) with the error status, so a 200 is the only proof that the meme rendered. A POST with an unknown template_id returns 404 together with a url. Do not use that URL.

StatusCauseWhat to do
404Unknown template IDSearch /templates?q= again. Do not guess IDs
414A text line is longer than 200 bytesShorten the line
415A custom image URL could not be downloadedCheck that the URL is public and is an image
422Unknown style, font, color, or extension, or a width or height under 10Use values from the template's styles and from /fonts

Rules of the road

Instructions to give your agent

Paste this into your agent's system prompt or skill file:

You can make memes with Memegenscript (https://memegenscript.com). No API key is needed.
1. Find a template: GET https://memegenscript.com/templates?q=<words describing the meme or the situation>.
   Read "description" and "example.text" to check that the joke fits. Note "id" and "lines".
2. Create the meme: POST https://memegenscript.com/images with JSON
   {"template_id": "<id>", "text": ["<slot 1>", "<slot 2>"]}
   Send at most "lines" strings, each about 60 characters or less.
3. The response {"url": "..."} is the finished image. Post that URL, or download it to upload.
Never invent a template ID. Only a 201 from the POST and a 200 from the image URL mean success. Full guide: https://memegenscript.com/llms.txt