API Overview

Base URLs, request style, and response expectations for decentralized live web search.

The API is designed for decentralized live web retrieval. Keep your client wrapper small: one base URL, one auth header, and explicit handling for non-2xx responses.

Base URL

https://api-onchain.optimai.network

Request format

Use JSON request bodies and API key authentication.

X-API-Key: $OPTIMAI_API_KEY
Content-Type: application/json

Search request

POST /v1/search
{
  "query": "What changed in AI search infrastructure this week?",
  "limit": 5
}

Response shape

Responses should be machine-readable and easy to render in a product UI.

FieldMeaning
answerCited answer from the live web.
sourcesSource URLs and labels.
contentClean page content for scrape requests.
metadataRequest timing, tracking ID, and node context.

Production handling

  • Treat 4xx responses as request or credential issues.
  • Treat 429 and 5xx responses as retryable only with bounded backoff.
  • Log request IDs or tracking fields from metadata when present.
  • Keep API keys server-side; browser clients should call your backend.