API reference
The REST endpoints as implemented today,
on the commercial API base (https://api.tooley.work). All paths
below are relative to the /v1 root. The whole table is
also published as a machine-readable OpenAPI 3.1 document at
https://api.tooley.work/v1/openapi.json.
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /v1/tools | — | Every priced tool with its credit price and input map. |
| GET | /v1/tools/{slug} |
— | One tool's catalogue entry with its full parameter schema. |
| POST | /v1/tools/{slug}/jobs |
Bearer | Submit a job (JSON or multipart). |
| GET | /v1/jobs/{job_id} |
Bearer | The job object; poll this. |
| POST | /v1/jobs/{job_id}/cancel |
Bearer | Cancel a queued job (running jobs cannot be). |
| GET | /v1/jobs/{job_id}/outputs |
Bearer | The output index. |
| GET | /v1/jobs/{job_id}/outputs/{i} |
Bearer | Download one output's bytes. |
| GET | /v1/wallet/balance |
Bearer | Available and reserved credits. |
| GET | /v1/wallet/transactions |
Bearer | Newest-first ledger rows (limit 1–200, default 50). |
| GET | /v1/openapi.json | — | The published OpenAPI 3.1 contract for this whole table (machine-readable; for SDKs and CI). |
| GET | /v1/credit-packs | — | The public credit-package catalogue. |
| POST | /v1/credit-packs/{pack}/checkout |
— | Start a Stripe Checkout session with a valid
e-mail; responds checkout_url. |
Tool catalogue
GET /v1/tools returns
{"tools": [entry, …]}, sorted by id. An
entry:
{
"id": "archive-inspector",
"title": "Archive inspector",
"description": "…",
"credits": 2,
"category": "archives",
"tags": ['ZIP', 'inspection'],
"input": {
"files": {"min": 1, "max": 1, "max_bytes": 104857600,
"content_types": ['application/zip']},
"params": {"type": "object", "properties": {…}}
},
"output": {"files": {"max": 1}},
"retention": {"result_minutes": 10, "upload_delete_at": "immediate"}
credits is a fixed number (2, 5 or 8). The
input map tells you exactly what to send: file count,
size caps and content types, the JSON Schema for
params, and whether pasted text is accepted. Unknown
tools answer 404 J_TOOL_NOT_COMMERCIAL — the
catalogue only lists tools that are callable commercially.
Job submission
POST /v1/tools/{slug}/jobs. Choose the
body by what the tool takes: parameter-only tools accept one JSON
object whose top-level keys are the tool's parameters
(Content-Type: application/json); tools that take
files require multipart form data with the parameter JSON in the
params form field. Wrapping the parameters in a nested
params object on the JSON shape is a mistake the API
reads as no parameters at all — it answers 422
V_MISSING_PARAM naming the missing required key.
Sending JSON to a file tool (or any other body) answers 415.
Optional Idempotency-Key header (or an
idempotency_key form field; both, and they must
match): a repeated key with identical content returns the same job
at HTTP 200 with deduplicated: true instead of
charging again; a key reused with different content answers 409
J_IDEMPOTENCY_CONFLICT.
Success: 202 with job_id, state,
price_credits, credits_reserved,
poll_url, deduplicated, and a
Location header. The credits are reserved at
admission, not debited — the reserve settles (or releases)
when the job finishes. Admission fails honestly:
- 402
J_WALLET_INSUFFICIENT— the available balance cannot cover the reservation. - 429
R_RATE_LIMIT— per-credential and per-wallet rate/active-job limits; obeyRetry-After. - 422
V_*— body, params or files failed validation.
Job status
GET /v1/jobs/{job_id} returns the job
object: the same view the anonymous explorer sees minus legacy
money fields (wallet jobs never carry pence). Key fields:
id, state, price_credits,
tariff band, result when finished and
error ({code, message, retryable})
when it failed. The object itself is small — outputs are a
separate read. Jobs are wallet-owned: another wallet's job id
produces the same 404 J_NOT_FOUND as an unknown id, so
no cross-wallet enumeration exists.
Cancellation
POST /v1/jobs/{job_id}/cancel cancels a
job that is still queued, releasing the reservation. Once running,
the call answers 409 J_NOT_CANCELABLE — running
jobs cannot be cancelled, but a failed run still releases rather
than settling.
Outputs
GET /v1/jobs/{job_id}/outputs requires the
job to be in result; before that it answers 409
J_NOT_DELIVERABLE. The index lists
index, name, content_type,
bytes and the relative url for each
output:
{
"job_id": "b57b…",
"outputs": [{
"index": 0, "name": "out_…",
"content_type": "text/plain", "bytes": 120,
"url": "/v1/jobs/b57b…/outputs/0"
}]
}GET /v1/jobs/{job_id}/outputs/{i}
streams the bytes with a Content-Disposition carrying
the documented filename. Retention per tool bounds this: past
the window, the endpoint answers 410 R_EXPIRED.
Wallet
GET /v1/wallet/balance:
{
"wallet_id": "w-…",
"available_credits": 98,
"reserved_credits": 2
}GET /v1/wallet/transactions?limit=50 (limit bounded
to 1–200) returns newest-first rows:
ts_ms, kind, delta_available,
delta_reserved, job_id, note.
Reserved decreases available only on settle; failure
and cancellation put both back.
Credit packages and checkout
GET /v1/credit-packs lists the purchasable packages
(id, display name, credits, price in minor units, currency, notes).
POST /v1/credit-packs/{pack}/checkout with a
JSON body containing email,
email_confirmation and ack starts a Stripe
Checkout session if both addresses are valid and match after
trimming whitespace and ignoring case, and ack carries
the immediate-service acknowledgement exactly as the
purchase page shows it (the letter-for-
letter statement; anything else answers 422
V_ACK_REQUIRED and no session is created). It returns a
checkout_url to redirect to. The portal's own
purchase page does this for you if you do
not want to call the API; fulfilment (wallet crediting + the
retrieval e-mail) happens inside the verified Stripe webhook either
way.
Error shape
Every refusal keeps
{"code", "message"} with an
X-Error-Code header and Cache-Control: no-store.
The full code table is on
Credits and errors.
OpenAPI specification
The machine-readable contract for every endpoint on this page is
published at GET /v1/openapi.json — an OpenAPI 3.1
document with stable operation ids, the bearer security scheme and
these response shapes, suitable for SDK generation and CI:
https://api.tooley.work/v1/openapi.json. It needs no
authentication and describes only the public surface; the per-tool
parameter schema stays in each tool's catalogue entry, which is
what SDKs should fetch per tool.