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.
| Field | Type | Required | Description |
|---|---|---|---|
image | file | Yes | Handwriting or lettering sample |
fontName | string | No | Name 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.
- 1 credit = 1 font generation
- Credits never expire
- Failed generations aren't charged
- Buy more any time from your dashboard
Every successful generation reports your balance in the response headers:
| Header | Description |
|---|---|
X-Credits-Charged | Credits deducted for this request |
X-Credits-Remaining | Credits left on the account afterwards |
Rate limits
| Endpoint | Limit |
|---|---|
/api/generate-font | 8 requests per hour |
Exceeding a limit returns 429. Need higher throughput? Get in touch and we'll raise it.
Errors
| Status | Meaning |
|---|---|
400 | Bad request — missing image or invalid input |
401 | Missing or invalid API key |
402 | Out of credits |
429 | Rate limit exceeded — retry after a pause |
500 | Server error — safe to retry |
502 | Generation 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.