API Documentation

Turn a handwriting image into a downloadable .ttf font with one request.

Getting started

Create an API key from your dashboard, then send it with every request in the X-API-Key header. Keys spend the same credit balance as the website: 1 credit per generated font.

X-API-Key: ft_your_api_key_here

Generate a font

POSThttps://fonttrace.com/api/generate-font

Send one image as multipart/form-data. Costs 1 credit per successful generation.

FieldTypeRequiredDescription
imagefileYesHandwriting or lettering sample
fontNamestringNoName for the generated font

Accepted image formats: PNG, JPEG, GIF, WebP, and SVG (converted server-side).

Request

curl -X POST https://fonttrace.com/api/generate-font \
  -H "X-API-Key: ft_your_api_key_here" \
  -F "image=@handwriting.jpg" \
  -F "fontName=My Custom Font"

Response

{
  "fileName": "My-Custom-Font-abc123.ttf",
  "downloadUrl": "/api/download/My-Custom-Font-abc123.ttf",
  "glyphCount": 62,
  "suggestedFontName": "Ink Sunday"
}

Generation time

The request is synchronous and holds the connection open until the font is built. Expect 30 to 60 seconds, and allow up to 2 minutes: a glyph sheet that fails validation is regenerated once before the request gives up, which roughly doubles the time.

Set your client timeout to at least 180 seconds. Many HTTP clients default to 30 seconds or less, which cuts off a normal generation partway through. If a request does time out on your side, the generation may still finish on ours and spend a credit, so treat a timeout as unknown rather than failed and check your balance before retrying.

For anything where a person is waiting, queue the call in the background and store the resulting .ttf rather than blocking on it.

Download the font file

Generated files stay available for 60 minutes, so fetch and store the file in your own storage.

curl "https://fonttrace.com/api/download/My-Custom-Font-abc123.ttf?download=1" \
  -H "X-API-Key: ft_your_api_key_here" \
  -o my-font.ttf

Credits

Your account has one credit balance, shared between the website and the API. Any credit pack you buy is immediately spendable through the API, and a font generated through the API draws down the same balance you see on your dashboard.

Every successful generation reports your balance in the response headers:

HeaderDescription
X-Credits-ChargedCredits deducted for this request
X-Credits-RemainingCredits left on the account afterwards

Rate limits

EndpointLimit
/api/generate-font8 requests per hour

Exceeding a limit returns 429. Need higher throughput? Get in touch and we'll raise it.

Errors

StatusMeaning
400Bad request — missing image or invalid input
401Missing or invalid API key
402Out of credits
429Rate limit exceeded — retry after a pause
500Server error — safe to retry
502Generation failed upstream — safe to retry

Privacy

Images you send and fonts you generate through the API stay private to your account. Nothing is published to the community library unless you explicitly share it.