Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DOC_CHEAP_API_KEYNoYour API key. Unset uses the public sandbox: 10 free recognitions, no balance.sk_sandbox_public
DOC_CHEAP_API_BASENoBase URL of the API. Only set this to reach another deployment.https://api.doc.cheap
DOC_CHEAP_DOCS_DIRNoOverride the directory search_docs reads.
DOC_CHEAP_DOCS_BASENoBase URL used to build documentation links.https://doc.cheap/docs
DOC_CHEAP_IMAGE_ROOTNoThe one directory image_path may read images from. If unset, image_path is disabled.
DOC_CHEAP_SENTRY_DSNNoOpt in to failure reporting. Without it the tracker library is never loaded.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}
resources
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
scan_documentA

Recognise a passport, national ID card or driver's licence from a photo or scan and return what is printed on it as structured JSON. Inputs: the image as image_base64 (always available), image_path (a local file, and only inside the directory DOC_CHEAP_IMAGE_ROOT names) or image_url (https, on a public address); plus the optional expect_country, return_portrait, retain_hours, reference and idempotency_key. Output: a Scan object – meta (id, status, billed, confidence, timing), document (kind, issuing country, number, series, date of issue, date of expiry, whether it has expired and how many days are left), holder (given names, surname, date of birth, sex, nationality), fields (every field read off the printed page, each with its own confidence), mrz (whether the machine-readable zone checks out, why not when it does not, and its lines exactly as read), images, quality and authenticity – plus a one-line summary of the same result. Calls POST /v1/scans. Cost: it bills one credit ($0.01) only when a document is recognised; an unreadable image, an empty frame or an unsupported type costs nothing, and meta.billed says which happened. Without a key, the public sandbox key is used. It gives 10 free recognised documents per address in all, and at most 10 requests per address an hour, whatever their answer. Registering gives 100 free documents every month. Use it whenever someone hands over an identity document and wants it read, transcribed, or checked against what they claim – a name, a document number, a date of birth or an expiry date.

check_balanceA

Return how many credits are left on the account and what the current period has used: the balance, split into this month's free credits (100 every month, drawn first) and the paid credits, the credits spent, and the scan counters broken down by status (recognized, unreadable, no document found, unsupported document, rejected). Takes no arguments and calls GET /v1/usage; under the public sandbox key it answers without calling anything. One recognised document draws one credit, at $0.01; scans that recognised nothing are counted and never charged. Needs a real API key – under the public sandbox key there is no account behind the call, and the answer says so instead of reporting zeros that read like a balance. Use it before working through a batch of documents, or when a scan is refused for lack of credit.

search_docsA

Full-text search over the doc.cheap API documentation – endpoints, request options, every response field, the error codes and what to do about each, MRZ rules, retention and pricing. Takes a query and an optional limit (1 to 20, default 5), and answers with the matching sections: title, a snippet, and a link to the page. It reads a copy of the documentation shipped beside this server, so it makes no network call and works offline. Use it before guessing at a field name, an error code or a scan option – what it returns is the published contract rather than a recollection of it.

list_scansA

List the account's stored scans, most recent first, one page at a time. Inputs: the optional limit (1 to 100 rows, default 20) and cursor (the next_cursor of the previous page; omit it for the first page). Output: scans – one row per scan with id, status (recognized, unreadable, no_document_found, unsupported_document or rejected), billed, duration_ms, reference (your own string from the scan) and created_at – and next_cursor, which is null on the last page. A row holds no extracted data; call get_scan with its id for the full result. Calls GET /v1/scans; it never charges a credit. Only scans made with a live key under a non-zero retention window are stored, and only until that window ends (retain_hours on the scan, or the account's history-retention setting, one year by default); a scan made with retain_hours 0 was never stored. A key reaches its own account's scans and no other account's. Under a sandbox key – the public one or an account's own sk_sandbox_ key – nothing is stored. Under the public sandbox key the answer is an empty list, given without calling the API. Errors: a cursor this API did not issue is refused (validation_failed); a key the API does not know is refused (unauthorized). Use it to find a scan made earlier – by its reference or its time – before reading or deleting it.

get_scanA

