Documentation
Guides and API reference for uploads, image transforms and video.
npm install @cd2/fileboy-react API https://api.fileboy.io
Documentation menu
AI image data
Read the text in images and PDFs, write alt text and keyword tags, and check images for unsafe content. It's off until you turn it on, and OpenAI does the work.
402 ai_addon_required and automatic runs are skipped; anything already made stays. Cost in AI credits: ai image data (alt text, tags, text in images): 10 credits per million tokens sent, 50 per million written (about 0.03 credits an image); ai moderation: free (0 credits). See the AI add-on.What it does
Each part has its own switch, and each is off until you turn it on:
- Text (
aiImageText): the text in the image or PDF, transcribed in reading order (OCR). Signs, screenshots, receipts, scanned pages. - Alt text (
aiImageDescriptions): one or two plain sentences saying what the image shows, for people who can't see it. - Tags (
aiImageTags): 5 to 15 lower-case keywords (subjects, objects, setting, colours, style) for search. - Moderation (
aiImageModeration): a score from 0 to 1 for sexual, violent and self-harm content, and whether the image is flagged. - Quarantine (
aiQuarantineFlagged): what happens to an image moderation flags, below.
Text, alt text and tags come from one call to a vision model, whichever of them you turn on. They work for JPEG, PNG, WebP, BMP and TIFF images and for PDFs up to 10 MB. Moderation is for images only.
Turn it on
In the dashboard, open the app's Settings and use the AI image data card, or set the app settings from your server:
# read text, write alt text and tags, and moderate every image uploaded from now on
curl -X PATCH https://api.fileboy.io/app/settings \
-H "Authorization: token YOUR_SIGNED_TOKEN" \
-H "Content-Type: application/json" \
-d '{"aiImageText": true, "aiImageDescriptions": true, "aiImageTags": true, "aiImageModeration": true, "aiQuarantineFlagged": true}'From then on, every image and PDF uploaded to the app is analysed a few seconds after it arrives. Files uploaded before aren't sent: analyse one with the Analyse button on its Metadata tab, or with POST /files/:id/analyze. Turning a switch off stops it for files still waiting too.
Where your images go
Fileboy uses OpenAI as the processor for AI image data. While any switch is on:
- each new image is shrunk to fit 1536 px, turned the right way up and sent to OpenAI's API as a JPEG, once for the vision call and once for moderation; a PDF is sent as it is.
- requests ask OpenAI not to store the response. OpenAI's API terms say what it keeps and for how long.
- nothing is sent for apps with every switch off, for the shared demo app, or for the copies Fileboy makes of your files (resizes, renditions).
Read it
From your server, with the private key (or a scoped key with files:read). The dashboard shows the same on each file's Metadata tab, and the files search looks at the text, alt text and tags.
// needs the private key: the text read from an image can be personal data
const analysis = await fileboy.getFileAnalysis(file.id)
analysis.status // "done"
analysis.text // "OPEN\nMon-Fri 9-5"
analysis.description // "A green shop sign reading OPEN above a glass door."
analysis.tags // ["shop sign", "green", "door"]
analysis.moderation?.flagged // false
// correct the alt text; it is kept when the file is analysed again
await fileboy.updateFileAnalysis(file.id, { description: "Our shop on Market Street" })
// analyse a file uploaded before you turned it on
await fileboy.analyzeFile(file.id)analysis = fileboy.fetch_file_analysis(file.id)
analysis.status # => "done"
analysis.description # => "A green shop sign reading OPEN above a glass door."
analysis.tags # => ["shop sign", "green", "door"]
fileboy.update_file_analysis(file.id, description: "Our shop on Market Street")
fileboy.analyze_file(file.id)analysis = client.get_file_analysis(file.id)
analysis.status # "done"
analysis.description # "A green shop sign reading OPEN above a glass door."
analysis.tags # ["shop sign", "green", "door"]
client.update_file_analysis(file.id, description="Our shop on Market Street")
client.analyze_file(file.id)$analysis = $fileboy->getFileAnalysis($file->id);
echo $analysis->status; // done
echo $analysis->description; // A green shop sign reading OPEN above a glass door.
$fileboy->updateFileAnalysis($file->id, ['description' => 'Our shop on Market Street']);
$fileboy->analyzeFile($file->id);curl https://api.fileboy.io/files/FILE_ID/analysis \
-H "Authorization: token YOUR_SIGNED_TOKEN"
# correct the alt text and tags
curl -X PATCH https://api.fileboy.io/files/FILE_ID/analysis \
-H "Authorization: token YOUR_SIGNED_TOKEN" \
-H "Content-Type: application/json" \
-d '{"description": "Our shop on Market Street", "tags": ["shop", "market street"]}'
# analyse it (again) now
curl -X POST https://api.fileboy.io/files/FILE_ID/analyze \
-H "Authorization: token YOUR_SIGNED_TOKEN"1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24{ "data": { "fileId": "2a860257-ecf9-424a-846e-00ab68e2fd58", "status": "done", "message": null, "queuedAt": "2026-11-17T17:00:00Z", "analyzedAt": "2026-11-17T17:00:06Z", "text": "OPEN Mon-Fri 9-5", "description": "A green shop sign reading OPEN above a glass door.", "tags": ["shop sign", "green", "door", "storefront"], "edited": { "text": false, "description": false, "tags": false }, "moderation": { "flagged": false, "flaggedCategories": [], "categories": { "sexual": false, "violence": false, "violence/graphic": false, "self-harm": false, "self-harm/intent": false, "self-harm/instructions": false }, "scores": { "sexual": 0.0002, "violence": 0.0011, "violence/graphic": 0.0001, "self-harm": 0.0001, "self-harm/intent": 0, "self-harm/instructions": 0 }, "checkedAt": "2026-11-17T17:00:06Z" }, "quarantine": { "quarantined": false, "since": null, "releasedAt": null }, "models": { "vision": "gpt-6-luna", "moderation": "omni-moderation-latest" }, "usage": { "inputTokens": 912, "outputTokens": 58 } } }
status is none (never analysed), pending, processing, done, failed, skipped (too large, not readable, or the switches were turned off before it ran) or unsupported. message says why. A field you didn't turn on is null.
The alt text and tags are also on the file's public data, /files/data/:id, as altText and imageTags, which follow the file's read access. So a page can use them in an alt attribute. The text read from the image and the moderation result are only for your team and your private key: text in an image can be personal data.
Correct it
Edit the alt text, tags or text on the file's Metadata tab, or with PATCH /files/:id/analysis (in the examples above). What you write is kept when the file is analysed again, and edited says which fields are yours. You can write alt text this way with AI image data off, too: nothing is sent.
Moderation and quarantine
OpenAI's moderation model scores each image for sexual, violence, violence/graphic, self-harm, self-harm/intent and self-harm/instructions. When it flags one, Fileboy stores the categories and scores and sends a file.moderation_flagged webhook. No email or alert is sent.
With aiQuarantineFlagged on, a flagged image is also quarantined: every read of it and of its resized copies is refused (403 file_quarantined) until you act, whether the URL is public or signed, or comes from an expiring link, a share page, a zip or an overlay. Only your server, with the app's private key, can still read it, so the dashboard shows no preview of it either. Its read permission also becomes Signed URLs only. Nothing is deleted. Release it with the Release button on its page, or (with the private key, not a scoped key):
// a flagged image the app quarantined gets its read permission back
await fileboy.releaseFile(file.id)fileboy.release_file(file.id)client.release_file(file.id)$fileboy->releaseFile($file->id);curl -X POST https://api.fileboy.io/files/FILE_ID/moderation/release \
-H "Authorization: token YOUR_SIGNED_TOKEN"Releasing puts back the read permission it had, unless you changed it meanwhile. Moderation runs first, so an image is moderated even when reading its text or describing it fails. Browsers that already loaded a public image may keep their cached copy, and an upload is readable until its check has run (usually seconds after upload). GIF, AVIF, HEIC and SVG images, PDFs, video posters and images too large to read are not checked, so don't rely on moderation alone for them.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22{ "id": "0f4e2c1a-9b3d-4a57-8c61-2d7e9f0b1a23", "type": "file.moderation_flagged", "created": "2026-11-17T17:00:07Z", "appId": "APP_ID", "resource": { "id": "2a860257-ecf9-424a-846e-00ab68e2fd58", "name": "upload.jpg", "originalFilename": "upload.jpg", "mime": "image/jpeg", "fileSize": 482113, "metadata": {}, "createdAt": "2026-11-17T17:00:00Z", "moderation": { "flagged": true, "categories": ["violence"], "scores": { "violence": 0.91, "violence/graphic": 0.12, "sexual": 0.001 }, "quarantined": true, "model": "omni-moderation-latest" } } }
Limits and failures
- Each app starts up to 300 analyses an hour. The rest wait their turn, so a large batch of uploads takes a while.
- These limits are per app and count every start on all of Fileboy's servers together, retries included. They reset at the top of each UTC hour, and come from your plan, which can also set a monthly cap (none do today). Jobs over a limit stay
pendinguntil the next hour or month; documents and questions answer429 rate_limited. See each feature's use this hour and month in the app's Usage page (AI usage and limits) or withGET /usage/ai. - If OpenAI is busy or has an error, the file is tried again after 1, 5 and 30 minutes, then marked
failed. A request OpenAI refuses fails straight away, and so does a server whose OpenAI account is out of credit, whose key is refused or whose model is missing. Analyse it again to retry. - Images over 50 MB, or too large for the image service to open, and PDFs over 10 MB are
skipped. - Fileboy counts each app's calls and the tokens they use.