API Gateway Specifications

All backend requests require either a Bearer API Key header (Authorization: Bearer db_***) or an x402 payment header (x-transaction-signature: <solana_tx_hash>).

Ingestion Pipeline

POST/api/v1/ingest

Request Payload

{
  "url": "https://example.com/spec",
  "text": "Raw override content instead of scraping...",
  "is_private": true
}

Response Payload

{
  "result": "Ingested document d7a4e69b-8f3a into ArcadeDB. Created 12 claims, 4 entities, and mapped 8 relationships."
}

Context RAG Query

POST/api/v1/query

Request Payload

{
  "query": "What is the TSMC Taiwan fab risk?",
  "is_private": false
}

Response Payload

{
  "structured_result": {
    "log_id": "trace_9f2c8d4e_309b",
    "result": "[CLAIM] TSMC Taiwan fab faces power disruption risk...\n[MARKET PRICE ACTION] yfinance:2330.TW $580.00 (-1.2%)",
    "price_action": {
      "ticker": "2330.TW",
      "price": 580.00,
      "change_24h": -1.2,
      "volume": 3204000
    }
  }
}

Agent Autonomous Wallet Rotation

POST/api/v1/auth/agent/update

Header required: Authorization: Bearer db_***

Request Payload

{
  "new_wallet_address": "CvHizomsNzhxVteGRCzn...",
  "signature": "4Bstru8SWqsHHNdULoA9v2..."
}

Response Payload

{
  "status": "success",
  "message": "Successfully rotated agent wallet address.",
  "tenant_agent_id": "3c9f4a56-...",
  "old_wallet_address": "85jY8s...",
  "new_wallet_address": "CvHizo..."
}

Tenant Feedback Loop

POST/api/v1/feedback

Programmatically grades query usefulness, executing dynamic Cypher updates to modify node feedback_weight in ArcadeDB.

Request Payload

{
  "log_id": "trace_9f2c8d4e_309b",
  "score": 5
}

Response Payload

{
  "status": "success",
  "message": "Feedback recorded. programmatically adjusted ArcadeDB graph edge and entity weight variables."
}

Deep Intelligence Research Report

POST/api/v1/query/intelligence-report

Generates a senior analyst 10-section structured intelligence report (BLUF, Scope, Outlook, Gaps, etc.). Cost: 0.02 credits.

Request Payload

{
  "query": "Provide a comprehensive intelligence assessment on semiconductor supply disruptions",
  "is_private": false
}

Response Payload

{
  "structured_result": {
    "log_id": "report_8d3c_591a",
    "report": {
      "bluf": "Senior BLUF summary here...",
      "scope": "Geopolitical and physical limitations...",
      "context": "Historical trend analysis...",
      "key_findings": ["Fabs at capacity", "Geopolitical constraints"],
      "source_evaluation": "High confidence based on ArcadeDB consensus",
      "analysis": "Causal flow assessment...",
      "threats_risks": "Poisoning and latency concerns...",
      "alternative_scenarios": "Open-source fab emergence...",
      "outlook": "Slight stabilization Q4...",
      "intelligence_gaps": "Lack of direct on-the-ground telemetry..."
    }
  }
}