← File Type Checker
Your token

File Type Checker API

Identifying a file (its real type, the name check, program headers, macros, strings, hex) is free in the browser and needs no API; the file never leaves the page. The API is for the one metered step: send the page's findings and get back a plain-language explanation as JSON, which the page then checks against its own findings. The model never receives the file itself.

Base URL: https://api.skillsafe.ai/v1/app-api. Every response is {"data": ...} or {"error": {"code", "message"}}; read error.code and error.message rather than the HTTP status alone.

The task field

This app has one task. Always send "task": "explain".

taskWhat it doesReply
explainExplains what the file is, why each of the page's checks matters, what the flagged strings and imported functions suggest (quoting them exactly), who the file says made it, and what to do next. It copies the page's type and rating rather than re-judging them, and never calls a file safe or definitely malicious.One ```json block

Input fields

All fields are strings; the JSON-valued ones are JSON text. Build them the way the page does: drop the file there and the request it would send is exactly this shape.

FieldTypeMeaning
taskstring"explain". Required.
filestring (JSON){name, size, extension}. Required.
factsstring (JSON)What the page found: type {id, label, family, confidence, evidence, usual_extensions}, name_check {extension, verdict, name_suggests, double_extension, hidden_character}, level (ok, caution, danger), signals [{id, level, text}], entropy, and when present header, capabilities, unsafe_c_functions, archive, compound_file, image, text. Required.
stringsstring (JSON)Up to 80 flagged strings, [{kind, value}]. Send "[]" if none.
importsstring (JSON)Libraries and imported functions, [{name, functions}], up to 300 function names. "[]" for files that are not programs.
questionstringOptional question, up to 300 characters.
clipped_notestringWhat was left out to keep the request small, or empty.

The reply

job.output.output is text: one fenced ```json block holding task, type (the page's type id), level (the page's rating), summary, made_by, reasons [{signal, why}] (one per caution or danger check), behaviour [{evidence, means}] (evidence copied exactly from the input), next_steps (2 to 5) and answer. If the balance ran low, truncated is true and the block may stop early; the complete fields before the cut are still usable.

Worked example

Input (input.json), for the page's invoice.pdf sample, a Windows program named like a PDF:

{
  "task": "explain",
  "file": "{\"name\":\"invoice.pdf\",\"size\":3072,\"extension\":\"pdf\"}",
  "facts": "{\"type\":{\"id\":\"pe_exe\",\"label\":\"Windows program (.exe)\",\"family\":\"executable\",\"confidence\":\"certain\",\"evidence\":\"bytes 0-1: 4D 5A (MZ header); bytes 128-131: 50 45 00 00 (PE signature)\",\"usual_extensions\":[\"exe\",\"scr\",\"com\",\"cpl\"]},\"name_check\":{\"extension\":\"pdf\",\"verdict\":\"mismatch\",\"name_suggests\":[\"PDF document\"],\"double_extension\":[],\"hidden_character\":false},\"level\":\"danger\",\"signals\":[{\"id\":\"s1\",\"level\":\"danger\",\"text\":\"The name says .pdf (PDF document), but the bytes are a Windows program (.exe). Opening it may run it.\"},{\"id\":\"s2\",\"level\":\"info\",\"text\":\"It has no digital signature, so nothing says who made it. Most programs from large companies are signed.\"}],\"entropy\":2.1,\"read_whole_file\":true,\"header\":{\"format\":\"PE\",\"machine\":\"x86-64 (64-bit)\",\"bits\":64,\"kind\":\"program\",\"subsystem\":\"Windows app with a window (GUI)\",\"timestamp\":\"2025-12-01T00:00:00Z\",\"entry\":\"0x1000\",\"signed_block\":false,\"dotnet\":false,\"aslr\":true,\"dep\":true,\"cfg\":false,\"import_count\":6,\"version_info\":{\"FileDescription\":\"PDF Document\",\"OriginalFilename\":\"pdfview_loader.exe\",\"FileVersion\":\"1.0.0.4\"},\"sections\":[{\"name\":\".text\",\"size\":512,\"exec\":true,\"write\":false,\"entropy\":0.06},{\"name\":\".rdata\",\"size\":1024,\"exec\":false,\"write\":false,\"entropy\":1.96},{\"name\":\".rsrc\",\"size\":512,\"exec\":false,\"write\":false,\"entropy\":1.56}]},\"capabilities\":[{\"id\":\"network\",\"label\":\"Talks to the internet or network\",\"evidence\":[\"InternetOpenA\",\"InternetOpenUrlA\",\"InternetReadFile\"]},{\"id\":\"run\",\"label\":\"Starts other programs or commands\",\"evidence\":[\"CreateProcessA\"]}]}",
  "strings": "[{\"kind\":\"url\",\"value\":\"http://invoice-files.example.net/view.php?doc=\"},{\"kind\":\"winpath\",\"value\":\"%TEMP%\\\\pdfview.exe\"}]",
  "imports": "[{\"name\":\"KERNEL32.dll\",\"functions\":[\"GetTempPathA\",\"CreateProcessA\",\"WriteFile\"]},{\"name\":\"WININET.dll\",\"functions\":[\"InternetOpenA\",\"InternetOpenUrlA\",\"InternetReadFile\"]}]",
  "question": "I got this from a supplier's email, can I open it?",
  "clipped_note": ""
}

