MemeStack Agent payments API

Pay-per-call routes for AI agents: x402 (USDC on Base) or L402 (Lightning). No account.

GitHub OpenAPI

Operations 3

POST /v1/agent/generate Generate an AI meme image (paid, agent rail) #
POST /v1/agent/reverse-search Reverse image search (paid, agent rail) #
POST /v1/agent/submit Submit an image to the moderation review queue (paid, agent rail) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/memestack-ai:memestack-ai-agent-payments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

memestack-ai-agent-payments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: MemeStack Agent payments API
  version: 1.0.0
  description: 'Visual search engine for memes, infographics, charts, and screenshots. Find images by meaning, the text inside them, or visual similarity. AI-captioned, OCR-indexed, Lightning-ranked. Two tiers: the Open API (/v1) needs no key — the read endpoints the website itself uses, rate-limited per IP address; the Search API (/v2, Tenor v2-compatible) takes an API key, free for 100 calls a day, then paid plans (card or Lightning): https://memestack.ai/developers.'
  contact:
    name: MemeStack
    url: https://memestack.ai
  termsOfService: https://memestack.ai/terms
servers:
- url: https://api.memestack.ai
tags:
- name: Agent payments
  description: 'Pay-per-call routes for AI agents: x402 (USDC on Base) or L402 (Lightning). No account.'
