Cette page est disponible en anglais uniquement.

SagBot API and MCP docs

Scan sites for AI readiness and check what AI answer engines say about a brand from your own code, CI or coding agent. One token works everywhere.

What you can call

SurfaceEndpointWhat it does
Scan APIhttps://api.sagbot.appRuns SagBot's AI-readiness scan: Agent-ready and Answer-ready scores and every fix. REST, synchronous.
AI visibility APIhttps://api.sagbot.appAsks AI answer engines a question and reports whether a brand is mentioned and cited. REST, queued.
MCP serverhttps://mcp.sagbot.app/mcpScans, client reports, AI citation lookups, your balance, check explanations and AI answer checks, as tools for coding agents (Claude Code, Cursor, Codex, VS Code and others).

Get a token

  1. Sign in to SagBot (a free account) and open Account → Credentials.
  2. Create a personal API token. It starts with sgb_ and is shown once, so copy it then.
  3. Keep it in a secret store or an environment variable, for example SAGBOT_TOKEN, never in a committed file.

The same token works for the Scan API, the AI visibility API and the MCP server. Revoke it on the same page at any time; a revoked token is refused at once.

Authentication

Send the token as a bearer token on every request:

curl "https://api.sagbot.app/v1/usage?days=7" \
  -H "Authorization: Bearer $SAGBOT_TOKEN"

GET /v1/engines, GET /v1/health and GET /openapi.yaml need no token. A missing, unknown or revoked token gets 401 (unauthorized).

Pricing

Paid calls draw on a prepaid USD balance: top up $10, $25 or $50 at Account → Billing. No subscription, and the balance doesn't expire.

WhatPrice
Scan of your own verified domain (REST or MCP)Free
Stored scan result (cached, or read with GET /v1/scans/latest)Free
New scan of any other site: the first 3 a day (UTC), REST and MCP togetherFree
Each further new scan of another site$0.06
AI visibility answer: ChatGPT, Google AI Overviews, Gemini, Google AI Mode, Perplexity$0.035
AI visibility answer: Claude, ChatGPT API, Gemini API (web search on)$0.06
Agency report (POST /v1/reports or the MCP tool create_report), its fresh scan included; refunded if the scan fails$1.99
AI citation lookup (POST /v1/mentions or the MCP tool find_ai_citations): your first one is free, and a lookup that finds nothing gets $0.24 back$0.49
Check explanations and checks of an AI answer you bring (the MCP tools explain_check and check_ai_answer)Free

Paid responses carry two headers: X-Cost-USD (what the call cost) and X-Balance-USD (your balance after it), both as decimal strings with six places, such as 0.060000. Failed AI engine answers are refunded automatically. All prices: Pricing.

Read the balance for free before a paid call: GET /v1/balance answers { "balance_usd": 9.89 } with X-Balance-USD, and the MCP tool get_balance returns the same balance.

Rate limits

LimitApplies to
3 a minute per accountScan calls: POST /v1/scan and the MCP tool scan_site, counted together, cached answers included
10 a minute per tokenPaid AI visibility checks (POST /v1/check without dry_run)
10 a minute per accountAgency reports: POST /v1/reports and the MCP tool create_report, counted together, previews (dry_run) not counted
10 a minute per accountAI citation lookups: POST /v1/mentions without dry_run; the MCP tool find_ai_citations has its own 10 a minute
60 a minute per IP addressAuthenticated requests to api.sagbot.app
60 a minute per accountRequests to mcp.sagbot.app; with a personal token, also 60 a minute per IP address. The only limit on get_balance, explain_check and check_ai_answer.

Over a limit, the REST API answers 429 (rate_limited). Wait a minute and retry.

Errors

Every REST error has the same shape: a stable code to branch on, a message for people and a request_id to quote to support (the Cloudflare Ray ID, also sent as X-Request-Id). A 402 adds top_up_url.

{
  "error": {
    "code": "insufficient_balance",
    "message": "This check costs $0.210000",
    "request_id": "8e4f1c2a3b5d6e7f-FRA",
    "top_up_url": "https://sagbot.app/account/billing"
  }
}
StatuscodeMeaning
400invalid_requestBad body or parameter; the message says which
401unauthorizedMissing, unknown or revoked token
402insufficient_balanceThe call costs more than your balance; X-Balance-USD shows what is left, top_up_url where to top up
403site_hiddenThe site's results are hidden by its owner or SagBot and you aren't its verified owner. Not charged
404not_foundUnknown endpoint or check id, or a check that isn't yours
404no_scans_for_hostGET /v1/scans/latest: no stored scan of that site and type
413body_too_largeRequest body over 16 KB
429rate_limitedToo many requests; see Rate limits
500internalSomething went wrong on our side

The MCP server reports errors the MCP way: a tool result with isError: true and the message as text; a balance-too-low message ends with the request id.

Timeouts and retries

POST /v1/scan has no idempotency key. If it times out, don't post again: the scan still finishes and is stored. Read it with GET /v1/scans/latest, which is free.

A scan takes about 20 seconds; give the request a timeout of at least 90 seconds to leave headroom. A second POST while the first scan is still running starts another scan, which can be charged again.

POST /v1/check takes an Idempotency-Key header: a retry with the same key returns the same check and is never charged twice. See Create a check.

OpenAPI

The REST API is described in openapi.yaml (OpenAPI 3.1), for client generators, Postman or your coding agent.

curl -O https://api.sagbot.app/openapi.yaml