Reply:

```json
{
  "task": "explain",
  "type": "pe_exe",
  "level": "danger",
  "summary": "Although it is named invoice.pdf, the bytes show a Windows program (PE, the Windows program format), not a PDF document. The page knows this because the file starts with the bytes 4D 5A (MZ header) and has the PE signature 50 45 00 00. Do not open it; check with your supplier through another channel first.",
  "made_by": "From header.version_info, which is what the file says about itself and not proof: FileDescription \"PDF Document\", OriginalFilename \"pdfview_loader.exe\", FileVersion \"1.0.0.4\". No maker is named.",
  "reasons": [
    {"signal": "s1", "why": "The name says PDF but the content is a program, so double-clicking it may run it instead of showing a document. Honest senders rarely send a program with a PDF name."},
    {"signal": "s2", "why": "There is no digital signature, so nothing confirms who made it. Many unsigned programs are harmless, but a signature is the usual way a company proves it built a file."}
  ],
  "behaviour": [
    {"evidence": "http://invoice-files.example.net/view.php?doc=", "means": "The file contains a web address, so it may contact that site or fetch something from it. Updaters and document viewers also do this."},
    {"evidence": "%TEMP%\\pdfview.exe", "means": "A path in the temporary folder suggests it may save another program there. Installers also unpack into temporary folders."},
    {"evidence": "InternetOpenUrlA", "means": "This function lets a program open a web address and read from it. Browsers and updaters use it too."},
    {"evidence": "CreateProcessA", "means": "This lets the file start other programs. Many honest launchers and installers do this."},
    {"evidence": "GetTempPathA", "means": "This finds the temporary folder, which fits the temp path above. Honest software uses it for scratch files."}
  ],
  "next_steps": [
    "Do not double-click or open the file for now.",
    "Contact your supplier by phone or a separate, known email address and ask whether they really sent invoice.pdf.",
    "Upload it to a multi-engine virus scanner to see what several scanners say.",
    "If the supplier cannot confirm it, delete it and ask them to resend the invoice as a real PDF."
  ],
  "answer": "I would not open it. The file is named invoice.pdf, but its bytes are a Windows program, and it contains a web address, a temp-folder path, and functions for going online and starting other programs. That mix does not prove it is malicious, since some honest tools do the same, but a real invoice has no reason to be a program. Only open it if your supplier confirms through another channel that they sent it and what it is."
}
```

Errors

HTTPWhat to do
401The token is missing, expired or a guest token on a run. Get a personal token on the token page.
402The balance is below what the run reserves. Top up at skillsafe.ai/account/billing.
400The body is not a JSON object of the fields above.
429Wait and retry with the same Idempotency-Key.

Step 1 — a tiny client helper

One function that sends JSON and unwraps the {data, error} envelope.

BASE="https://api.skillsafe.ai/v1/app-api"
TOKEN="paste-your-token-here"   # from https://file-type-checker.skillsafe.ai/tokens.html
api() { # api METHOD PATH [JSON-BODY]
  curl -s -X "$1" "$BASE$2" -H "Content-Type: application/json" \
    ${TOKEN:+-H "Authorization: Bearer $TOKEN"} ${3:+--data "$3"}
}

Step 2 — a token

A guest token is enough for /me and /estimate. A run is metered, so it needs your personal token: sign in on the token page and copy it.

# a guest token (enough for /me and /estimate); a run needs your personal token from /tokens.html
TOKEN=$(curl -s -X POST "$BASE/guest" -H "Content-Type: application/json" -d '{"slug":"file-type-checker"}' | jq -r '.data.token')

Step 3 — who am I, and my balance

subject_type is guest or user; credits is the balance (1 credit = $0.0001).

api GET /me | jq '.data | {subject_type, credits}' 

Step 4 — price a run for free

/estimate charges nothing and starts no job. hold_credits is the amount reserved while a run is in flight, not the price; the run is charged what it uses.

# input.json: the run input object - {"task": "explain", "file": "{...}", "facts": "{...}", "strings": "[...]", "imports": "[...]", "question": ""}
api POST /estimate "$(cat input.json)" | jq '.data | {hold_credits, min_credits, model, model_alias, markup_bps, warnings}' 

Step 5 — run it and wait for the job

Send an Idempotency-Key derived from the input: a retry with the same key is never billed twice.

KEY="file-type-checker:explain:$(shasum -a 256 input.json | cut -c1-16):a1"
JOB=$(curl -s -X POST "$BASE/run" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: $KEY" --data @input.json | jq -r '.data.job_id')
while :; do
  J=$(api GET "/jobs/$JOB"); S=$(echo "$J" | jq -r '.data.status')
  case "$S" in succeeded|failed|cancelled) break;; esac; sleep 2
done
echo "$J" | jq -r '.data.output.output' > reply.txt   # one ```json block: {"summary": [...3 summary]}
echo "$J" | jq '.data | {charged_credits, truncated}' 

Step 6 — or stream it

/run-stream sends Server-Sent Events while the job runs and the finished job at the end.

# Server-Sent Events: tick/delta events while the job runs, then a final event with the job
curl -N -s -X POST "$BASE/run-stream" -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: file-type-checker:explain:$(shasum -a 256 input.json | cut -c1-16):a1" --data @input.json