Enlitt

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 .md URLs: 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

URLRead it whenIt covers
/docs.mdThe developer is starting a first integration.What the SDK does, install, a first standard call, which import to choose.
/docs/agents.mdYou are choosing what to read.This index.
/docs/cli.mdYou must act on the developer's account.Every command, flag, and default, --json shapes, doctor findings, errors, recipes.
/docs/business-account.mdThe 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.mdYou are creating an application or fixing its redirects.Name, environment, callback URLs, origins, client ID, the dashboard and CLI steps.
/docs/authentication.mdYou are adding login or session handling.The three login handlers, the state store, the session middleware, linking local users.
/docs/models.mdYou are making a standard or premium call.Vercel and OpenAI adapters, premium pricing and maximum charge, streaming.
/docs/usage.mdYou need remaining capacity or a direct provider call.usage() and accounting for a premium call without an adapter.
/docs/idempotency.mdA call may be retried or duplicated.Idempotency keys, retries, and why output is not replayed.
/docs/premium-limits.mdA premium call is refused or capped.Reservations, per-call limits, the limits object, limit and credit refusals.
/docs/errors.mdYou have an error code or class to handle.Every typed error, which are safe to show a user, and recovery.
/docs/environments.mdThe question is test versus live, or staging.What test and live mean, per-deployment keys, targeting a staging server.
/docs/api-keys.mdYou are creating, rotating, or revoking a key.App and Read-only keys, one-time secrets, rotation, revocation, dashboard and CLI.
/docs/business-reporting.mdYou need earnings, payout eligibility, or traffic in code.enlitt business info, enlitt traffic, and GET /v1/business/info with its fields.

Task map

TaskReadRun
First integration/docs.md, then /docs/application-registration.mdnpx enlitt setup --name "<app name>"
Add login/docs/authentication.mdnpx enlitt doctor
Make a premium call/docs/models.md, /docs/premium-limits.mdnpx enlitt doctor
Handle an error code/docs/errors.mdNone; match the code to its table row.
Callback or redirect mismatch/docs/application-registration.mdnpx enlitt doctor --callback-url <url>, then the action it prints
Rotate a key/docs/api-keys.mdnpx enlitt key rotate <key_id> --write-env .env.local
A traffic or earnings question/docs/business-reporting.mdnpx enlitt traffic --days 7 --json
A payout question/docs/business-account.mdnpx enlitt business info --json
Test versus live/docs/environments.mdnpx enlitt app show --json

Account questions to CLI commands

The developer asksRun
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

  1. Never print, read, cat, or ask the developer to paste an Enlitt secret. Secrets go to .env.local through --write-env. Read a key's metadata, never its value.
  2. Never pass --confirm without the developer's explicit yes in this conversation. It gates revoking a key, rotating a live key, and creating a live application.
  3. When a command fails, follow its action. With --json the error is { "error": { "code", "message", "action" } }; do the one thing action says.
  4. Never use --reveal. It prints a raw secret and is refused in an agent's shell anyway.
  5. 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.
  6. Against Enlitt staging, pass --env staging on every command. A command without it acts on production. Commands the CLI prints already carry it.
  7. Stay within the developer's role. Before an app or key change, check business.allowed_commands from whoami. On insufficient_permissions, tell the developer what the action says (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.

On this page