> ## Documentation Index
> Fetch the complete documentation index at: https://docs.airgraphic.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a meme generation

> Queues one researched meme generation. Memes cost 2 credits and return a job id after culture scouting, template matching, and creative selection.



## OpenAPI

````yaml /openapi.json post /api/meme
openapi: 3.1.0
info:
  title: AirGraphic API
  version: '2026-05-19'
  description: >-
    Generate on-brand infographics and audience-native memes from source
    context.
servers:
  - url: https://airgraphic.io
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
tags:
  - name: Generations
    description: Create and poll infographic jobs.
  - name: Brands
    description: Preview brand identity from a public website.
paths:
  /api/meme:
    post:
      tags:
        - Generations
      summary: Create a meme generation
      description: >-
        Queues one researched meme generation. Memes cost 2 credits and return a
        job id after culture scouting, template matching, and creative
        selection.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemeRequest'
            examples:
              url:
                summary: Generate a meme from a company URL
                value:
                  sourceUrl: https://example.com
                  audienceNote: B2B SaaS marketers who live in analytics dashboards
                  avoidNote: Do not make it a product ad
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MemeMultipartRequest'
      responses:
        '202':
          description: Meme generation queued.
          headers:
            x-ratelimit-limit:
              schema:
                type: integer
            x-ratelimit-remaining:
              schema:
                type: integer
            x-ratelimit-reset:
              schema:
                type: string
                format: date-time
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateQueued'
        '400':
          description: Invalid or unsupported source input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, revoked, or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Workspace has fewer than 2 credits remaining.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Plan rate limit reached.
          headers:
            x-ratelimit-limit:
              schema:
                type: integer
            x-ratelimit-remaining:
              schema:
                type: integer
            x-ratelimit-reset:
              schema:
                type: string
                format: date-time
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
        '502':
          description: >-
            A provider failed after the job was accepted; the 2 credits are
            refunded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    MemeRequest:
      type: object
      additionalProperties: false
      properties:
        sourceUrl:
          type: string
          format: uri
        sourceText:
          type: string
          maxLength: 8000
        sourceImage:
          type: string
          description: PNG, JPG, or WebP data URI used as the primary source.
        brandUrl:
          type: string
          format: uri
        brandProfileId:
          type: string
          format: uuid
        aspectRatio:
          type: string
          enum:
            - '9:16'
            - '1:1'
            - '4:5'
            - '16:9'
          default: '1:1'
        outputFormat:
          type: string
          enum:
            - png
            - jpeg
            - webp
          default: png
        audienceNote:
          type: string
          maxLength: 800
        avoidNote:
          type: string
          maxLength: 800
        styleNotes:
          type: string
          maxLength: 800
      oneOf:
        - required:
            - sourceUrl
        - required:
            - sourceText
        - required:
            - sourceImage
    MemeMultipartRequest:
      type: object
      properties:
        params:
          type: string
          description: >-
            JSON-encoded MemeRequest fields, excluding file-backed primary
            source fields.
        sourcePdf:
          type: string
          format: binary
          description: Optional PDF primary source, max 15 MB.
        sourcePptx:
          type: string
          format: binary
          description: Optional PPTX primary source, max 25 MB.
        sourceImage:
          type: string
          format: binary
          description: Optional image primary source, max 8 MB.
    GenerateQueued:
      type: object
      required:
        - jobId
        - status
        - stages
      properties:
        jobId:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - queued
        stages:
          type: array
          items:
            type: string
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        code:
          type: string
    RateLimitError:
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            bucket:
              type: string
            count:
              type: integer
            limit:
              type: integer
            resetAt:
              type: string
              format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: ag_ API key
      x-default: ag_your_api_key

````