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.

POST /v1/search

Use 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:

FieldMeaning
answerCited answer text.
sourcesSource list used by the answer.
metadataRequest timing, tracking, and node context when available.

Scrape

POST /v1/scrape

Use 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:

FieldMeaning
contentClean text extracted from the page.
metadataFetch timing, final URL, and retrieval context when available.

Planned

POST /v1/url-seeding
POST /v1/crawl

URL Seeding and Crawl are planned surfaces. Treat them as roadmap placeholders until the API is confirmed.