# XiaoKe API Gateway: PDF OCR Scrape Translate Review SummarizeXiaoKe API Gateway

> Source: <https://github.com/y9695430-lang/xiaoke-api-gateway>
> Published: 2026-06-27 12:00:00+00:00

7 micro-APIs for AI agents. Pay via x402/USDC. Zero auth. Zero KYC.

AI agents discover, pay, and call autonomously — no human in the loop.

| Endpoint | Price | Description |
|---|---|---|
`POST /pdf` |
$0.01 | PDF → structured JSON with table extraction |
`POST /scrape` |
$0.02 | Any URL → clean Markdown |
`POST /ocr` |
$0.015 | Image → text (Apple Vision OCR) |
`POST /review` |
$0.03 | Code review → security & quality report |
`POST /translate` |
$0.01 | Translate between 20+ languages |
`POST /summarize` |
$0.01 | Long text → key sentences (extractive) |
`POST /md2html` |
$0.005 | Markdown → styled HTML (GitHub/Dark/Minimal) |

```
AI Agent → POST /scrape → 402 Payment Required
AI Agent → Pays USDC on Base → Retries with X-x402-Payment header
AI Agent → Gets result ✅
```

**Framework**: FastAPI (Python)** PDF**: pdfplumber** Scraping**: requests + BeautifulSoup4** OCR**: Apple Vision (macOS) / PIL fallback** Payments**: x402 protocol (USDC on Base)** Deploy**: Railway / Render / any Docker host

```
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8765
```

Then visit `http://localhost:8765/docs`

for interactive Swagger docs.

`https://xiaoke-pdf-api.loca.lt`

— Try `GET /pricing`

or see x402 in action with `POST /scrape`

MIT — build your own, list on AgenticTrade, keep 100% revenue.
