API Reference
Overview

API Reference

Overview

The Customer API is a unified service that combines all customer-facing endpoints with:

  • API key authentication
  • Rate limiting based on subscription plans
  • Three search endpoints: suggest (path-based), semantic-search (query-based), and retrieve (RAG retrieval)

Important: All API endpoints must be called from your server, never from the browser. Your API keys must remain private on your server. The typical architecture is:

Browser → Your Application Server → deadend.ai API

Base URL

https://api.deadend.ai/v1

Authentication

All protected endpoints require API key authentication via Bearer token:

Authorization: Bearer <your-api-key>

See the Authentication Guide for details on obtaining and using API keys.

Rate Limits

Rate limits use a Token Bucket algorithm that allows short bursts above the sustained limit, perfect for ingestion scripts or traffic spikes. Limits are enforced per project based on subscription plan.

Write Limits (Upsert, Delete)

Write endpoints include /v1/pages/upsert and /v1/pages/delete.

PlanSustained LimitBurst Limit
Hacker (Free)5 req/sec10 req/sec
Solo ($9/mo)10 req/sec20 req/sec
Startup ($29/mo)25 req/sec50 req/sec
Scale ($99/mo)50 req/sec100 req/sec

Read Limits (Search, Events)

Read endpoints include /v1/suggest, /v1/semantic-search, /v1/retrieve, and /v1/events.

PlanSustained LimitBurst Limit
Hacker (Free)2 req/sec5 req/sec
Solo ($9/mo)10 req/sec20 req/sec
Startup ($29/mo)25 req/sec50 req/sec
Scale ($99/mo)50 req/sec100 req/sec

How Token Bucket Works: The sustained limit is your average rate over time. The burst limit allows you to exceed the sustained rate for short periods (e.g., during initial content sync or traffic spikes). If you sustain requests above the sustained limit, you'll be throttled back down.

Error Response Format

All errors follow a standardized format:

{
  "error": {
    "code": "error_code",
    "message": "Human-readable error message",
    "param": "parameter_name",
    "details": {}
  }
}

See the Error Handling Guide for detailed error codes and examples.

Endpoints

Search Endpoints

Page Management Endpoints

Events Endpoints

Quick Examples

Suggest Endpoint

curl -X POST https://api.deadend.ai/v1/suggest \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "/products/blue-widget",
    "limit": 3
  }'

Semantic Search Endpoint

curl -X POST https://api.deadend.ai/v1/semantic-search \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "blue widget products",
    "limit": 3
  }'

Retrieve Endpoint (RAG)

curl -X POST https://api.deadend.ai/v1/retrieve \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "What is the return policy?",
    "top_k": 3
  }'

Upsert Page

curl -X POST https://api.deadend.ai/v1/pages/upsert \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/product/blue-widget",
    "title": "Blue Widget - Premium Quality",
    "content": "This is a premium blue widget...",
    "metadata": {
      "price": 29.99,
      "category": "Widgets"
    }
  }'

Next Steps