Authentication
API requests
All API requests require an API key passed in the x-api-key header:
Do not use Authorization: Bearer — Docex uses x-api-key exclusively.
Obtaining an API key
API keys are generated during docex setup or from the dashboard:
- Run
docex setup --use-case "..." --top-up 5
- Approve the setup session in the browser (GitHub auth + wallet top-up)
- The CLI returns the API key once — copy it immediately
Dashboard authentication
The web dashboard uses GitHub OAuth. For local development, create a GitHub OAuth App with:
- Homepage URL:
https://docex.dev
- Authorization callback URL:
https://api.docex.dev/v1/auth/github/callback
Set GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET in the API environment. Without them, local development falls back to a handle-based mock login.
Environment variables