Skip to content
Docs

AI answers

"Add an AI assistant to my docs site" is two API calls. Your agent creates an Edge Assist site, generates a content index from the pages it's deploying, triggers an ingest, and drops the one-line embed snippet into the site, all without leaving the Agent API.

Why use Assist through the Agent API

  • Grounded answers: Assist only answers from the site's own indexed content, with citations. It won't invent features or pricing.
  • One-line embed: The create response includes the exact script tag and a hosted fallback URL, so the agent doesn't need to look anything up in the docs.
  • Agent-friendly ingestion: content goes in as a simple JSON index the agent can generate at build time from the pages it's already deploying.
  • Feedback loop: The question log surfaces what visitors actually asked. Unanswered questions are content gaps the agent can fix.

API endpoints

Output
GET    /agent/assist/sites                 # List sites
POST   /agent/assist/sites                 # Create a site (returns sitekey + embed snippet)
PATCH  /agent/assist/sites/{id}            # Update name, hostname, index_url, site_prompt
DELETE /agent/assist/sites/{id}            # Delete a site
POST   /agent/assist/sites/{id}/reingest   # Index the site's content now
GET    /agent/assist/sites/{id}/overview   # Usage + health (questions, answer rate, cap)
GET    /agent/assist/sites/{id}/questions  # Question log (?answered=false for gaps)

Requires an agent access code with the assist product. Creating, updating, deleting and reingesting require the manage permission. All write endpoints support X-Dry-Run: true.

Creating a site

HTTP
POST /agent/assist/sites
Authorization: Bearer ea_live_...

{
  "name": "Docs site",
  "hostname": "docs.example.com",
  "index_url": "https://docs.example.com/assist-index.json"
}

# Response:
{
  "site": {
    "id": "ast-abc123",
    "name": "Docs site",
    "hostname": "docs.example.com",
    "sitekey": "ea_7f31d9c2b48e5a06...",
    "monthlyCap": 250,
    "embed": {
      "script": "<script src=\"https://assist.edge.network/widget.js\"
        data-sitekey=\"ea_7f31...\" defer></script>",
      "hostedUrl": "https://assist.edge.network/w/ea_7f31..."
    }
  },
  "next_steps": [
    "Trigger the first ingest: POST /agent/assist/sites/ast-abc123/reingest",
    "Add the embed to the site's pages: <script src=...></script>"
  ],
  "tell_user": "Assist site \"Docs site\" created for docs.example.com.
    Trigger a reingest to index the content, then add the one-line embed
    snippet. Answers only work on docs.example.com (origin-enforced)."
}

Warning

Sitekeys are origin-enforced. The widget only answers on the hostname the site was created for. Get the hostname right. A stolen sitekey is useless off-domain, but so is a mistyped one on-domain.

The content index

Assist ingests a JSON file hosted at a public URL. Agents deploying a static site can generate it at build time from the same pages:

JSON
{
  "pages": [
    {
      "url": "https://docs.example.com/getting-started",
      "title": "Getting Started",
      "text": "Plain text of the page content..."
    }
  ]
}

Set it on creation (index_url) or later via PATCH, then trigger a reingest. Assist also refreshes the index automatically on a regular cycle and skips re-processing unchanged content.

Indexing content

HTTP
POST /agent/assist/sites/ast-abc123/reingest
Authorization: Bearer ea_live_...

# Response:
{
  "index": { "pages": 42, "chunks": 318, "updatedAt": "2026-08-08T14:02:11Z" },
  "tell_user": "Content indexed: 42 pages, 318 chunks. The assistant is
    answering from this content now."
}

Typical agent workflow

  1. Create the site: scoped to the deployment's hostname, with the content index URL if it already exists.
  2. Generate the index: a JSON file of the site's pages, deployed alongside the site itself.
  3. Trigger a reingest: and confirm the page/chunk counts look right.
  4. Inject the embed snippet: one script tag, ideally in the shared layout so it's on every page.
  5. Report back: including the free-tier cap (250 questions/month) and how to go past it (pay-as-you-go, active automatically with a card on file in Billing).

Pricing

The free tier includes one site and 250 answered questions per site per month. Cached answers are free and don't count against the cap.

Pay-as-you-go is active automatically once the account has a card on file. It allows more sites and pays for overage at $0.01 per question from the prepaid balance (a monthly cap is optional). When the headroom runs out, the widget stops answering (search keeps working) until the next month or a top-up.

See also

Something unclear or out of date? Tell us, or read this page as Markdown.