> ## 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.

# Quickstart

> Generate your first font using the Mixfont API

export const FontPreview = ({fontFamily, children}) => <div className="font-preview-editor" contentEditable role="textbox" aria-label="Editable font preview" spellCheck={false} suppressContentEditableWarning style={{
  fontFamily: `"${fontFamily}", sans-serif`
}} tabIndex={0}>
    {children}
  </div>;

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](https://www.mixfont.com), then create a key in the [Developer Console](https://www.mixfont.com/console/keys). 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.

<CodeGroup>
  ```javascript JavaScript theme={null}
  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);

  ```

  ```python Python theme={null}
  import os
  from mixfont import Mixfont

  mixfont = Mixfont(api_key=os.environ["MIXFONT_API_KEY"])

  generation = mixfont.generations.create(
      image_url="https://static.mixfont.com/assets/20260603-210216-image-n06hmmov.webp",
  )

  result = mixfont.generations.wait(generation["id"])

  print(result["ttf_url"])
  ```

  ```bash cURL theme={null}
  curl https://api.mixfont.com/v1/font-generations/image \
    -H "Content-Type: application/json" \
    -H "x-api-key: $MIXFONT_API_KEY" \
    -d '{
      "image_url": "https://static.mixfont.com/assets/20260603-210216-image-n06hmmov.webp"
    }'
  ```
</CodeGroup>

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:

<table
  className="font-use-cases-table"
  style={{
width: "100%",
maxWidth: "100%",
tableLayout: "fixed",
borderCollapse: "collapse",
borderBottom: "0",
}}
>
  <colgroup>
    <col style={{ width: "25%" }} />

    <col style={{ width: "75%" }} />
  </colgroup>

  <thead>
    <tr style={{ borderBottom: "0" }}>
      <th
        style={{
      border: "0",
      color: "#111111",
      fontWeight: 700,
      paddingRight: "0.75rem",
      textAlign: "left",
      verticalAlign: "top",
    }}
      >
        <span className="font-table-heading">Input</span>
      </th>

      <th
        style={{
      border: "0",
      color: "#111111",
      fontWeight: 700,
      paddingLeft: "0.75rem",
      textAlign: "left",
      verticalAlign: "top",
    }}
      >
        <span className="font-table-heading">Output</span>
      </th>
    </tr>
  </thead>

  <tbody>
    <tr style={{ borderBottom: "0" }}>
      <td style={{ border: "0", paddingRight: "0.75rem", verticalAlign: "top" }}>
        <img
          src="https://static.mixfont.com/assets/20260603-210216-image-n06hmmov.webp"
          alt="Gossamer Editorial Serif input example"
          style={{
        display: "block",
        marginTop: "0",
        width: "100px",
        maxWidth: "100%",
        borderRadius: "4px",
      }}
        />
      </td>

      <td style={{ border: "0", paddingLeft: "0.75rem", verticalAlign: "top" }}>
        <FontPreview fontFamily="Gossamer Editorial Serif">
          The skills behind better performance
        </FontPreview>

        <a href="https://static.mixfont.com/assets/20260603-212006-font-001-gossamereditorialserif-regular-1-weyynop8.ttf" download="Gossamer-Editorial-Serif.ttf" className="font-download-button" style={{ verticalAlign: "top" }}>
          <Icon icon="download" size={16} color="#111111" />

          Gossamer-Editorial-Serif.ttf
        </a>
      </td>
    </tr>
  </tbody>
</table>

## Generate a font from a prompt

<CodeGroup>
  ```javascript JavaScript theme={null}
  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);

  ```

  ```python Python theme={null}
  import os
  from mixfont import Mixfont

  mixfont = Mixfont(api_key=os.environ["MIXFONT_API_KEY"])

  generation = mixfont.generations.create(
      prompt="a cute and bubbly font",
  )

  result = mixfont.generations.wait(generation["id"])

  print(result["ttf_url"])
  ```

  ```bash cURL theme={null}
  curl https://api.mixfont.com/v1/font-generations/text \
    -H "Content-Type: application/json" \
    -H "x-api-key: $MIXFONT_API_KEY" \
    -d '{
      "prompt": "a cute and bubbly font"
    }'
  ```
</CodeGroup>

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:

<FontPreview fontFamily="Iridescent Bubble Tone">
  A cute and bubbly font generated from a prompt on Mixfont!
</FontPreview>

## 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.

###

<Card title="Best Practices" icon="list-check" href="/docs/best-practices">
  Learn prompt, glyph set, polling, storage, and API key handling practices.
</Card>
