Doks & Credits

How the DokJet credit system works.

Dok

1 standard PDF generation = 1 Dok. Enabled options add Doks on top.

Option costs

Option Cost Description
Standard generation 1 Dok Every call to POST /v1/generate, /v1/transform, or /v1/studio/{slug}.
goDokMode +1 Dok AI layout optimization. false by default on /v1/generate, true by default on /v1/transform.
goDokMode + fichier joint +2 Doks goDokMode enabled + attached source file (multipart/form-data). /v1/generate only.
compress +1 Dok qpdf compression of the generated PDF.
factur_x +1 Dok Force PDF/A-3b + Factur-X preparation (embedded XML data).
embed_files +1 Dok Embed files as invisible attachments. Flat fee: +1 Dok regardless of the number of files.
attachments +1 Dok / file Merge external PDFs into the generated document. Counted per attached file.
header_html / footer_html Free Custom HTML headers and footers. Inline styles required.
pdf_format Free PDF/A archival format. Values: PDF/A-1a, 1b, 2b, 3b.
password Free AES PDF encryption. Paid plans only (HTTP 403 on Free).

Calculation examples

1 Dok
Standard invoice
1 call to POST /v1/generate, no options enabled.
3 Doks
Invoice with Factur-X + compression
Base (1) + factur_x: true (+1) + compress: true (+1) = 3 Doks total.
10 Doks
Batch of 5 with goDokMode
5 entries × 2 Doks each (goDokMode active per entry) = 10 Doks minimum.

Plan limits

Plan Monthly Doks Batch max entries PDF encryption Workspaces
Free 50 Doks / month 3 No 1
Pro 500 Doks / month 10 Yes 3
Max 2,000 Doks / month + auto top-up 10 Yes Unlimited

Check your balance

Use GET /v1/credits at any time to check your Dok balance and active plan.

curl https://dokjet.ptitlabo.xyz/v1/credits \
  -H "X-API-Key: dk_live_••••••••••••"
→  200 OK
{
  "credits_left": 42,
  "plan":         "Free"
}
const balance = await fetch('https://dokjet.ptitlabo.xyz/v1/credits', {
  headers: { 'X-API-Key': 'dk_live_••••••••••••' },
}).then(r => r.json());
// { credits_left: 42, plan: 'Free' }
$data = json_decode(file_get_contents(
  'https://dokjet.ptitlabo.xyz/v1/credits', false,
  stream_context_create(['http' => [
    'header' => "X-API-Key: dk_live_••••••••••••\r\n"
  ]])
), true);
balance = requests.get(
    'https://dokjet.ptitlabo.xyz/v1/credits',
    headers={'X-API-Key': 'dk_live_••••••••••••'}
).json()
# {'credits_left': 42, 'plan': 'Free'}
Auto top-up (Max plan)

The Max plan features an automatic top-up when the Dok balance falls below the threshold set in your dashboard. Configure the threshold and top-up amount in Settings → Billing.