Skip to content

API reference

A versioned REST API for every inspection type. The machine-readable spec is at /api/v1/openapi.json.

Authentication

API access is included with the Pro and Team plans. Create an API key in Dashboard → API keys and send it as a Bearer token. Keys start with ail_ and are shown only once.

Authorization: Bearer ail_xxxxxxxxxxxxxxxxxxxxxxxx

Create an inspection

Text, code, website and repository inspections use JSON:

curl -X POST https://aiinspectorlab.com/api/v1/inspections \
  -H "Authorization: Bearer $AIL_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contentType":"website","url":"https://example.com/blog/post","crawlSameOrigin":false}'

Images, documents and code files use multipart form data:

curl -X POST https://aiinspectorlab.com/api/v1/inspections \
  -H "Authorization: Bearer $AIL_KEY" \
  -F contentType=document -F file=@report.pdf

The response is 202 Accepted with the inspection in pending state and a Location header.

Poll for results

curl https://aiinspectorlab.com/api/v1/inspections/ins_... -H "Authorization: Bearer $AIL_KEY"

{ "data": { "id": "ins_...", "status": "processing", "progress": 40, "stage": "Running detection model", ... } }

Poll every few seconds until status is completed or failed. Failed inspections include an error message; transient failures are retried automatically up to three times.

Reports

curl https://aiinspectorlab.com/api/v1/reports/ins_...                -H "Authorization: Bearer $AIL_KEY"   # JSON
curl https://aiinspectorlab.com/api/v1/reports/ins_...?format=pdf -o r.pdf -H "Authorization: Bearer $AIL_KEY"   # PDF

The JSON report contains likelihood (with status: available, unavailable, failed or mock), findings grouped by category, segments, files, metadata, provenance, engines and limitations. Treat score as null unless status is available.

Endpoints

POST/api/v1/inspectionsCreate an inspection
GET/api/v1/inspectionsList inspections (page, pageSize, contentType, status)
GET/api/v1/inspections/:idInspection status
DELETE/api/v1/inspections/:idDelete an inspection and its stored content
GET/api/v1/reports/:idReport as JSON or PDF
POST/api/v1/reports/:id/shareCreate an expiring share link
DELETE/api/v1/shares/:shareIdRevoke a share link
POST/api/v1/repositories/analyzeInspect a public GitHub repository
GET/api/v1/usageUsage for the current billing period
GET/api/v1/openapi.jsonOpenAPI 3.1 specification

Errors & limits

Errors return { "error": { "code", "message", "fields?" } } with an appropriate HTTP status. API keys are limited to 120 requests per minute and 20 new inspections per minute; responses include X-RateLimit-* headers and 429 responses include Retry-After. Monthly inspection quotas follow your plan.