Skip to main content
Use this quickstart to create an API key, choose a language, and make your first request. After following this guide, you will be able to make a request to the Mixfont API and generate your first font.

Create an API key

Sign in to Mixfont, then create a key in the Developer Console. Send the key in the x-api-key header for every API request, or make sure to include it when using the respective client libraries.

Add credits

To get started with calling the API, you’ll need to add credits to your account. You can easily add credits in the Mixfont developer console. These credits will be attached to your API key and consumed when you make requests to the API.

Generate a font from an image

Use a publicly accessible image URL as a visual reference for the font style you’d like.
import { Mixfont } from "mixfont";

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

const generation = await mixfont.generations.create({
imageUrl: "https://static.mixfont.com/assets/20260603-210216-image-n06hmmov.webp",
});

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. In this case, the output TTF for this reference image looks like this:
InputOutput
Gossamer Editorial Serif input exampleGossamer-Editorial-Serif.ttf

Generate a font 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",
});

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

console.log(result.ttfUrl);

The create response returns a generation id and polling URL. Poll until status is succeeded, then download the generated TTF from the response. In this case, the output TTF for this prompt looks like this:

Request details

standard generations include 72 glyphs for English with basic letters, numbers, and punctuation. They take on average around 25 seconds. extended generations include 319 glyphs for all Latin languages, including special characters. They cost more credits and may take 2-3 minutes to complete.

Best Practices

Learn prompt, glyph set, polling, storage, and API key handling practices.