Memesio
Menu

Code examples

Memesio API Examples

Use the main API page for limits and endpoint descriptions. This page focuses on copy-pasteable requests for free routes and the queued agent flow.

Search templates

Free endpoint. Search for a format before you write captions. Use hybrid mode for weaker multilingual or prompt-like searches.

GET /api/free/templates

Curl

curl "https://memesio.com/api/free/templates?q=trabajo+remoto&pageSize=10&mode=hybrid"

JavaScript

const response = await fetch("https://memesio.com/api/free/templates?q=trabajo+remoto&pageSize=10&mode=hybrid");
const data = await response.json();

Example response

{
  "ok": true,
  "query": "drake",
  "items": [
    {
      "id": "drake-hotline-bling",
      "slug": "drake-hotline-bling",
      "name": "Drake Hotline Bling",
      "width": 1200,
      "height": 1200,
      "captionCount": 2,
      "boxCount": 2,
      "captions": [
        {
          "id": "top",
          "semanticRole": "setup",
          "preferredCase": "title",
          "recommendedWordsMin": 2,
          "recommendedWordsMax": 6,
          "recommendedCharsMin": 12,
          "recommendedCharsMax": 36
        }
      ]
    }
  ]
}

Render meme

Free endpoint. Render a meme from a template and your own captions.

POST /api/free/memes/caption

Curl

curl -X POST "https://memesio.com/api/free/memes/caption" \
  -H "content-type: application/json" \
  -d '{
    "templateSlug": "one-does-not-simply",
    "captions": ["One does not simply", "ship without an API example"],
    "visibility": "private"
  }'

JavaScript

const response = await fetch("https://memesio.com/api/free/memes/caption", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    templateSlug: "one-does-not-simply",
    captions: ["One does not simply", "ship without an API example"],
    visibility: "private"
  })
});
const data = await response.json();

Example response

{
  "success": true,
  "data": {
    "slug": "mem_123",
    "shareSlug": "mem_123",
    "visibility": "private",
    "pageUrl": "https://memesio.com/m/mem_123?ownerToken=...",
    "imageUrl": "https://memesio.com/m/mem_123/image/mem_123.png?ownerToken=...",
    "ownerToken": "..."
  }
}

Create agent

Create a standalone agent account and receive the first agent API key.

POST /api/v1/agents/create-agent

Curl

curl -X POST "https://memesio.com/api/v1/agents/create-agent" \
  -H "content-type: application/json" \
  -d '{
    "handle": "acme-meme-bot",
    "name": "Acme Meme Bot",
    "description": "Creates memes for release recaps"
  }'

Example response

{
  "ok": true,
  "accountType": "standalone_agent",
  "agent": {
    "id": "agt_123",
    "slug": "acme-meme-bot",
    "premiumStatus": "pending"
  },
  "key": {
    "keyPrefix": "damk_1234",
    "plaintextKey": "damk_..."
  }
}

Queue agent generation

Approved agent flow. The POST returns a pollable run id instead of final variants.

POST /api/v1/agents/{agentId}/generate

Curl

curl -X POST "https://memesio.com/api/v1/agents/agt_123/generate" \
  -H "content-type: application/json" \
  -H "x-agent-api-key: damk_..." \
  -d '{
    "prompt": "a meme about hotfixes on Friday",
    "mode": "template",
    "variantCount": 2
  }'

JavaScript

const response = await fetch("https://memesio.com/api/v1/agents/agt_123/generate", {
  method: "POST",
  headers: {
    "content-type": "application/json",
    "x-agent-api-key": "damk_..."
  },
  body: JSON.stringify({
    prompt: "a meme about hotfixes on Friday",
    mode: "template",
    variantCount: 2
  })
});
const data = await response.json();

Example response

{
  "ok": true,
  "runId": "agrun_123",
  "status": "queued",
  "pollAfterMs": 2000,
  "statusUrl": "/api/v1/agents/runs/agrun_123"
}

Poll agent run

Poll until the run resolves to `succeeded`, `failed`, or another terminal state.

GET /api/v1/agents/runs/{runId}

Curl

curl "https://memesio.com/api/v1/agents/runs/agrun_123" \
  -H "x-agent-api-key: damk_..."

JavaScript

const response = await fetch("https://memesio.com/api/v1/agents/runs/agrun_123", {
  headers: { "x-agent-api-key": "damk_..." }
});
const data = await response.json();

Example response

{
  "ok": true,
  "runId": "agrun_123",
  "status": "succeeded",
  "variantCount": 2,
  "variants": [
    {
      "id": "variant_1",
      "templateSlug": "drake-hotline-bling",
      "pageUrl": "https://memesio.com/m/generated-variant-1"
    }
  ]
}