Endpoints
Initial API endpoint shape for search and scrape workflows.
Endpoint names may evolve with the public API surface. Keep client wrappers small so changes are easy to absorb.
Search
POST /v1/searchUse for natural language questions that need cited answers from the live web.
curl --fail-with-body https://api-onchain.optimai.network/v1/search \
-H "X-API-Key: $OPTIMAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "What is the current state of AI search infrastructure?",
"limit": 5
}'Expected response fields:
| Field | Meaning |
|---|---|
answer | Cited answer text. |
sources | Source list used by the answer. |
metadata | Request timing, tracking, and node context when available. |
Scrape
POST /v1/scrapeUse for extracting one known public URL.
curl --fail-with-body https://api-onchain.optimai.network/v1/scrape \
-H "X-API-Key: $OPTIMAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com"
}'Expected response fields:
| Field | Meaning |
|---|---|
content | Clean text extracted from the page. |
metadata | Fetch timing, final URL, and retrieval context when available. |
Planned
POST /v1/url-seeding
POST /v1/crawlURL Seeding and Crawl are planned surfaces. Treat them as roadmap placeholders until the API is confirmed.