Fetch the full result of one stored scan by its id, as it was returned when the document was recognised. Input: scan_id – meta.id of a scan_document result, or id of a list_scans row. Output: the same Scan object scan_document returns (meta, document, holder, fields, mrz and the rest) plus a one-line summary, with two differences: the image crops are never stored, so every images slot is null, and quality reads not_checked. Calls GET /v1/scans/{id}; it never re-runs recognition and never charges a credit. Only scans made with a live key under a non-zero retention window are stored, and only until that window ends (retain_hours on the scan, or the account's history-retention setting, one year by default); a scan made with retain_hours 0 was never stored. A key reaches its own account's scans and no other account's. Under a sandbox key – the public one or an account's own sk_sandbox_ key – nothing is stored. Errors: an id that is unknown, belongs to another account, was made with retain_hours 0 or has passed its window is refused as not_found – the cases are not told apart. Use it to read back a document recognised earlier instead of scanning the image again.

delete_scanA

Permanently delete one stored scan now, before its retention window would end. This cannot be undone: the stored result, its history row and its thumbnail are removed, and the scan can no longer be listed, fetched or replayed through its idempotency_key. The credit it drew is not refunded, and this period's usage counters still count it. Input: scan_id – meta.id of a scan_document result, or id of a list_scans row. Output: { id, deleted: true }. Calls DELETE /v1/scans/{id}. Only scans made with a live key under a non-zero retention window are stored, and only until that window ends (retain_hours on the scan, or the account's history-retention setting, one year by default); a scan made with retain_hours 0 was never stored. A key reaches its own account's scans and no other account's. Under a sandbox key – the public one or an account's own sk_sandbox_ key – nothing is stored. Errors: an id that is unknown, belongs to another account, has passed its window or was already deleted is refused as not_found, and nothing is deleted. Use it when someone asks for a document's data to be removed; confirm the id with list_scans or get_scan first, because the deletion is final.

Prompts

Interactive templates invoked by user choice

NameDescription
scan_document_to_jsonScan one passport, ID card or driver's licence image by its URL and present the printed fields it carries, with the structured JSON underneath.
check_document_expiryScan one document image by its URL and report its expiry date, whether it has expired as of the scan, and how many days are left.
batch_scanCheck the balance, then scan several document images one by one and summarise what was read and which ones failed.
explain_errorExplain what a doc.cheap API error code means, whether retrying helps, and what to change – from the documentation page for that code.

Resources

Contextual data attached and managed by the client

