Docs for coding agents
Start here if you are a coding agent. This page routes you to the one Enlitt doc and command each task needs.
What Enlitt is
Enlitt gives people one account for AI spending across the applications that join it. A business registers an application, and its users sign in with their Enlitt account. An application can make standard calls, which Enlitt runs, and premium calls, which its own server runs against its own model provider. Users hold a monthly plan with a standard allowance and a premium allowance, and they set a per-call limit for each application. The business earns from the premium credits its users spend, and is paid out under the published payout policy.
How to use these docs
- Read only the page the task needs. Usually that is one page.
- Come back to this index when the topic changes.
- Never fetch every page.
- Prefer the
.mdURLs: they are the same pages as plain Markdown, and every link in them stays on.md.
Docs or CLI
- Product and integration questions (how login works, which import to use, what an error means) are answered from the docs.
- Facts about the developer's own account (their applications, keys, traffic, earnings, or payout state) come from the CLI, never from guessing:
npx enlitt … --json. If the CLI is not installed, see the CLI page first.
Documentation map
| URL | Read it when | It covers |
|---|---|---|
/docs.md | The developer is starting a first integration. | What the SDK does, install, a first standard call, which import to choose. |
/docs/agents.md | You are choosing what to read. | This index. |
/docs/cli.md | You must act on the developer's account. | Every command, flag, and default, --json shapes, doctor findings, errors, recipes. |
/docs/business-account.md | The question is about the business, its roles, earnings, or users. | Business accounts, members and roles, test and live, earnings, payouts, what users see. |
/docs/application-registration.md | You are creating an application or fixing its redirects. | Name, environment, callback URLs, origins, client ID, the dashboard and CLI steps. |
/docs/authentication.md | You are adding login or session handling. | The three login handlers, the state store, the session middleware, linking local users. |
/docs/models.md | You are making a standard or premium call. | Vercel and OpenAI adapters, premium pricing and maximum charge, streaming. |
/docs/usage.md | You need remaining capacity or a direct provider call. | usage() and accounting for a premium call without an adapter. |
/docs/idempotency.md | A call may be retried or duplicated. | Idempotency keys, retries, and why output is not replayed. |
/docs/premium-limits.md | A premium call is refused or capped. | Reservations, per-call limits, the limits object, limit and credit refusals. |
/docs/errors.md | You have an error code or class to handle. | Every typed error, which are safe to show a user, and recovery. |
/docs/environments.md | The question is test versus live, or staging. | What test and live mean, per-deployment keys, targeting a staging server. |
/docs/api-keys.md | You are creating, rotating, or revoking a key. | App and Read-only keys, one-time secrets, rotation, revocation, dashboard and CLI. |
/docs/business-reporting.md | You need earnings, payout eligibility, or traffic in code. | enlitt business info, enlitt traffic, and GET /v1/business/info with its fields. |
Task map
| Task | Read | Run |
|---|---|---|
| First integration | /docs.md, then /docs/application-registration.md | npx enlitt setup --name "<app name>" |
| Add login | /docs/authentication.md | npx enlitt doctor |
| Make a premium call | /docs/models.md, /docs/premium-limits.md | npx enlitt doctor |
| Handle an error code | /docs/errors.md | None; match the code to its table row. |
| Callback or redirect mismatch | /docs/application-registration.md | npx enlitt doctor --callback-url <url>, then the action it prints |
| Rotate a key | /docs/api-keys.md | npx enlitt key rotate <key_id> --write-env .env.local |
| A traffic or earnings question | /docs/business-reporting.md | npx enlitt traffic --days 7 --json |
| A payout question | /docs/business-account.md | npx enlitt business info --json |
| Test versus live | /docs/environments.md | npx enlitt app show --json |
Account questions to CLI commands
| The developer asks | Run |
|---|---|
| Who am I signed in as, and with what role? | npx enlitt whoami --json |
| Which commands can my role run? | npx enlitt whoami --json (business.allowed_commands) |
| Is this project wired up? | npx enlitt status --json |
| How many visitors this week? | npx enlitt traffic --days 7 --json (daily counts only; summing days is not unique visitors) |
| How is one application doing? | npx enlitt traffic --app <id> --days 30 --json |
| What have we earned? Can we be paid out? | npx enlitt business info --json (see payout.blocked_reason) |
| Which applications exist? | npx enlitt app list --json |
| What are an application's redirect URLs? | npx enlitt app show <id> --json |
| Which keys exist, and are they active? | npx enlitt key list --json |
| Why does login fail? | npx enlitt doctor --json |
Payouts, members, invitations, ownership, business creation, and account settings are not available from the CLI. Point the developer to the dashboard for those.
Rules
- Never print, read,
cat, or ask the developer to paste an Enlitt secret. Secrets go to.env.localthrough--write-env. Read a key's metadata, never its value. - Never pass
--confirmwithout the developer's explicit yes in this conversation. It gates revoking a key, rotating a live key, and creating a live application. - When a command fails, follow its
action. With--jsonthe error is{ "error": { "code", "message", "action" } }; do the one thingactionsays. - Never use
--reveal. It prints a raw secret and is refused in an agent's shell anyway. - When approval is needed, run the command with
--no-wait. Give the developer the printed URL and code, and ask them to approve in their browser. Then run the same command with--wait. - Against Enlitt staging, pass
--env stagingon every command. A command without it acts on production. Commands the CLI prints already carry it. - Stay within the developer's role. Before an app or key change, check
business.allowed_commandsfromwhoami. Oninsufficient_permissions, tell the developer what theactionsays (for example, ask the owner to create the key); never try another route around it.
What these docs do not cover
When the docs do not answer a question, say so and point the developer to Enlitt support. Never invent Enlitt internals, prices, payout timing beyond what is published, or roadmap.