Skip to content

API Overview

Base URL: https://api.adrail.ai

Authentication

All API requests (except registration and public endpoints) require authentication via API key.

Include your API key in the Authorization header:

bash
Authorization: Bearer pk_xxx  # Publisher key
Authorization: Bearer ak_xxx  # Advertiser key

Or use the X-API-Key header:

bash
X-API-Key: pk_xxx

API Keys

PrefixTypeCan Do
pk_PublisherReport impressions, settle payments
ak_AdvertiserCreate/fund escrows, request refunds

Endpoints

Public

MethodEndpointDescription
GET/API info
GET/healthHealth check
GET/v1/x402/infox402 payment config
POST/v1/publishers/registerRegister publisher
POST/v1/advertisers/registerRegister advertiser

Publishers (pk_*)

MethodEndpointDescription
GET/v1/publishers/meGet account info
GET/v1/publishers/me/statsGet earnings stats
GET/v1/publishers/me/paymentsPayment history
POST/v1/impressionsReport impressions
POST/v1/impressions/batchBatch report
GET/v1/impressionsList impressions
POST/v1/payments/settleSettle pending earnings
GET/v1/paymentsList payments
GET/v1/payments/pending/summaryPending earnings

Advertisers (ak_*)

MethodEndpointDescription
GET/v1/advertisers/meGet account info
GET/v1/advertisers/me/statsGet spending stats
GET/v1/advertisers/me/escrowsList escrows
POST/v1/escrowsCreate escrow
GET/v1/escrows/:idGet escrow
POST/v1/escrows/:id/fundConfirm funding
POST/v1/escrows/:id/activateActivate escrow
POST/v1/escrows/:id/refundRequest refund

Response Format

All responses are JSON:

json
{
  "id": "pub_abc123",
  "name": "My Publisher",
  "created_at": "2026-02-13T10:00:00Z"
}

Errors

Errors include a message and status code:

json
{
  "error": "Escrow not found",
  "status": 404
}
CodeDescription
400Bad request / validation error
401Missing or invalid API key
403Not authorized for this resource
404Resource not found
500Server error

Rate Limits

  • 100 requests/minute per API key
  • Batch endpoints count as 1 request

Pagination

List endpoints support pagination:

bash
GET /v1/impressions?limit=50&offset=100
ParamDefaultMaxDescription
limit20100Items per page
offset0-Skip N items

Built with x402 • USDC on Base