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.networkRequest format
Use JSON request bodies and API key authentication.
X-API-Key: $OPTIMAI_API_KEY
Content-Type: application/jsonSearch 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.
| Field | Meaning |
|---|---|
answer | Cited answer from the live web. |
sources | Source URLs and labels. |
content | Clean page content for scrape requests. |
metadata | Request timing, tracking ID, and node context. |
Production handling
- Treat
4xxresponses as request or credential issues. - Treat
429and5xxresponses as retryable only with bounded backoff. - Log request IDs or tracking fields from
metadatawhen present. - Keep API keys server-side; browser clients should call your backend.