Ask AI is in beta. Behavior, providers, and rate limits may change. The panel loads only on your live default-branch site, not on local preview, branch previews, or commit URLs.
Before you begin
- A published docs.page site on your repository's default branch (see Publish if you have not shipped yet)
- GitHub admin access on the repository and GitHub CLI authenticated (
gh auth login) or a token for--gh-auth - An API key from OpenAI, Anthropic, Google, or xAI
- Context on how Ask AI fits with llms.txt and MCP (see Agent-ready docs)
For how the panel searches MDX, session security, and rate limits, see Ask AI on Features.
Enable the Ask AI panel by running a CLI command, then set agent.key in docs.json:
Provision credentials with the CLI
Register the agent: from any directory, run the
createcommand with your GitHub repository and LLM provider name. The CLI encrypts your API key locally, verifies GitHub admin access, and registers the agent with docs.page. docs.page assigns a default model per provider:npx @docs.page/cli agent create --repo org/repo --provider openainpx @docs.page/cli agent create --repo org/repo --provider anthropicnpx @docs.page/cli agent create --repo org/repo --provider googlenpx @docs.page/cli agent create --repo org/repo --provider xaiOmit flags in an interactive terminal to be prompted for the repository, provider, and API key. On success, the CLI prints a random UUID string. Add this value to your
agent.keyconfiguration.For every flag, provider list, and error message, see
docs agent createin the CLI. To rotate keys, pass--forceon a second create run.Wire the key into docs.json
Connect the live site: add an
agentblock at the top level ofdocs.jsonwith the key from the CLI output:json"agent": { "key": "value from cli" }Commit the change on a branch and merge to your default branch, or push directly when you are ready.
Publish to the default branch
Ship the config: push or merge so the production URL at
https://docs.page/org/reporeads the updateddocs.json. Branch previews and commit URLs do not load the panel even whenagent.keyis present.
After the agent is enabled, tune reader-facing copy and limits in docs.json without re-running create:
"agent": {
"key": "value from cli",
"placeholder": "Ask a question about this documentation…",
"questions": [
"How do I get started?",
"Where is the API reference?"
],
"limits": {
"ip": 200,
"repo": 10000
}
}agent.placeholder: Text shown in the empty question inputagent.questions: Starter prompts before the first message; clicking one sends it immediatelyagent.limits.ip: Maximum chat requests per client IP per hour (default 200)agent.limits.repo: Maximum chat requests per repository per hour (default 10,000)
Field behavior and defaults are documented on Ask AI on Features.
Open your production docs URL on the default branch, for example https://docs.page/org/repo. Confirm the Agent control appears in the site header (or press Ctrl+I), open the panel, and send a test question. You should see a streamed reply with links back to your pages.
If the control is missing, work through Troubleshooting before re-running create.
| Symptom | Likely cause | Fix |
|---|---|---|
| No Agent control on the live site | agent.key missing from docs.json on the default branch | Add the key from create output, commit, and push to the default branch |
| Panel missing on a preview or PR URL | Agent loads only on the default-branch production URL | Open https://docs.page/org/repo without a ~branch suffix |
| Panel missing after a successful create | agent.key in docs.json does not match the stored agent | Copy the key printed by create exactly, or run create again with --force and update docs.json |
| GitHub auth error during create | gh not logged in or token lacks access | Run gh auth login or pass --gh-auth with a token that has admin on the repo |
| Agent creation failed (403) | Account is not a GitHub admin on the repository | Use an account with admin access |
| Chat works locally in preview but not on the site | Local preview never loads the agent panel | Verify on the production default-branch URL after push |
To remove stored credentials, run npx @docs.page/cli agent delete --repo org/repo. See Manage the AI agent for delete workflows and API base URL options.
- Agent-ready docs: llms.txt, MCP, and skills alongside Ask AI
- Ask AI on Features: how the panel works, session security, and rate limits
- CLI: flags and errors for
docs agent createanddocs agent delete
