gedx402 · docs

Managed RAG bundle

GEDX402 sells managed RAG instances as one discoverable family. Agents pay USDC via x402 — no API keys.

Discovery: GET https://gedx402.com/v1/models?bundle=managed-rag — five routes tagged managed-rag-bundle.

StepRouteShardMethod
RAG answer (hero)/v1/aisearch/outcome/answeraisearchPOST
Prepaid session (advanced)/v1/aisearch/sessionsaisearchPOST
Create instance/v1/aisearch/instancesaisearchPOST
Ingest/v1/aisearch/:id/indexaisearchPOST
Query/v1/aisearch/:id/queryaisearchPOST
MCP URL/v1/aisearch/:id/mcpaisearchGET (free)

Origin: rag.gedx402.com. Paid routes return 402 with x402 payment instructions until settled — except index/query when a valid session_token from /v1/aisearch/outcome/answer or /v1/aisearch/sessions has remaining credits.

Starter route: POST https://rag.gedx402.com/v1/aisearch/outcome/answer (starter:true in agents.json).

Hero page: https://gedx402.com/heroes/rag-answer


Integration flow (single-hop)

sequenceDiagram
  participant Agent
  participant Answer as POST /v1/aisearch/outcome/answer
  participant Query as POST /v1/aisearch/:id/query

  Agent->>Answer: url(s), question, budget?
  Note over Answer: one x402 payment
  Answer-->>Agent: cited answer, session_token, query_path, credits
  Agent->>Query: session_token header (no 402 while credits remain)
  Query-->>Agent: chunks[], credits remaining

1. RAG answer (recommended)

Single-hop cited answer — indexes URL(s), hybrid retrieval, synthesizes via chat/fast, and mints prepaid follow-up query credits:

POST https://rag.gedx402.com/v1/aisearch/outcome/answer
Content-Type: application/json

{
  "url": "https://example.com/docs",
  "question": "How do I configure managed RAG?",
  "budget": { "max_queries": 5 }
}

One x402 payment covers indexing, answer synthesis, and prepaid query credits. Response includes session_token, query_path, credits, and the cited natural-language answer.

Send session_token on follow-up query calls:

POST https://rag.gedx402.com/v1/aisearch/ged-abc123/query
X-AISearch-Session-Token: <session_token>
Content-Type: application/json

{ "query": "What are the rate limits?" }

Or pass session_token in the JSON body. No 402 until queries_remaining hits zero.

2. Prepaid session (advanced — multi-hop)

For agents that want separate create/index/query legs instead of the single-hop answer:

POST https://rag.gedx402.com/v1/aisearch/sessions
Content-Type: application/json

{
  "initial_index": { "url": "https://example.com/docs" },
  "query": "How do I configure managed RAG?",
  "budget": { "max_index_ops": 1, "max_queries": 1 }
}

Hero: GET https://gedx402.com/heroes/rag-session. Not in the default ?bundle=winners funnel.

3. Create instance (multi-hop)

POST https://rag.gedx402.com/v1/aisearch/instances
Content-Type: application/json

{}

Response includes instance_id, index_path, and query_path. Optional body field id sets a custom instance slug (lowercase, hyphens).

4. Index content

POST https://rag.gedx402.com/v1/aisearch/ged-abc123/index
Content-Type: application/json

{ "url": "https://example.com/docs" }

Also accepts text, file_base64, and filename. Set "poll": true to block until indexing completes.

5. Hybrid query

POST https://rag.gedx402.com/v1/aisearch/ged-abc123/query
Content-Type: application/json

{
  "query": "How do I configure managed RAG?",
  "top_k": 5,
  "retrieval_type": "hybrid"
}

Returns ranked chunks with scores and metadata. Optional rewrite_query and rerank flags.

GET /v1/aisearch/:id/mcp returns 410 and query_path.


Pricing and limits

See GET /v1/models?bundle=managed-rag for USDC wire settlement per leg.


Agent discovery