Skip to main content
Generate TTF font files from a text prompt or a public reference image. Font generation is asynchronous: create a generation, then poll until the job reaches succeeded, failed, or cancelled. The font generation API is available through HTTP or Mixfont’s language specific SDKs. View the packages on npm and PyPI.

Install a client

npm install mixfont

Generate from an image

Reference image URLs must use HTTPS, be publicly reachable, point to a JPEG, PNG, or WebP image, and be no larger than 20 MB.
import { Mixfont } from "mixfont";

const mixfont = new Mixfont({
apiKey: process.env.MIXFONT_API_KEY,
});

const generation = await mixfont.generations.create({
imageUrl: "https://images.example.com/reference-wordmark.png",
glyphSet: "standard",
});

const result = await mixfont.generations.wait(generation.id);

console.log(result.ttfUrl);

Image generation returns a generation id and polling URL. Poll until status is succeeded, then download the generated TTF from the response. A generated font from this reference image can look like this:
InputOutput
Gossamer Editorial Serif input exampleGossamer-Editorial-Serif.ttf

Generate from a prompt

import { Mixfont } from "mixfont";

const mixfont = new Mixfont({
apiKey: process.env.MIXFONT_API_KEY,
});

const generation = await mixfont.generations.create({
prompt: "a cute and bubbly font",
glyphSet: "standard",
});

const result = await mixfont.generations.wait(generation.id);

console.log(result.ttfUrl);

Prompt generation returns a generation id and polling URL. Poll until status is succeeded, then download the generated TTF from the response. A generated font from this prompt can look like this:
InputOutput
a cute and bubbly font
Iridescent-Bubble-Tone.ttf

Request structure

The REST API uses snake case. The JavaScript client maps request fields to camel case. The Python client uses snake case.
REST fieldJavaScriptPythonUsed byDescription
image_urlimageUrlimage_urlImage generationPublic HTTPS URL for a JPEG, PNG, or WebP reference image up to 20 MB.
promptpromptpromptText generationText prompt describing the font to generate.
glyph_setglyphSetglyph_setBothOptional glyph set. standard generates 72 glyphs for English with basic letters, numbers, and punctuation. extended generates 319 glyphs for all Latin languages, including special characters. Defaults to standard.
standard costs 20 API credits and takes on average around 25 seconds. extended costs 50 API credits and may take 2-3 minutes to complete.

Response structure

Create endpoints return 201 Created with the generation object and a polling URL.
{
  "id": "7d58a66d-f129-4f9a-bf9a-4f2c6d0c3e4d",
  "name": "Nebula Sans",
  "ttf_url": null,
  "status": "preparing",
  "input_type": "text",
  "glyph_set": "standard",
  "progress_percent": 0,
  "poll_url": "https://api.mixfont.com/v1/font-generations/7d58a66d-f129-4f9a-bf9a-4f2c6d0c3e4d",
  "created_at": "2026-06-02T21:12:42.000Z"
}
Polling returns the generation object without poll_url. When the job succeeds, ttf_url contains the generated TTF download URL.
{
  "id": "7d58a66d-f129-4f9a-bf9a-4f2c6d0c3e4d",
  "name": "Nebula Sans",
  "ttf_url": "https://static.mixfont.com/uploads/generated/7d58a66d-f129-4f9a-bf9a-4f2c6d0c3e4d/font.ttf",
  "status": "succeeded",
  "input_type": "text",
  "glyph_set": "standard",
  "progress_percent": 100,
  "created_at": "2026-06-02T21:12:42.000Z"
}
The JavaScript client returns camel-case response properties. The Python client returns the raw API response dictionary with snake-case keys.
REST and Python fieldJavaScript field
input_typeinputType
glyph_setglyphSet
progress_percentprogressPercent
ttf_urlttfUrl
created_atcreatedAt
poll_urlpollUrl
Generated TTF URLs are temporary and will be deleted after 24 hours. Download each generated TTF file and save it separately if you need to preserve it.

Generate from Image

Review the image generation endpoint.

Generate from Prompt

Review the prompt generation endpoint.

Generation Status

Review the polling endpoint.