The File Crocodile API
Everything the croc does in the pond (extract, chunk, find and redact PII, chat, share) from your own code. Calls spend your account's credits, just like the pond.
- Make a key on My pond. You'll see it once, so keep it somewhere safe (and out of browser code).
- Send it with every request as
Authorization: Bearer <key>. - Base URL:
https://file-croc.com/api/v1
Your first call
export CROC_KEY=fc_…
curl "https://file-croc.com/api/v1/documents/extract?for_ai=true" \
-H "Authorization: Bearer $CROC_KEY" \
-F "files=@report.pdf"Credits & errors
Each endpoint lists its cost. The croc holds enough credits before it starts and charges
what the work actually took, reported in the X-Units-Charged and X-Premium-Units-Charged response headers. Failed files cost nothing. Premium credits pay for the language model (Chat,
Summarise, Enrich) and come with every plan and pack.
Errors come back as JSON with a detail message.
| 401 | Missing or unknown API key (code invalid_api_key). |
| 402 | Not enough credits or premium credits (code payment_required). |
| 404 | No such endpoint, or a document you do not own. |
| 413 | Too big: over 20 MB a document (100 MB a recording), 10 files, or too much text to chat about. |
| 415 | The croc cannot chew this file type. |
| 422 | A parameter is missing or invalid (e.g. enrich without chunks). |
| 429 | Too many requests. Slow down and try again. |
| 503 | The service is busy or starting up. Try again shortly. |
| 504 | It took too long (a GPU may be waking up). Try again in a minute. |
402 response
{
"detail": "The croc needs premium credits for this",
"code": "payment_required",
"currency": "premium",
"needed": 1,
"available": 0
}Check your credits
Your plan and what you have left to spend, in credits and premium credits.
Cost Free
Request
curl https://file-croc.com/api/v1/account \
-H "Authorization: Bearer $CROC_KEY"Response (200)
{
"email": "you@example.com",
"isAnonymous": false,
"plan": { "key": "free", "name": "Free" },
"allowance": 20,
"monthlyUsed": 3,
"purchased": 0,
"available": 17,
"periodEnd": "2026-11-01T00:00:00.000Z",
"cancelAtPeriodEnd": false,
"premium": { "allowance": 0, "monthlyUsed": 0, "purchased": 0, "available": 0 },
"entitlements": { "tier": "free", "devices": 2, "ponds": { "max": 1, "maxDocuments": 100, "cloud": false }, "…": "…" }
}Extract text
Turns documents into clean text or Markdown, optionally split into chunks for AI. Add summarise or enrich to have our private language model summarise each document or give each chunk its context.
Cost 1 credit per file, plus 1 per extra 5 MB (a recording is 1 whatever its size). A PDF over 50 pages adds 1 premium credit, a recording 1 per 10 minutes; summarise and enrich add 1 premium credit per file each.
filesform field · file, repeatable- Up to 10 documents (PDF, DOCX, PPTX, images, MD, TXT, CSV), 20 MB each. PDFs may have up to 200 pages. Audio and video (up to 100 MB and 30 minutes) come back as a transcript with a timestamp on each line.
for_aiquery · boolean = false- Return Markdown instead of plain text.
chunksquery · boolean = true- Return content as a list of chunks; false returns one string.
summarisequery · boolean = false- Add a summary of each document.
summary_lengthquery · short | medium | long- How long the summary is. Default medium.
enrichquery · boolean = false- Add a context to each chunk saying where it sits in the document (needs chunks).
windowquery · integer 1–4 = 2- Neighbouring chunks on each side the model reads when enriching.
count_tokensquery · boolean = false- Add each document's token count (handy before chatting).
Request
curl "https://file-croc.com/api/v1/documents/extract?for_ai=true&chunks=true&summarise=true" \
-H "Authorization: Bearer $CROC_KEY" \
-F "files=@contract.pdf"Response (200)
{
"results": [
{
"filename": "contract.pdf",
"success": true,
"content": [
"# Services Agreement\n\nThis agreement is made between…",
"## 2. Term\n\nThe term begins on 1 July 2026 and…"
],
"summary": "A 12-month services agreement between Acme Ltd and…",
"error": null,
"file_size": 183402,
"processing_time": 2.41,
"page_count": 6,
"sha256": "9f2c…e1"
}
],
"summary": {
"total_files": 1,
"successful": 1,
"failed": 0,
"total_processing_time": 2.41
}
}Find PII
Finds names, emails, phone numbers, IDs and other personal data, with where each one sits in the extracted text.
Cost 1 credit per file. A PDF over 50 pages (up to 200) adds 1 premium credit; a recording adds 1 premium credit per 10 minutes.
filesform field · file, repeatable- Up to 10 documents (PDF, DOCX, PPTX, TXT, MD…), 20 MB each, or recordings (MP3, WAV, M4A, MP4, MOV, WEBM…) up to 100 MB and 30 minutes.
category_groupquery · string- common_pii, personal_identifiers, financial, government_ids or online_identifiers. Omit for every category.
categories_filterquery · string, repeatable- Specific categories instead of a group, e.g. Person, Email, PhoneNumber.
include_wordsquery · string, repeatable- Extra words or phrases to catch (whole word, any case), reported as CustomWord.
facesquery · boolean = false- Pictures: also find faces, listed in each result’s faces with a confidence and a box (fractions of the picture).
Request
curl "https://file-croc.com/api/v1/pii/extract?category_group=common_pii" \
-H "Authorization: Bearer $CROC_KEY" \
-F "files=@letter.docx"Response (200)
{
"results": [
{
"filename": "letter.docx",
"success": true,
"entities": [
{
"text": "Jane Doe",
"category": "Person",
"subcategory": null,
"confidence_score": 0.97,
"offset": 5,
"length": 8
},
{
"text": "jane@example.com",
"category": "Email",
"subcategory": null,
"confidence_score": 1.0,
"offset": 112,
"length": 16
}
],
"error": null,
"processing_time": 1.08
}
],
"summary": {
"total_files": 1,
"successful": 1,
"failed": 0,
"total_entities": 2,
"total_processing_time": 1.08
}
}Redact PII
Blacks out personal data and hands back each document in its own format (PDF, DOCX, PPTX, or a PNG, JPEG, TIFF, BMP or WEBP picture with its location and camera details removed), base64-encoded in redacted_content. In audio and video the spoken personal data is bleeped or muted (video frames are left as they are) and transcript_vtt holds captions with it blacked out.
Cost 1 credit per file. A PDF over 50 pages (up to 200) adds 1 premium credit; a recording adds 1 premium credit per 10 minutes.
filesform field · file, repeatable- Up to 10 documents (PDF, DOCX, PPTX, TXT, MD…), 20 MB each, or recordings (MP3, WAV, M4A, MP4, MOV, WEBM…) up to 100 MB and 30 minutes.
category_groupquery · string- common_pii, personal_identifiers, financial, government_ids or online_identifiers. Omit for every category.
categories_filterquery · string, repeatable- Specific categories instead of a group, e.g. Person, Email, PhoneNumber.
include_wordsquery · string, repeatable- Extra words or phrases to catch (whole word, any case), reported as CustomWord.
exclude_wordsquery · string, repeatable- Leave detected PII containing these words visible (e.g. your own company).
audioquery · string = bleep- Audio and video: bleep (a tone over the redacted speech) or mute.
facesquery · boolean = false- Pictures: also cover faces. They are found automatically, so tiny, turned-away or covered faces can be missed.
image_stylequery · string = solid- Pictures: cover faces with a solid block, or pixelate them. Writing is always covered solid.
Request
curl "https://file-croc.com/api/v1/pii/redact?category_group=common_pii&exclude_words=Acme" \
-H "Authorization: Bearer $CROC_KEY" \
-F "files=@letter.pdf" \
| jq -r '.results[0].redacted_content' | base64 -d > letter-redacted.pdfResponse (200)
{
"results": [
{
"filename": "letter.pdf",
"success": true,
"redacted_content": "JVBERi0xLjcKJeLjz9MK…",
"original_format": "pdf",
"redactions_count": 4,
"error": null,
"processing_time": 1.62
}
],
"summary": {
"total_files": 1,
"successful": 1,
"failed": 0,
"total_redactions": 4,
"total_processing_time": 1.62
}
}Chat about documents
Open a conversation about extracted text. The first event returns conversation memory and a continuation receipt; answer text follows as server-sent events. Nothing is stored on the server. For follow-ups, POST to /chat/continue with the same documents, the receipt, the returned memory and only the messages not yet represented by that memory.
Cost 1 premium credit per 16k tokens of documents to start (at least 1). Follow-ups and conversation compaction are free.
documentsJSON body · { filename, text }[]- Up to 20 documents, up to 48k tokens altogether.
messagesJSON body · { role, content }[]- Unsummarised conversation turns (up to 120); role is user or assistant, and the last must be user. When the context event reports compacted_messages, remove that many messages from subsequent requests while keeping your full local transcript.
conversation_summaryJSON body · string- Optional memory returned by the previous context event; send it with every follow-up.
continuation_tokenJSON body · string- Required at /chat/continue. The returned paid receipt is valid only for this user and this exact document set (filename and text). Starting a new chat or changing the selected files incurs a new opening charge.
modelJSON body · string- Optional: the id of a model you trained and host with File Croc (hosted_until in GET /models). It answers instead of File Croc’s own model, reading the documents as passages, up to 11k tokens altogether. If it has not been used for a while, the first answer can take a minute or two while it wakes. A receipt is valid only for the model it was paid with.
Request
curl -N https://file-croc.com/api/v1/chat \
-H "Authorization: Bearer $CROC_KEY" \
-H "Content-Type: application/json" \
-d '{
"documents": [{ "filename": "contract.pdf", "text": "# Services Agreement…" }],
"messages": [{ "role": "user", "content": "When does the contract end?" }]
}'Response (text/event-stream)
data: {"context": {"conversation_summary": "", "compacted_messages": 0, "continuation_token": "<paid receipt>"}}
data: {"delta": "The agreement ends on"}
data: {"delta": " 30 June 2027."}
data: {"done": true, "finish_reason": "stop", "usage": {"prompt_tokens": 2310, "completion_tokens": 11}}Redact a video (background job)
Covers faces on every frame and bleeps or mutes spoken personal data, for videos up to 500 MB and 60 minutes. Create the job, upload the file in part_size pieces to /jobs/{id}/parts/{n} (raw bytes), start it with POST /jobs/{id}/start, then poll GET /jobs/{id} until status is done and fetch result_parts pieces from /jobs/{id}/result/{n} (and /jobs/{id}/captions). Results are kept for 24 hours; POST /jobs/{id}/cancel stops a job. Faces are found automatically and can be missed; on-screen text is not covered.
Cost Charged when started: 1 credit plus 1 premium credit per 5 minutes. A job that fails, is cancelled, or turns out shorter is refunded automatically.
filenameJSON body · string- The video’s name.
size_bytesJSON body · integer- Its size in bytes.
duration_secondsJSON body · number- Its length; checked when the job runs.
optionsJSON body · object- faces (true), image_style (solid or pixelate), audio (bleep or mute), category_group, include_words, exclude_words.
Request
curl https://file-croc.com/api/v1/jobs -H "Authorization: Bearer $CROC_KEY" -H "Content-Type: application/json" \
-d '{"filename": "talk.mp4", "size_bytes": 31457280, "duration_seconds": 312, "options": {"faces": true}}'
# then, for each part n (part_size bytes each):
curl https://file-croc.com/api/v1/jobs/$JOB/parts/0 -H "Authorization: Bearer $CROC_KEY" --data-binary @part-0
curl -X POST https://file-croc.com/api/v1/jobs/$JOB/start -H "Authorization: Bearer $CROC_KEY"Response (201)
{
"id": "9f2c41d0b8e34a6f8a1c5e7d3b2a4c6e",
"status": "uploading",
"part_size": 16777216,
"parts": 2,
"progress": 0,
"result_parts": 0
}Price a model trained on your documents
What training a model on this much text would cost and roughly how long it takes, and whether there is enough (or too much) text. Count the characters of the chunks you will upload.
Cost Free
chunksJSON body · integer- How many chunks of text.
charactersJSON body · integer- Their total length in characters.
Request
curl https://file-croc.com/api/v1/finetune/estimate -H "Authorization: Bearer $CROC_KEY" \
-H "Content-Type: application/json" -d '{"chunks": 1800, "characters": 2900000}'Response
{
"tokens": 725000,
"premium": 69,
"examples": 7200,
"minutes": 91,
"can_train": true,
"reason": null
}Train a model on your documents (background job)
Trains a small open model on your documents: we write questions and writing tasks from your text and fine-tune a LoRA adapter on them. Upload the text as JSON Lines, one chunk per line ({"text", "document", "page"}), in part_size pieces to /jobs/{id}/parts/{n}, start it with POST /jobs/{id}/start, and poll GET /jobs/{id} (it takes an hour or more). When status is done, options.result_model names the model. Your text is deleted once the training set is made, and the training set once the model is trained. Mask personal data first: a model can repeat what it was trained on. Needs a Tadpole or Croc plan.
Cost Charged when started: 1 credit plus the premium credits the estimate gives. A job that fails, is cancelled, or turns out smaller is refunded automatically.
nameJSON body · string- What to call the model.
size_bytesJSON body · integer- The upload’s size.
chunksJSON body · integer- How many chunks it has.
charactersJSON body · integer- Their total length; checked when the job runs.
keep_datasetJSON body · boolean- Keep the questions and answers written from your text (and the training set and test results) with the model, to download. Default false: they are deleted once it is trained.
Request
curl https://file-croc.com/api/v1/jobs/finetune -H "Authorization: Bearer $CROC_KEY" -H "Content-Type: application/json" \
-d '{"name": "Handbook", "size_bytes": 3145728, "chunks": 1800, "characters": 2900000}'
# then upload the parts and start it, as for a video:
curl https://file-croc.com/api/v1/jobs/$JOB/parts/0 -H "Authorization: Bearer $CROC_KEY" --data-binary @part-0
curl -X POST https://file-croc.com/api/v1/jobs/$JOB/start -H "Authorization: Bearer $CROC_KEY"Response (201)
{
"id": "5d1e0c9a7b3f4e2a9c8d6b4a2f0e1c3d",
"kind": "finetune",
"status": "uploading",
"part_size": 16777216,
"parts": 1,
"progress": 0
}Download a trained model
A model trained on your documents, and how it did on held-out questions against the model it started from (scorecard, marks 1 to 5 for getting the facts right). Each question is asked twice: with_passages (with the passages it came from, as pond chat asks) and from_memory; the top-level figures are with_passages. Each file comes in parts: fetch /models/{id}/files/{file}/{n} for n from 0 to parts − 1, join them, and check the sha256. adapter is the LoRA adapter (for the base_model it names); gguf is the whole model, quantised, for Ollama or LM Studio. If you kept the dataset: questions (every question and answer, CSV), training-set (JSON Lines, the format other fine-tuning services take) and test-results (the held-out questions with both models’ answers and marks, CSV). GET /models lists your models; DELETE /models/{id} deletes one. Files are kept for 30 days, or while the model is hosted (hosted_until: chat can answer with it, see /chat).
Cost Free
idpath · string- The model’s id.
Request
curl https://file-croc.com/api/v1/models/$MODEL -H "Authorization: Bearer $CROC_KEY"
curl https://file-croc.com/api/v1/models/$MODEL/files/gguf/0 -H "Authorization: Bearer $CROC_KEY" -o part-0Response
{
"id": "8c2b6e4f1a3d4c5b9e7f0a2c4e6b8d1f",
"name": "Handbook",
"base_model": "unsloth/Qwen3.5-9B",
"files": {
"adapter": { "filename": "file-croc-…-adapter.tar", "bytes": 175112192, "parts": 3, "part_bytes": 67108864, "sha256": "9e1f…" },
"gguf": { "filename": "file-croc-…-Q4_K_M.gguf", "bytes": 5637144576, "parts": 84, "part_bytes": 67108864, "sha256": "41c7…" }
},
"scorecard": { "examples": 50, "judged": 50, "tuned_wins": 38, "base_wins": 4, "ties": 8, "tuned_score": 4.1, "base_score": 2.6 },
"expires_at": "2026-11-12T10:00:00Z"
}Store a document
Keeps one file, encrypted, so you can share it. A stored file that is never shared is deleted after 10 minutes.
Cost Free
fileform field · file- One document, up to 20 MB.
Request
curl https://file-croc.com/api/v1/documents \
-H "Authorization: Bearer $CROC_KEY" \
-F "file=@letter-redacted.pdf"Response (201)
{
"id": "3506c57c30eb454b85d188c44d8663f5",
"filename": "letter-redacted.pdf",
"content_type": "application/pdf",
"size_bytes": 48211,
"sha256": "51ab…7d",
"created_at": "2026-10-09T12:00:00Z"
}