paths:
  /v1/agent/generate:
    post:
      tags:
      - Agent payments
      summary: Generate an AI meme image (paid, agent rail)
      x-payment-info:
        offers:
        - intent: charge
          method: lightning
          amount: null
          currency: sat
          description: '$0.08 standard or $0.20 quality, paid in sats over Lightning at the current BTC/USD rate, or in USDC on Base — the tier is chosen by the request body and the sats amount follows the rate, so the amount is request-dependent. The 402 challenge is dual-rail, not the MPP Payment scheme: WWW-Authenticate: L402 (pay the bolt11 invoice, retry with Authorization: L402 <macaroon>:<preimage>) plus an x402 v2 offer in the body and PAYMENT-REQUIRED header (USDC on Base, amount set per request from the BTC/USD rate).'
      description: 'Generate an image from a text prompt via Grok Imagine. PAID endpoint (agent payment rails — no account needed; the payment is the auth). Attach proof via PAYMENT-SIGNATURE or X-PAYMENT header (base64 JSON x402 payload, USDC on Base) or Authorization: L402 : (Lightning sats). Without proof the response is 402 with a dual-rail offer. Rate limited 30/min/IP. Returns 404 while payments are disabled. Prices: $0.08 standard / $0.20 quality (paid in sats over Lightning at the current BTC/USD rate, or in USDC on Base). Long-polls up to ~90s; on 202, retry with the SAME payment proof to resume — one payment delivers at most one image.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - prompt
              properties:
                prompt:
                  type: string
                  maxLength: 2000
                mode:
                  type: string
                  enum:
                  - standard
                  - quality
                  default: standard
                aspect_ratio:
                  type: string
                  enum:
                  - '1:1'
                  - '3:4'
                  - '16:9'
                  default: '1:1'
      responses:
        '200':
          headers:
            PAYMENT-RESPONSE:
              description: 'x402 settlement receipt, sent when the payment settled on-chain (also on the claim-open 202/502 answers that follow a settled payment): base64(JSON {success: true, transaction, network, payer}) — the x402 v2 SettlementResponse. Absent for L402 (the preimage is the receipt).'
              schema:
                type: string
          description: Image generated and delivered.
          content:
            application/json:
              schema:
                type: object
                properties:
                  image_id:
                    type: string
                    format: uuid
                  url:
                    type: string
                  image_url:
                    type: string
                  thumbnail_url:
                    type: string
                  caption:
                    type: string
                  tags:
                    type: array
                    items:
                      type: object
        '202':
          headers:
            PAYMENT-RESPONSE:
              description: 'x402 settlement receipt, sent when the payment settled on-chain (also on the claim-open 202/502 answers that follow a settled payment): base64(JSON {success: true, transaction, network, payer}) — the x402 v2 SettlementResponse. Absent for L402 (the preimage is the receipt).'
              schema:
                type: string
          description: Still generating at the poll budget — claim stays open; retry with the SAME payment proof to collect.
        '400':
          description: Invalid body or malformed payment header (INVALID_PAYMENT_HEADER).
        '402':
          description: Payment required. Body is the x402 v2 PaymentRequired envelope; the same envelope is base64-encoded in the PAYMENT-REQUIRED header, and WWW-Authenticate carries the L402 challenge (macaroon + bolt11 invoice). Pay on either rail and retry with proof.
          headers:
            PAYMENT-REQUIRED:
              schema:
                type: string
              description: base64(JSON) x402 v2 PaymentRequired envelope.
            WWW-Authenticate:
              schema:
                type: string
              description: 'L402 macaroon="...", invoice="<bolt11>" — pay the invoice, retry with Authorization: L402 <macaroon>:<preimage>.'
        '410':
          description: The generated image was removed; payment recorded for reconciliation (terminal).
        '422':
          description: Rejected by content moderation (nsfw/gore/spam) — payment retained per policy (POLICY_REJECTED).
        '429':
          description: Rate limit exceeded (30/min/IP).
        '502':
          description: Generation failed before output (GENERATION_FAILED) — claim stays open, retry with the same proof (prompt change allowed).
        '503':
          description: Payment rails temporarily unavailable (PAYMENT_UNAVAILABLE).
      operationId: postV1AgentGenerate
      x-operation-id-source: derived
  /v1/agent/reverse-search:
    post:
      tags:
      - Agent payments
      summary: Reverse image search (paid, agent rail)
      x-payment-info:
        offers:
        - intent: charge
          method: lightning
          amount: null
          currency: sat
          description: '$0.02 per call, paid in sats over Lightning at the current BTC/USD rate, or in USDC on Base (the sats amount follows the rate, so it is request-dependent). The 402 challenge is dual-rail, not the MPP Payment scheme: WWW-Authenticate: L402 (pay the bolt11 invoice, retry with Authorization: L402 <macaroon>:<preimage>) plus an x402 v2 offer in the body and PAYMENT-REQUIRED header (USDC on Base, amount set per request from the BTC/USD rate).'
      description: 'Phash-based reverse image search over the approved catalog. PAID endpoint (agent payment rails — no account needed; the payment is the auth). Attach proof via PAYMENT-SIGNATURE or X-PAYMENT header (base64 JSON x402 payload, USDC on Base) or Authorization: L402 : (Lightning sats). Without proof the response is 402 with a dual-rail offer. Rate limited 30/min/IP. Returns 404 while payments are disabled. Price: $0.02 per call (paid in sats over Lightning at the current BTC/USD rate, or in USDC on Base). Same SSRF hardening and input rules as /v1/images/reverse-search.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - image_url
              properties:
                image_url:
                  type: string
                  description: HTTPS URL or data:image/...;base64,... URL of the query image.
                content:
                  type: string
                  enum:
                  - safe
                  - all
                  default: safe
                  description: 'Safe by default: ''safe'' (the default) excludes matches classified controversial; ''all'' includes them, each carrying controversial: true. Case-insensitive; any other value is 400 INVALID_CONTENT, answered before any payment is read.'
      responses:
        '200':
          headers:
            PAYMENT-RESPONSE:
              description: 'x402 settlement receipt, sent when the payment settled on-chain (also on the claim-open 202/502 answers that follow a settled payment): base64(JSON {success: true, transaction, network, payer}) — the x402 v2 SettlementResponse. Absent for L402 (the preimage is the receipt).'
              schema:
                type: string
          description: Visually similar approved images (nearest first) + input metadata.
        '400':
          description: Invalid URL/body or malformed payment header.
        '402':
          description: Payment required. Body is the x402 v2 PaymentRequired envelope; the same envelope is base64-encoded in the PAYMENT-REQUIRED header, and WWW-Authenticate carries the L402 challenge (macaroon + bolt11 invoice). Pay on either rail and retry with proof.
          headers:
            PAYMENT-REQUIRED:
              schema:
                type: string
              description: base64(JSON) x402 v2 PaymentRequired envelope.
            WWW-Authenticate:
              schema:
                type: string
              description: 'L402 macaroon="...", invoice="<bolt11>" — pay the invoice, retry with Authorization: L402 <macaroon>:<preimage>.'
        '429':
          description: Rate limit exceeded (30/min/IP).
        '503':
          description: Payment rails temporarily unavailable.
      operationId: postV1AgentReverseSearch
      x-operation-id-source: derived
  /v1/agent/submit:
    post:
      tags:
      - Agent payments
      summary: Submit an image to the moderation review queue (paid, agent rail)
      x-payment-info:
        offers:
        - intent: charge
          method: lightning
          amount: null
          currency: sat
          description: '$0.10 per submission (paid in sats over Lightning at the current BTC/USD rate, or in USDC on Base; the sats amount follows the rate, so it is request-dependent), retained even when moderation rejects it. The 402 challenge is dual-rail, not the MPP Payment scheme: WWW-Authenticate: L402 (pay the bolt11 invoice, retry with Authorization: L402 <macaroon>:<preimage>) plus an x402 v2 offer in the body and PAYMENT-REQUIRED header (USDC on Base, amount set per request from the BTC/USD rate).'
      description: 'Submit an image by URL into the standard moderation pipeline (forceReview: true) — the payment IS the sybil-resistance mechanism, no account needed. Attach proof via PAYMENT-SIGNATURE or X-PAYMENT header (base64 JSON x402 payload, USDC on Base) or Authorization: L402 : (Lightning sats). Without proof the response is 402 with a dual-rail offer, unless the 50/day/IP submission-offer cap is reached first (429). Rate limited 30/min/IP. Returns 404 while payments or agent submissions are disabled. Price: $0.10 per submission (paid in sats over Lightning at the current BTC/USD rate, or in USDC on Base). NO REFUND if moderation rejects the submission (duplicate/nsfw/gore/spam/low_quality/invalid image) — the fee is retained as the anti-spam mechanism; only a failure before any submission row exists (bad URL, fetch error, oversize, non-image bytes) keeps the claim open for a corrected retry. Accepted images land in needs_review pending human approval, and join the public gallery under the MCP Agents account if approved. Long-polls up to ~90s; on 202, retry with the SAME payment proof to resume — up to 10 delivery attempts per payment, never charged twice.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - image_url
              properties:
                image_url:
                  type: string
                  description: HTTPS URL or data:image/(jpeg|png|webp);base64,... URL. Max 8MB.
                caption:
                  type: string
                  maxLength: 200
                  description: Optional caption hint for the AI tagger. Admin-visible only, never published verbatim.
                tags:
                  type: array
                  items:
                    type: string
                    maxLength: 40
                  maxItems: 10
                  description: Optional tag hints. Admin-visible only, never published verbatim.
                attribution:
                  type: string
                  maxLength: 200
                  description: Optional credit line for the original creator/source. Shown to moderators only, never published.
      responses:
        '200':
          headers:
            PAYMENT-RESPONSE:
              description: 'x402 settlement receipt, sent when the payment settled on-chain (also on the claim-open 202/502 answers that follow a settled payment): base64(JSON {success: true, transaction, network, payer}) — the x402 v2 SettlementResponse. Absent for L402 (the preimage is the receipt).'
              schema:
                type: string
          description: Submission accepted — pending human review.
          content:
            application/json:
              schema:
                type: object
                properties:
                  image_id:
                    type: string
                    format: uuid
                  status:
                    type: string
                    enum:
                    - pending_review
                  message:
                    type: string
                  page_url:
                    type: string
        '202':
          headers:
            PAYMENT-RESPONSE:
              description: 'x402 settlement receipt, sent when the payment settled on-chain (also on the claim-open 202/502 answers that follow a settled payment): base64(JSON {success: true, transaction, network, payer}) — the x402 v2 SettlementResponse. Absent for L402 (the preimage is the receipt).'
              schema:
                type: string
          description: Still processing at the poll budget — claim stays open; retry with the SAME payment proof to resume.
        '400':
          description: Invalid body (INVALID_ARGS), malformed payment header (INVALID_PAYMENT_HEADER), or an image fetch/validation failure (FETCH_FAILED / NOT_AN_IMAGE / ANIMATED_IMAGE / SSRF_BLOCKED) — all keep the claim open, retry with a corrected image_url and the SAME payment proof.
        '402':
          description: Payment required. Body is the x402 v2 PaymentRequired envelope; the same envelope is base64-encoded in the PAYMENT-REQUIRED header, and WWW-Authenticate carries the L402 challenge (macaroon + bolt11 invoice). Pay on either rail and retry with proof. Also returned when the 10-attempt delivery budget is exhausted (ATTEMPTS_EXHAUSTED) — a new payment is then required.
          headers:
            PAYMENT-REQUIRED:
              schema:
                type: string
              description: base64(JSON) x402 v2 PaymentRequired envelope.
            WWW-Authenticate:
              schema:
                type: string
              description: 'L402 macaroon="...", invoice="<bolt11>" — pay the invoice, retry with Authorization: L402 <macaroon>:<preimage>.'
        '410':
          description: The submitted image was removed; payment recorded for reconciliation (terminal).
        '413':
          description: Fetched image exceeds the 8MB cap (TOO_LARGE) — claim stays open, retry with a smaller image.
        '422':
          description: 'Rejected by moderation (SUBMISSION_REJECTED: duplicate/nsfw/gore/spam/low_quality/invalid_image) — payment retained per policy. duplicate_of (image_id + page_url) is included when the match is an approved, publicly viewable image.'
        '429':
          description: Daily submission-offer cap reached (SUBMIT_CAP_REACHED, 50/day/IP) or rate limit exceeded (30/min/IP).
        '502':
          description: Could not enqueue the submission job (ENQUEUE_FAILED) — claim stays open, retry with the same proof.
        '503':
          description: Payment rails temporarily unavailable (PAYMENT_UNAVAILABLE).
      operationId: postV1AgentSubmit
      x-operation-id-source: derived
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT issued by /auth/callback (LNURL) or /auth/email/verify. Also accepted as the httpOnly cookie __Secure-bii-token for same-origin browser requests.
    ApiKeyQuery:
      type: apiKey
      in: query
      name: key
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
externalDocs:
  description: Full API documentation and developer guide
  url: https://memestack.ai/developers
x-service-info:
  categories:
  - media
  - search
  docs:
    homepage: https://memestack.ai/developers
    apiReference: https://memestack.ai/llms-full.txt
    llms: https://memestack.ai/llms.txt