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

# Generate Font from Image

> Start a font generation from a public reference image URL

Start a font generation job from a public reference image URL. The response returns immediately with an `id` and `poll_url`.

Reference image URLs must use HTTPS, be publicly reachable, point to a JPEG, PNG, or WebP image, and be no larger than 20 MB.


## OpenAPI

````yaml api-reference/font-generation-openapi.json POST /v1/font-generations/image
openapi: 3.1.0
info:
  title: Mixfont Font Generation API
  description: Generate TTF font files from a text prompt or a public reference image.
  version: 1.0.0
servers:
  - url: https://api.mixfont.com
security: []
paths:
  /v1/font-generations/image:
    post:
      summary: Create an image font generation
      description: >-
        Start a new font generation job from a public reference image URL. The
        endpoint returns immediately with a generation id and polling URL.
      operationId: createImageFontGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageFontGenerationRequest'
            example:
              image_url: https://images.example.com/reference-wordmark.png
              glyph_set: standard
      responses:
        '201':
          description: Generation job accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateFontGenerationResponse'
              example:
                id: a4d94d83-4134-4d43-b801-e4077e4a2816
                name: Reference Sans
                ttf_url: null
                status: preparing
                input_type: image
                glyph_set: standard
                progress_percent: 0
                poll_url: >-
                  https://api.mixfont.com/v1/font-generations/a4d94d83-4134-4d43-b801-e4077e4a2816
                created_at: '2026-06-02T21:15:10.000Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientCredits'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ImageFontGenerationRequest:
      type: object
      required:
        - image_url
      properties:
        image_url:
          type: string
          format: uri
          maxLength: 2000
          description: >-
            Public HTTPS URL for a JPEG, PNG, or WebP reference image. The image
            must be publicly reachable and no larger than 20 MB.
        glyph_set:
          $ref: '#/components/schemas/GenerationGlyphSet'
    CreateFontGenerationResponse:
      type: object
      required:
        - id
        - name
        - ttf_url
        - status
        - input_type
        - glyph_set
        - progress_percent
        - poll_url
        - created_at
      properties:
        id:
          type: string
          description: Generation id.
        name:
          type: string
          description: Generated font display name.
        ttf_url:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            Download URL for the generated TTF file. This is `null` until the
            job succeeds.
        status:
          $ref: '#/components/schemas/GenerationStatus'
        input_type:
          $ref: '#/components/schemas/GenerationInputType'
        glyph_set:
          $ref: '#/components/schemas/GenerationGlyphSet'
        progress_percent:
          type: number
          minimum: 0
          maximum: 100
          description: Approximate job progress percentage.
        poll_url:
          type: string
          format: uri
          description: URL to poll for generation status.
        error:
          type: string
          description: >-
            Error message. Present only when `status` is `failed` and an error
            message is available.
        created_at:
          type: string
          format: date-time
          description: ISO timestamp for when the generation was created.
    GenerationGlyphSet:
      type: string
      enum:
        - standard
        - extended
      default: standard
      description: >-
        `standard` generates 72 glyphs to support English with basic letters,
        numbers, and punctuation. `extended` generates 319 glyphs to support all
        Latin languages, including special characters, costs more credits, and
        may take 2-3 minutes to complete.
    GenerationStatus:
      type: string
      enum:
        - preparing
        - queued
        - running
        - succeeded
        - cancelled
        - failed
    GenerationInputType:
      type: string
      enum:
        - text
        - image
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong.
  responses:
    BadRequest:
      description: Invalid request body or parameter
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: prompt is required.
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Unauthorized.
    InsufficientCredits:
      description: Not enough API credits remaining
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Current team does not have enough API credits remaining.
    Forbidden:
      description: The API key cannot resolve a valid team
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Team associated with this API key could not be resolved.
    InternalError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Failed to create font generation job.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````