---
title: "Docs: MCP and REST reference | Lolgent"
description: "Connect Lolgent over MCP or REST. Authentication, all eight tools with parameters and examples, errors, the slow-call request_id pattern, quota and rate limits."
canonical_url: "https://lolgent.com/docs"
meta:
  "og:description": "Connect Lolgent over MCP or REST. Authentication, all eight tools with parameters and examples, errors, the slow-call request_id pattern, quota and rate limits."
  "og:image": "https://lolgent.com/og.png"
  "og:title": "Docs: MCP and REST reference | Lolgent"
---

> Index of every page on this site: [llms.txt](https://lolgent.com/llms.txt)

# Docs

Lolgent gives an agent eight tools for making memes. They are available over MCP at `https://lolgent.com/mcp` and as REST endpoints under `https://lolgent.com/api/v1`. Both call the same functions and return the same JSON.

- `create_meme`: you have a topic, Lolgent writes the joke.
- `render_meme`: you have the lines, Lolgent draws them.

For agents: this page is also at [/docs.md](https://lolgent.com/docs.md) and summarised in [/llms.txt](https://lolgent.com/llms.txt).

## Connect over MCP

The server speaks Streamable HTTP at `https://lolgent.com/mcp`. Send your key in the `Authorization` header. Create a key on the [Keys page](https://lolgent.com/app/keys); the setup snippets there come prefilled with it.

```
$ claude mcp add --transport http lolgent https://lolgent.com/mcp --header "Authorization: Bearer YOUR_KEY"
```

Then ask your agent something like “make a meme about our dark mode launch”. It will find `create_meme` on its own; the tool descriptions explain when to use which tool.

## Authentication

Every MCP and REST call needs an API key, sent as a bearer token. Keys look like `lol_ab12cd_…`, are shown once when created, and are stored only as a hash. Revoke a key on the Keys page and it stops working at once.

```
Authorization: Bearer lol_ab12cd_xxxxxxxxxxxxxxxxxxxx
```

Template listings and images are public and need no key. A missing, invalid or revoked key returns `401`.

## REST basics

Base URL `https://lolgent.com/api/v1`. Requests and responses are JSON. Each tool below lists its endpoint; MCP argument names and REST body fields are the same unless noted.

| **POST**/api/v1/memes | [create\_meme](#create_meme) |
| --- | --- |
| **POST**/api/v1/memes/render | [render\_meme](#render_meme) |
| **GET**/api/v1/templates?q=&limit= | [search\_templates](#search_templates) |
| **GET**/api/v1/brands | [list\_brands](#list_brands) |
| **GET**/api/v1/brands/:id | [get\_brand](#get_brand) |
| **POST**/api/v1/brands · PATCH /api/v1/brands/:id | [save\_brand](#save_brand) |
| **POST**/api/v1/brands/:id/notes | [remember](#remember) |
| **POST**/api/v1/memes/:id/rating | [rate\_meme](#rate_meme) |

## Tools

Send every parameter marked required. The rest are optional.

### **create\_meme**

Uses AI

Turns a topic into 1 to 3 finished memes. AI picks the template and writes the lines; code draws the image.

**POST** /api/v1/memes

| **Parameter ** | **Type ** | **Description ** |
| --- | --- | --- |
| topicrequired | string | What the meme is about, in plain words. Specific beats short. Not needed when request\_id is given. |
| brand\_id | string | Use this brand's voice, audience, avoid list and recent memes. |
| template | string | Force a template by slug. Leave out to let Lolgent choose. |
| tone | string | For example "dry", "wholesome", "unhinged". |
| language | string | Language code for the lines. Defaults to the brand's language, then English. |
| count | integer | How many options to return, 1 to 3. Default 1. |
| request\_id | string (uuid) | Pass the request\_id from a pending answer to collect the result. Other fields are ignored. |

**Request **

```
{
  "topic": "We finally shipped dark mode",
  "brand_id": "brd_4k2m9x7q1z",
  "count": 1
}
```

**Response **

```
{
  "status": "done",
  "request_id": "3f6c1a9e-2b7d-4c41-9a0e-5d8f2b6c7e10",
  "memes": [
    {
      "id": "k3x9q2mf7a",
      "url": "https://lolgent.com/m/k3x9q2mf7a.jpg",
      "png_url": "https://lolgent.com/m/k3x9q2mf7a.png",
      "template": "drake",
      "template_name": "Drake Hotline Bling",
      "lines": [
        "Writing the changelog",
        "Shipping and hoping nobody asks"
      ],
      "source": "ai",
      "reason": "Rejecting the responsible chore for the tempting shortcut is the core Drake move.",
      "brand_id": "brd_4k2m9x7q1z",
      "verdict": null,
      "verdict_note": null,
      "created_at": "2026-11-29T10:12:03.000Z"
    }
  ]
}
```

### **render\_meme**

No AI

Draws your own lines on a template. There is no AI in the loop, so it answers in well under a second.

**POST** /api/v1/memes/render

| **Parameter ** | **Type ** | **Description ** |
| --- | --- | --- |
| templaterequired | string | Template slug, e.g. "drake". |
| linesrequired | string\[] | One line per slot, in slot order. Each within the slot's max\_chars. "" leaves a slot empty, "\\n" forces a break. |
| brand\_id | string | File the meme under a brand so it shows in its recent memes. |

**Request **

```
{
  "template": "drake",
  "lines": [
    "Writing the changelog",
    "Shipping and hoping nobody asks"
  ]
}
```

**Response **

```
{
  "meme": {
    "id": "k3x9q2mf7a",
    "url": "https://lolgent.com/m/k3x9q2mf7a.jpg",
    "png_url": "https://lolgent.com/m/k3x9q2mf7a.png",
    "template": "drake",
    "template_name": "Drake Hotline Bling",
    "lines": [
      "Writing the changelog",
      "Shipping and hoping nobody asks"
    ],
    "source": "provided",
    "reason": null,
    "brand_id": null,
    "verdict": null,
    "verdict_note": null,
    "created_at": "2026-11-29T10:12:03.000Z"
  }
}
```

### **search\_templates**

No AI

Finds templates by name, alias, tag or the joke they fit. Returns slot roles, length limits and a filled example.

**GET** /api/v1/templates?q=&limit=

| **Parameter ** | **Type ** | **Description ** |
| --- | --- | --- |
| query | string | Free text, e.g. "choosing between two options". REST: q. |
| limit | integer | Maximum results. Default 10. |

**Request **

```
{
  "query": "prefer one thing over another",
  "limit": 1
}
```

**Response **

```
{
  "templates": [
    {
      "slug": "drake",
      "name": "Drake Hotline Bling",
      "aliases": [
        "drakeposting"
      ],
      "tags": [
        "preference",
        "comparison"
      ],
      "when_to_use": "Rejecting one option and approving another.",
      "slots": [
        {
          "id": "top",
          "role": "the thing rejected",
          "max_chars": 60
        },
        {
          "id": "bottom",
          "role": "the thing preferred",
          "max_chars": 60
        }
      ],
      "example": {
        "lines": [
          "Writing the changelog",
          "Shipping and hoping nobody asks"
        ]
      },
      "image_url": "https://lolgent.com/t/drake.jpg",
      "example_url": "https://lolgent.com/t/drake/example.jpg",
      "page_url": "https://lolgent.com/templates/drake"
    }
  ]
}
```

### **list\_brands**

No AI

Lists the brands on this account with id, name and language.

**GET** /api/v1/brands

No parameters.

**Request **

```
{}
```

**Response **

```
{
  "brands": [
    {
      "id": "brd_4k2m9x7q1z",
      "name": "Acme Deploys",
      "language": "en",
      "profile": {
        "about": "A hosting platform for small dev teams.",
        "audience": "Backend developers who deploy on Fridays anyway.",
        "voice": "Dry, self-aware, never mean about customers.",
        "examples": [
          "We made deploys boring. You are welcome."
        ],
        "avoid": [
          "outages",
          "competitor names"
        ],
        "in_jokes": [
          "the intern who deleted prod"
        ],
        "glossary": [
          "Acme Edge",
          "preview deploys"
        ]
      },
      "created_at": "2026-11-20T09:00:00.000Z",
      "updated_at": "2026-11-28T16:40:00.000Z"
    }
  ]
}
```

### **get\_brand**

No AI

Returns a brand's profile, its notes and its recent memes with ratings.

**GET** /api/v1/brands/:id

| **Parameter ** | **Type ** | **Description ** |
| --- | --- | --- |
| brand\_idrequired | string | The brand to read. |

**Request **

```
{
  "brand_id": "brd_4k2m9x7q1z"
}
```

**Response **

```
{
  "brand": {
    "id": "brd_4k2m9x7q1z",
    "name": "Acme Deploys",
    "language": "en",
    "profile": {
      "about": "A hosting platform for small dev teams.",
      "audience": "Backend developers who deploy on Fridays anyway.",
      "voice": "Dry, self-aware, never mean about customers.",
      "examples": [
        "We made deploys boring. You are welcome."
      ],
      "avoid": [
        "outages",
        "competitor names"
      ],
      "in_jokes": [
        "the intern who deleted prod"
      ],
      "glossary": [
        "Acme Edge",
        "preview deploys"
      ]
    },
    "created_at": "2026-11-20T09:00:00.000Z",
    "updated_at": "2026-11-28T16:40:00.000Z"
  },
  "notes": [
    {
      "id": "nt_3k1",
      "text": "The intern joke did well on LinkedIn.",
      "source": "agent",
      "created_at": "2026-11-27T12:00:00.000Z"
    }
  ],
  "recent_memes": [
    {
      "id": "k3x9q2mf7a",
      "url": "https://lolgent.com/m/k3x9q2mf7a.jpg",
      "png_url": "https://lolgent.com/m/k3x9q2mf7a.png",
      "template": "drake",
      "template_name": "Drake Hotline Bling",
      "lines": [
        "Writing the changelog",
        "Shipping and hoping nobody asks"
      ],
      "source": "ai",
      "reason": "Rejecting the responsible chore for the tempting shortcut is the core Drake move.",
      "brand_id": "brd_4k2m9x7q1z",
      "verdict": null,
      "verdict_note": null,
      "created_at": "2026-11-29T10:12:03.000Z"
    }
  ]
}
```

### **save\_brand**

No AI

Creates a brand, or updates one when brand\_id is given. Only the fields you send change.

**POST** /api/v1/brands · PATCH /api/v1/brands/:id

| **Parameter ** | **Type ** | **Description ** |
| --- | --- | --- |
| brand\_id | string | Leave out to create a new brand. |
| name | string | Required when creating. |
| language | string | Default language for lines, e.g. "en", "da". |
| about, audience, voice | string | What the brand sells, who follows it, how it talks. |
| examples, avoid, in\_jokes, glossary | string\[] | Lists replace the old list. avoid is enforced in code. REST: send these inside a profile object. |

**Request **

```
{
  "name": "Acme Deploys",
  "language": "en",
  "voice": "Dry, self-aware, never mean about customers.",
  "avoid": [
    "outages"
  ]
}
```

**Response **

```
{
  "brand": {
    "id": "brd_4k2m9x7q1z",
    "name": "Acme Deploys",
    "language": "en",
    "profile": {
      "about": "A hosting platform for small dev teams.",
      "audience": "Backend developers who deploy on Fridays anyway.",
      "voice": "Dry, self-aware, never mean about customers.",
      "examples": [
        "We made deploys boring. You are welcome."
      ],
      "avoid": [
        "outages",
        "competitor names"
      ],
      "in_jokes": [
        "the intern who deleted prod"
      ],
      "glossary": [
        "Acme Edge",
        "preview deploys"
      ]
    },
    "created_at": "2026-11-20T09:00:00.000Z",
    "updated_at": "2026-11-28T16:40:00.000Z"
  }
}
```

### **remember**

No AI

Adds a short dated note to a brand. Notes go into every later prompt for that brand.

**POST** /api/v1/brands/:id/notes

| **Parameter ** | **Type ** | **Description ** |
| --- | --- | --- |
| brand\_idrequired | string | The brand the note belongs to. |
| noterequired | string | One remark, e.g. "the intern joke did well". |

**Request **

```
{
  "brand_id": "brd_4k2m9x7q1z",
  "note": "The intern joke did well on LinkedIn."
}
```

**Response **

```
{
  "note": {
    "id": "nt_3k1",
    "text": "The intern joke did well on LinkedIn.",
    "source": "agent",
    "created_at": "2026-11-27T12:00:00.000Z"
  }
}
```

### **rate\_meme**

No AI

Marks a meme as used, liked or rejected, with an optional note. Ratings show up in the brand's recent memes, so the writer learns what lands.

**POST** /api/v1/memes/:id/rating

| **Parameter ** | **Type ** | **Description ** |
| --- | --- | --- |
| meme\_idrequired | string | The meme's id. REST: in the path. |
| verdictrequired | "used" \| "liked" \| "rejected" | What happened to it. |
| note | string | Why, in a few words. |

**Request **

```
{
  "meme_id": "k3x9q2mf7a",
  "verdict": "used",
  "note": "Posted on X"
}
```

**Response **

```
{
  "meme": {
    "id": "k3x9q2mf7a",
    "url": "https://lolgent.com/m/k3x9q2mf7a.jpg",
    "png_url": "https://lolgent.com/m/k3x9q2mf7a.png",
    "template": "drake",
    "template_name": "Drake Hotline Bling",
    "lines": [
      "Writing the changelog",
      "Shipping and hoping nobody asks"
    ],
    "source": "ai",
    "reason": "Rejecting the responsible chore for the tempting shortcut is the core Drake move.",
    "brand_id": "brd_4k2m9x7q1z",
    "verdict": "used",
    "verdict_note": "Posted on X",
    "created_at": "2026-11-29T10:12:03.000Z"
  }
}
```

## History and single memes

Two read-only REST endpoints that have no MCP tool of their own:

**GET** /api/v1/memes?brand\_id=&source=&limit=&before=

Your memes, newest first. Filter by `brand_id` or `source` (`ai` or `provided`). Returns `{ memes, next_before }`; pass `next_before` as `before` for the next page.

**GET** /api/v1/memes/:id

One meme with its lines, reason and rating: `{ meme }`.

## Images

Image URLs are public, so you can post them directly or hand them to another tool. A meme never changes after it is made, so the images are cached for a long time.

- `/m/<id>.jpg` and `/m/<id>.png`: a meme you made.
- `/t/<slug>.jpg`: a blank template.
- `/t/<slug>/example.jpg`: a template with its example lines.

## Slow calls and request\_id

`create_meme` usually takes 10 to 25 seconds, because Claude writes eight candidates and then ranks them. The call waits up to 25 seconds. If the memes are not ready by then, it returns `status: "pending"` with a `request_id` instead of failing:

```
{
  "status": "pending",
  "request_id": "3f6c1a9e-2b7d-4c41-9a0e-5d8f2b6c7e10",
  "message": "Still writing. Call create_meme again with this request_id."
}
```

Call `create_meme` again with only that id. It waits again and returns `status: "done"` with the memes, or `"failed"` with an `error`. The job keeps running between calls, and collecting it does not count toward your quota again.

create\_meme

```
{
  "request_id": "3f6c1a9e-2b7d-4c41-9a0e-5d8f2b6c7e10"
}
```

## Errors

Errors use HTTP status codes and a JSON body with a human-readable `message`. Over MCP the same message comes back as a tool error, so the agent can read it and correct itself.

```
{
  "statusCode": 400,
  "statusMessage": "Bad Request",
  "message": "line 2 (bottom) is 74 characters, the limit is 60",
  "data": {
    "problems": [
      "line 2 (bottom) is 74 characters, the limit is 60"
    ]
  }
}
```

| **400** | Invalid input. data.problems lists each problem, e.g. a line over its max\_chars or the wrong number of lines. |
| --- | --- |
| **401** | Missing, invalid or revoked API key. |
| **404** | Unknown template, brand or meme. The message says where to look it up. |
| **429** | Monthly quota used up, or too many calls a minute. The message says which, and when to retry. |
| **500** | Something broke on our side. Retry once; if it persists, it is on us. |

## Quota and rate limits

Every account has a monthly quota set by its plan. It resets at 00:00 UTC on the 1st. This month's usage is on the [Keys page](https://lolgent.com/app/keys), and [pricing](https://lolgent.com/#pricing) has the plans.

| **Plan ** | **AI memes a month ** | **Renders a month ** | **Price ** |
| --- | --- | --- | --- |
| **Free** | 10 | 100 | Free |
| **Pro** | 100 | 5,000 | $19 / month |
| **Studio** | 300 | 25,000 | $49 / month |

A `create_meme` call uses as many AI memes as its `count` (1 to 3). Collecting a pending result is free, and a failed request is not counted. Renders count each `render_meme` with your own lines; live previews in the playground are free. When the AI quota runs out, `render_meme` keeps working until its own quota is used.

On top of the quota, calls are rate limited per key: 10 a minute for `create_meme`, 60 a minute for `render_meme` and 120 a minute for everything else. Over the limit you get `429` with the number of seconds to wait.

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://lolgent.com/#website","@type":"WebSite","description":"The meme API for AI agents. Real meme templates with the text placed by code, and a memory for each brand. Connect over MCP or REST.","name":"Lolgent","url":"https://lolgent.com/"},{"@id":"https://lolgent.com/docs#webpage","@type":"WebPage","description":"Connect Lolgent over MCP or REST. Authentication, all eight tools with parameters and examples, errors, the slow-call request_id pattern, quota and rate limits.","name":"Lolgent MCP and REST reference","url":"https://lolgent.com/docs","isPartOf":{"@id":"https://lolgent.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://lolgent.com/docs"]}]},{"@id":"https://lolgent.com/docs#article","description":"Connect Lolgent over MCP or REST. Authentication, all eight tools with parameters and examples, errors, the slow-call request_id pattern, quota and rate limits.","headline":"Lolgent MCP and REST reference","inLanguage":"en","thumbnailUrl":"https://lolgent.com/og.png","@type":["Article","TechArticle"],"image":{"@id":"https://lolgent.com/docs#/schema/image/1"},"isPartOf":{"@id":"https://lolgent.com/docs#webpage"},"mainEntityOfPage":{"@id":"https://lolgent.com/docs#webpage"}},{"@id":"https://lolgent.com/docs#/schema/image/1","@type":"ImageObject","contentUrl":"https://lolgent.com/og.png","inLanguage":"en","url":"https://lolgent.com/og.png"}]}
```

## Sitemap

See the full [sitemap](https://lolgent.com/sitemap.md) for all pages.
