AI editing API
Read and write your documentation site programmatically, or let an AI assistant build it: keys, endpoints, and examples.
AI editing API
Generate or edit an entire doc site programmatically, or hand a key to your AI coding assistant and let it build the site from a single prompt. The API lets a script or an assistant read your current pages and create or replace them.
Keys
There are two kinds, both scoped to a single site:
- One-off editing key. Starts with
dpk_and expires about an hour after you generate it. Best for a single working session, or to hand to an assistant. - Long-lived key. Starts with
hepgg_docs_, for scripts and CI.
Authorization: Bearer <KEY>The authoring guide
If you are pointing an AI assistant at your site, give it the full authoring guide at hep.gg/api/v1/pages/llms. It documents the content model, every component, and this API in one place, so a model can generate a complete site in one pass.
Endpoints
https://hep.gg/api/v1/pages/ai/siteAuth requiredhttps://hep.gg/api/v1/pages/ai/pageAuth requiredhttps://hep.gg/api/v1/pages/ai/pageAuth requiredhttps://hep.gg/api/v1/pages/ai/pageAuth requiredhttps://hep.gg/api/v1/pages/ai/categoryAuth requiredWriting a page
pathdocs/ (a sidebar doc) or pages/ (a standalone page).formatmdxmdx to use components, or md for plain Markdown.frontmattertitle, description, sidebar_label, sidebar_position, hide_title, draft.bodyllmBody/llms.Example
Responses
Every response is a JSON envelope:
{ "ok": true, "data": { } }On failure, ok is false with an error message and a short code:
{ "ok": false, "error": "path must start with docs/ or pages/", "code": "bad_path" }Organizing the sidebar
Folders become sidebar categories. Set a category's label and order with
POST /ai/category:
{ "path": "docs/guides", "label": "Guides", "position": 1, "collapsed": false }When you are done, publish the site and mount a domain from your dashboard.