NameDescription
changelogEvery change to the recognition API and to this documentation, dated, newest first, with an Atom feed and a page per month.
conceptsWhy the API behaves as it does: what recognition actually does, what confidence means, what is billed, what is kept, and what fails.
concepts/api-keys-and-sessionsThe two ways a caller is identified – an API key and a dashboard session – what each may do, and why they are kept apart.
concepts/confidence-and-readingsWhy confidence is a band rather than a number, why one field can be read more than once, and what a verdict of not_checked is saying.
concepts/crypto-depositsHow a permanent deposit address is derived for an account, how a transfer becomes credits, and what the chain watcher does and does not promise.
concepts/data-retention-and-privacyWhat this service stores, for how long, what it never stores at all, and what zero retention means for a request and its result.
concepts/how-recognition-worksWhat happens between sending an image and getting fields back: detection, classification, zone reading and the checks that follow.
concepts/mrz-and-the-visual-zoneWhy a document says the same thing twice, when the two zones disagree, and which one to believe in each of those cases.
concepts/reliabilityWhat this service promises when a dependency is away, what it charges in that case, and how a caller can tell a retry is worth making.
concepts/what-a-billed-scan-isOne cent per document, and the rule that decides whether a call is charged at all: what makes a recognition billable, and what does not.
errors/document_repeatedThe same document was sent again within the window that guards against a duplicate charge. What raises it, and how to fix it.
errors/engine_unavailableThe recognition engine did not answer within its timeout; nothing was charged. What raises it, and how to fix it.
errors/idempotency_conflictThe idempotency key was reused with a different request body. What raises it, and how to fix it.
errors/idempotency_in_progressThe first request carrying this idempotency key has not finished yet. What raises it, and how to fix it.
errors/idempotency_replay_unavailableThe first result for this idempotency key can no longer be replayed. What raises it, and how to fix it.
errors/impersonation_read_onlyRaised only on an administrative surface: an impersonated session may not write. What raises it, and how to fix it.
errors/insufficient_creditsThis month's free credits and the paid credits are both used up, so the recognition cannot be reserved. What raises it, and how to fix it.
errors/internal_errorAn unexpected failure; nothing was charged and the response carries an event id. What raises it, and how to fix it.
errors/invalid_requestThe request was malformed or an argument was outside the range the endpoint accepts. What raises it, and how to fix it.
errors/maintenanceThe service is in a planned maintenance window and is refusing requests for its duration. What raises it, and how to fix it.
errors/not_foundNo resource matched the request, or the one that did has passed its retention window. What raises it, and how to fix it.
errors/payload_too_largeThe request body is over the size the endpoint accepts. What raises it, and how to fix it.
errors/payment_driver_unavailableRaised only on an administrative surface when a payment driver is not configured. What raises it, and how to fix it.
errors/rate_limitedThe caller is over the request rate its key allows; the response says when to retry. What raises it, and how to fix it.
errors/rate_unavailableThe exchange rate needed to price this top-up could not be read. What raises it, and how to fix it.
errors/registration_requiredThe public sandbox allowance is spent; an account of your own is needed to continue. What raises it, and how to fix it.
errors/service_unavailableA store this service depends on is unreachable, so the request cannot be served now. What raises it, and how to fix it.
errors/topup_in_progressA top-up for this account is already being processed. What raises it, and how to fix it.
errors/unauthorizedThe API key was missing, malformed, revoked or not valid for this endpoint. What raises it, and how to fix it.
errors/unsupported_media_typeThe content type or the image format is not one this endpoint reads. What raises it, and how to fix it.
errors/validation_failedThe request parsed but a field failed validation; the body names the field. What raises it, and how to fix it.
guidesTask-shaped instructions: recognizing each kind of document, handling errors and retries, controlling retention, managing keys, and tracking spend.
guides/check-an-mrzVerify the check digits of a machine-readable zone, read what a failed digit means, and decide what to do with the document.
guides/control-history-retentionChoose how long a result is kept: per request, per account, or not at all, and understand what disappears when the window ends.
guides/get-results-without-webhooksThe API answers in the same response, so there is no callback to register. This is how to fit that into a queue or a background worker.
guides/handle-errorsBranch on the error code rather than the status, decide what to retry, and turn the documentation link in every error body into a fix.
guides/handle-non-latin-scriptsRead documents printed in Greek, Arabic or Han script: which values are transliterated, which are not, and how to get both spellings.
guides/recognize-a-driver-licenceSend a driver licence to the recognition API, read the vehicle categories and dates, and handle the layouts that vary by country.
guides/recognize-a-passportSend a passport photo to the recognition API, choose the options that matter, and read the machine-readable zone and the visual fields.
guides/recognize-an-id-cardSend a national ID card to the recognition API, including the two-sided case, and read the identity fields that come back.
guides/retry-safely-with-idempotencySend an idempotency key so a retried recognition returns the first result instead of running and charging a second time.
guides/rotate-api-keysIssue a second key, move traffic onto it and revoke the old one, without a window in which calls fail.
guides/top-up-with-cryptoSend USDT to the permanent deposit address of your account and watch the credits arrive, including what to do if they do not.
guides/track-usage-and-spendRead the balance and the period counters from the API, and reconcile them against what the dashboard shows for the same period.
guides/use-the-mcp-serverInstall the MCP server with npx so a coding assistant can recognize a passport or ID, check the balance, work with stored scans and search these docs.
guides/work-with-result-imagesAsk for the portrait and the cropped document image, read them out of the response, and know how long each stays available.
indexTurn a photo of a passport or ID card into structured JSON with one HTTP call. Run the example here, then pick a guide or the reference.
referenceThe exact contract: endpoints, response shapes, the field catalogue, scan options, errors, limits, idempotency and versioning.
reference/errorsEvery error code the recognition API returns, the HTTP status it comes with, and the page that states its cause and its fix.
reference/fieldsEvery field key the result publishes, with its label and category, and the rules that decide what appears in the list and what does not.
reference/fields/languagesHow a reading's language is reported, the three steps that resolve it, and the full table of assigned language identifiers.
reference/glossaryThe words this documentation uses with a precise meaning, and what each one means here.
reference/http-status-codesEvery HTTP status this API answers with, the error codes that share it, and what separates them.
reference/idempotencyWhat makes two scan requests the same request, how long a key is remembered, and the three codes that arbitrate a replay.
reference/imagesThe seven image crops a recognition returns, their height caps, and the rules the re-encode follows.
reference/limitsThe limits a caller meets: request rate, image size, request body size, idempotency key length and the retention windows on offer.
reference/mrzThe machine-readable zone as this API publishes it – the lines, the unbroken text, the three formats, and how the check digits are reported.
reference/responseThe recognition result, group by group – every key, its type, when it is null, and what each value is derived from.
reference/scan-optionsEvery option on a scan request: what it changes, its default, its allowed values, and the options that interact with each other.
reference/service-levelsWhat this service measures, what it targets for latency and uptime, how incidents are published, and where the live figures come from.
reference/versioningOne response shape, one version, and what a consumer can rely on.
startThree ways in: your first call with the public sandbox key, moving to a live key of your own, and recognizing a document without writing code.
start/first-recognitionSend one image to the recognition API with the public sandbox key, read the extracted fields, and check what the call cost you.
start/from-sandbox-to-liveRegister an account, use its 100 free documents every month, issue your own live key and point an existing integration at it.
start/recognize-without-codeUpload a document in the dashboard, read the extracted fields on screen, and decide whether the API fits before writing an integration.

TDQS

A4.7/5.0

Scored across 6 tools

Disambiguation5/5

Each tool targets a distinct action: balance check, new scan, list stored scans, fetch a stored scan, delete a scan, and search documentation. There is no functional overlap; scan_document creates a new result while get_scan retrieves an existing one, and the descriptions make this boundary explicit.

Naming Consistency5/5

All tools use a consistent snake_case verb_noun pattern (check_balance, scan_document, list_scans, delete_scan, get_scan, search_docs). The convention is predictable throughout and no mixed styles appear.

Tool Count5/5

Six tools is well-scoped for an identity-document scanning service. Each tool earns its place: the core scan lifecycle (create, list, get, delete), a balance check, and a documentation search cover the necessary operations without bloat.

Completeness5/5

The surface covers the full lifecycle: scan a document, list stored scans, retrieve full results, delete scans, check credits, and search docs for field/error details. No obvious operation is missing; scans are immutable so an update tool would be unnecessary.

Maintenance

ActivityMaintained
ResponsivenessNo issues