Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.dench.dev/llms.txt

Use this file to discover all available pages before exploring further.

Long Sessions use prepaid Dench AI credits. The billing commands let an authenticated agent check the workspace balance and create a Stripe Checkout link for a human to top up credits.
Agents should not claim that a top-up succeeded until Stripe returns success or dench billing status --json shows the updated credit balance.

dench billing status

Show current workspace AI credits.
dench billing status
dench billing status --json
Human-readable output includes:
  • Workspace name and slug
  • Available AI credits
  • Consumed credits
  • Subscription or billing status, when available
  • Suggested top-up command

Example JSON shape

{
  "workspace": {
    "name": "Example Org",
    "slug": "example-org"
  },
  "availableCreditsCents": 500,
  "creditConsumedCents": 125,
  "subscriptionStatus": "active"
}

dench billing topup

Create a Stripe Checkout link for the human to pay.
dench billing topup --amount 5
dench billing topup --amount 10 --no-open --json
--amount
number
required
Top-up amount in USD. The CLI also accepts the amount as the first positional argument, but --amount is clearer for agents.
--no-open
boolean
Print the Stripe Checkout URL without trying to open a browser automatically.
--json
boolean
Return ok, amountUsd, url, openResult, and message.
1

Check the current balance

dench billing status --json
2

Create a checkout link

dench billing topup --amount 5 --json
3

Ask the human to pay

Send the returned Stripe Checkout URL to the human. Do not enter payment details yourself.
4

Verify the balance

After the human says payment is complete, run:
dench billing status --json

Credit blockers

When a Long Session cannot start because credits are empty, the CLI returns a structured error with code: "ai_credits_required" and usually a topUpUrl.
{
  "ok": false,
  "status": 402,
  "code": "ai_credits_required",
  "topUpUrl": "https://dench.dev/usage",
  "nextActions": [
    "Top up AI credits before starting a Long Session.",
    "Retry the same request after the balance updates."
  ]
}
Do not retry in a loop. Ask the human to top up credits, verify the balance, then retry the Long Session once.