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

# Generate Image

> Generate an image from HTML, URL, or template



## OpenAPI

````yaml post /image
openapi: 3.1.0
info:
  title: Pictify API
  version: 1.0.0
  description: |
    Generate images, GIFs, and PDFs from HTML templates programmatically.

    ## Authentication
    All API requests require a Bearer token in the Authorization header:
    ```
    Authorization: Bearer pk_live_your_api_key
    ```

    ## Rate Limits
    - Free: 60 requests/minute
    - Pro: 300 requests/minute
    - Business: 1,000 requests/minute

    Rate limit headers are included in all responses.
  contact:
    email: support@pictify.io
    url: https://pictify.io
  license:
    name: MIT
servers:
  - url: https://api.pictify.io
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Images
    description: Image generation endpoints
  - name: GIFs
    description: GIF generation and capture
  - name: PDFs
    description: PDF generation
  - name: Templates
    description: Template management
  - name: Batch
    description: Batch rendering operations
  - name: Experiments
    description: A/B testing, smart links, and scheduled variant experiments
  - name: Webhooks
    description: Webhook subscription management
  - name: Bindings
    description: Data binding for auto-rendering
paths:
  /image:
    post:
      tags:
        - Images
      summary: Generate an image
      description: Generate an image from HTML, URL, or template
      operationId: createImage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageRequest'
      responses:
        '200':
          description: Image generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ImageRequest:
      type: object
      properties:
        html:
          type: string
          description: HTML content to render
        url:
          type: string
          format: uri
          description: URL to screenshot (mutually exclusive with html)
        template:
          type: string
          description: Template UID to render
        variables:
          type: object
          additionalProperties: true
          description: Variables to populate in the template
        width:
          type: integer
          minimum: 1
          maximum: 4000
          default: 1200
          description: Output width in pixels
        height:
          type: integer
          minimum: 1
          maximum: 4000
          default: 630
          description: Output height in pixels
        selector:
          type: string
          description: CSS selector to capture specific element
        fileExtension:
          type: string
          enum:
            - png
            - jpg
            - jpeg
            - webp
          default: png
          description: Output image format
    ImageResponse:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: URL of the generated image
          example: https://cdn.pictify.io/renders/abc123.png
        userStorageUrl:
          type: string
          format: uri
          description: URL in user's configured storage (if configured)
        id:
          type: string
          description: Unique image identifier
          example: img_abc123
        createdAt:
          type: string
          format: date-time
          description: Timestamp when image was created
    Error:
      type: object
      required:
        - type
        - title
        - status
      properties:
        type:
          type: string
          format: uri
          description: Link to error documentation
          example: https://docs.pictify.io/errors/invalid-api-key
        title:
          type: string
          description: Short error title
          example: Invalid API Key
        status:
          type: integer
          description: HTTP status code
          example: 401
        detail:
          type: string
          description: Detailed error message
          example: The provided API key is invalid or has been revoked.
        instance:
          type: string
          description: Request path that caused the error
          example: /image
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key obtained from the Pictify dashboard

````