API Documentation // x402 Protocol
> TABLE_OF_CONTENTS
Overview Pricing Tiers Authentication & Payments AI Agents (JSON API) API Endpoints Response Format Error Handling

Overview

CHUNKER.CC is an AI-native document chunking API with micropayments on Solana. Upload documents and receive semantically chunked text optimized for RAG pipelines and LLM context windows.

API URL:
https://api.adepti.cc
NETWORK:
Solana Mainnet
PAYMENT:
USDC on Solana

Pricing.Matrix

FREE
$0
Recursive splitting
100 pages/day
STRUCTURE
$0.002
Code/table aware
MOST RAG APPS
SEMANTIC
$0.004
Embedding boundaries
Topic-aware
AI
$0.01
LLM boundaries
Claude Haiku
AI PRO
$0.025
LLM + enrichment
PRODUCTION RAG

Authentication

Free Tier

No authentication required. Simply POST your file to the endpoint. Limited to 100 pages/day.

Paid Tiers (Structure, Semantic, AI, AI Pro)

Requires USDC payment on Solana. Payment flow:

  1. Connect Phantom wallet to the web interface
  2. Send USDC to the payment address (automatic)
  3. Transaction signature is included in X-PAYMENT header
  4. Backend verifies payment on-chain before processing
PAYMENT HEADER FORMAT:

X-PAYMENT: <solana-transaction-signature>

The signature is the base58-encoded transaction ID returned by Phantom after signing the USDC transfer.

AI.Agents

Agent-friendly JSON endpoint. No multipart encoding - just send JSON with a document URL.

POST /chunk AGENT-FRIENDLY

JSON body endpoint for AI agents. Accepts URL to document, returns chunks.

Request Body (JSON)

{
  "url": "https://example.com/document.pdf",
  "tier": "semantic",
  "output_format": "pinecone"
}
Field Type Description
urlREQUIRED string URL to fetch document from (PDF, TXT, HTML, DOCX)
tierOPTIONAL string "free", "structure" (default), "semantic", "ai", or "ai-pro"
output_formatOPTIONAL string "raw", "pinecone", "weaviate", "chroma", "qdrant"

Example (Agent with Wallet)

# 1. Request without payment - get 402 with payment requirements
curl -X POST https://api.adepti.cc/chunk \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/doc.pdf", "tier": "semantic"}'

# Response: 402 with paymentRequirements

# 2. Pay USDC to the specified address, get transaction signature

# 3. Retry with payment
curl -X POST https://api.adepti.cc/chunk \
  -H "Content-Type: application/json" \
  -H "X-PAYMENT: 5K4t...signature..." \
  -d '{"url": "https://example.com/doc.pdf", "tier": "semantic"}'
GET /results/{result_id} FREE

Download results for large documents. When response has 100+ chunks, a download_url is returned instead of inline chunks.

# Large document response includes download_url
{
  "success": true,
  "total_chunks": 247,
  "download_url": "https://api.adepti.cc/results/standard_a1b2c3d4e5f6",
  "expires_in": "60 minutes"
}

# Fetch full results
curl https://api.adepti.cc/results/standard_a1b2c3d4e5f6
AGENT INTEGRATION PATTERN:

  1. Agent has Solana wallet with USDC
  2. POST to /chunk with JSON body
  3. Parse 402 response for payment requirements
  4. Sign and send USDC transfer to payTo address
  5. Retry with X-PAYMENT: {tx_signature} header
  6. For large docs, fetch download_url separately

API.Endpoints

GET / FREE

Returns API info, pricing, and configuration.

curl https://api.adepti.cc/
GET /health FREE

Health check endpoint for monitoring.

curl https://api.adepti.cc/health

// Response
{ "status": "healthy", "network": "solana-mainnet" }
POST /chunk/demo FREE

Basic recursive character chunking. Limited to 100 pages/day. Aliases: /chunk/free

Parameter Type Description
fileREQUIRED File Document to chunk (.txt, .pdf)
curl -X POST https://api.adepti.cc/chunk/demo \
  -F "[email protected]"

Response.Format

All chunking endpoints return the same response structure:

{
  "success": true,
  "tier": "standard",
  "total_chunks": 12,
  "metadata": {
    "filename": "document.txt",
    "content_type": "text/plain",
    "size_bytes": 15420,
    "estimated_pages": 3
  },
  "chunks": [
    {
      "text": "First chunk content...",
      "metadata": {
        "chunk_index": 0,
        "char_count": 1024
      }
    },
    {
      "text": "Second chunk content...",
      "metadata": {
        "chunk_index": 1,
        "char_count": 987
      }
    }
  ],
  "payment": {
    "amount": 1000,
    "asset": "USDC",
    "network": "solana-mainnet"
  }
}

Error.Handling

Code Status Description
200 Success Request processed successfully
400 Bad Request Invalid file format, encoding, or corrupted PDF
402 Payment Required Missing or invalid payment for paid tier
500 Server Error Internal processing error

402 Payment Required Response

{
  "error": "Payment Required",
  "paymentRequirements": {
    "x402Version": 1,
    "scheme": "exact",
    "network": "solana-mainnet",
    "maxAmountRequired": "4000",
    "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "payTo": "8hTm...dWT",
    "description": "Semantic tier embedding-based chunking"
  }
}