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

# Render a deterministic avatar

> Render an identicon, gradient, or initials avatar as SVG, JPEG, PNG, or WebP.



## OpenAPI

````yaml /openapi.yaml get /v1/avatars/{style}/{seed}.{format}
openapi: 3.1.0
info:
  title: Pictum API
  version: 1.0.0
  description: Render public assets
  license:
    name: MIT
    identifier: MIT
servers:
  - url: https://pictum.dev
    description: Production API
security: []
tags:
  - name: Icons
    description: Browse and render the icon catalog.
  - name: Avatars
    description: Render generated avatars or select seeded realistic portraits.
  - name: QR codes
    description: Render Base64-encoded text as deterministic QR code images.
  - name: Placeholders
    description: Render exact-size placeholder images with optional text and colors.
paths:
  /v1/avatars/{style}/{seed}.{format}:
    get:
      tags:
        - Avatars
      summary: Render a deterministic avatar
      description: >-
        Render an identicon, gradient, or initials avatar as SVG, JPEG, PNG, or
        WebP.
      operationId: renderAvatar
      parameters:
        - name: style
          in: path
          required: true
          description: Avatar rendering style.
          schema:
            type: string
            enum:
              - identicon
              - gradient
              - initials
          example: gradient
        - name: seed
          in: path
          required: true
          description: >-
            URL-safe deterministic seed containing at least one letter or
            number.
          schema:
            type: string
            minLength: 1
            maxLength: 128
            pattern: ^[A-Za-z0-9](?:[A-Za-z0-9._~@+-]{0,126}[A-Za-z0-9])?$
          example: ada-lovelace
        - name: format
          in: path
          required: true
          description: Output image file extension.
          schema:
            type: string
            enum:
              - svg
              - jpg
              - png
              - webp
          example: webp
        - name: size
          in: query
          required: false
          description: >-
            Square raster size in pixels. Defaults to 256 for JPEG, PNG, and
            WebP and is ignored for SVG.
          schema:
            type: integer
            minimum: 16
            maximum: 2048
          example: 512
      responses:
        '200':
          description: Deterministic avatar image.
          headers:
            ETag:
              $ref: '#/components/headers/ETag'
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            image/svg+xml:
              schema:
                type: string
            image/jpeg:
              schema:
                type: string
                format: binary
            image/webp:
              schema:
                type: string
                format: binary
            image/png:
              schema:
                type: string
                format: binary
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: Invalid raster size.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: >-
                  Raster avatar size must be an integer between 16 and 2048
                  pixels.
components:
  headers:
    ETag:
      description: Identifier for conditional requests.
      schema:
        type: string
    CacheControl:
      description: Public browser and shared-cache directives.
      schema:
        type: string
        example: public, max-age=86400, s-maxage=604800, stale-while-revalidate=86400
  responses:
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string

````