{"openapi": "3.1.0", "info": {"title": "MediaForge x402 — media and AI text endpoints for AI agents", "version": "1.4.4", "description": "Per-call API for AI agents: AI text tasks (summarize, rewrite, sentiment, keywords, classify, outline; a batch of 50 texts for 5 cents), text-to-speech, transcription, video clipping, dubbing, web fetch and Chromium screenshots. Paid in USDC on Base over x402 v2, no account or API key.", "x-guidance": "MediaForge is a pay-per-call media and AI-text API settled in USDC on Base mainnet over x402 v2. Call any POST endpoint with a JSON body and no payment first: you get HTTP 402 with a machine-readable challenge in the JSON body (accepts[0]: scheme=exact, network=eip155:8453, asset=USDC, amount in atomic units, payTo). Sign one EIP-3009 TransferWithAuthorization for exactly that amount and payTo, then replay the same request with the base64-encoded payment payload in the PAYMENT-SIGNATURE header (legacy X-PAYMENT is also accepted). A successful call returns HTTP 200 JSON: {ok, payment:{success, transaction, payer}, files:{... public URLs}, details:{...}, seconds}. No account, API key or subscription exists. The facilitator sponsors gas, so the payer only needs USDC. Free, unpaid endpoints: GET /healthz, GET / (JSON catalog), GET /demo.mp3, GET /openapi.json. AI text tasks: POST /v1/summarize, /v1/rewrite, /v1/sentiment, /v1/keywords, /v1/classify, /v1/outline and /v1/ai/batch (up to 50 texts per call). Typical latency: fetch 0.1-1 s, tts 1-3 s, screenshot 2-5 s, AI tasks 2-20 s (batch up to 4 min), transcribe/clip/dub 5-45 s depending on input length.", "contact": {"email": "hunter@hardoz.eu.cc", "url": "https://hardoz.eu.cc/x402"}}, "servers": [{"url": "https://hardoz.eu.cc/x402", "description": "Production (USDC on Base mainnet)"}], "tags": [{"name": "media", "description": "Pay-per-call media processing"}, {"name": "ai", "description": "AI text processing (NLP, LLM)"}, {"name": "data", "description": "Web data extraction"}], "x-discovery": {"ownershipProofs": ["0xb4674e0C8e18708Fc74835c0A23aFB3E0aFF384A"]}, "paths": {"/v1/tts": {"post": {"operationId": "tts", "summary": "Text to speech — MP3, 400+ voices", "description": "Text to speech: turn any text into an MP3 in 400+ neural voices and 40+ languages; for voiceovers; returns audio.", "tags": ["media", "tts", "text-to-speech"], "security": [], "x-payment-info": {"price": {"mode": "fixed", "currency": "USD", "amount": "0.008000"}, "protocols": [{"x402": {}}]}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"text": {"type": "string", "minLength": 1, "maxLength": 2000, "description": "Text to synthesize (plain text)"}, "voice": {"type": "string", "default": "en-US-AriaNeural", "description": "edge-tts voice id, e.g. en-US-AriaNeural, de-DE-KatjaNeural"}}, "required": ["text"]}}}}, "responses": {"200": {"description": "Work done and paid. JSON with files and payment receipt.", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}, "payment": {"type": "object"}, "files": {"type": "object"}, "details": {"type": "object"}, "seconds": {"type": "number"}}}}}}, "400": {"description": "Invalid JSON or invalid input"}, "402": {"description": "Payment Required — x402 v2 challenge in the JSON body (accepts[]) and PAYMENT-REQUIRED header"}}}}, "/v1/transcribe": {"post": {"operationId": "transcribe", "summary": "Transcribe audio/video URL to text with word-level segments", "description": "Speech to text: transcribe an audio or video URL into text with word timestamps; for captions; returns SRT-ready text.", "tags": ["media", "transcription", "speech-to-text"], "security": [], "x-payment-info": {"price": {"mode": "fixed", "currency": "USD", "amount": "0.010000"}, "protocols": [{"x402": {}}]}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"url": {"type": "string", "format": "uri", "description": "Public http(s) URL of an audio or video file"}}, "required": ["url"]}}}}, "responses": {"200": {"description": "Work done and paid. JSON with files and payment receipt.", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}, "payment": {"type": "object"}, "files": {"type": "object"}, "details": {"type": "object"}, "seconds": {"type": "number"}}}}}}, "400": {"description": "Invalid JSON or invalid input"}, "402": {"description": "Payment Required — x402 v2 challenge in the JSON body (accepts[]) and PAYMENT-REQUIRED header"}}}}, "/v1/clip": {"post": {"operationId": "clip", "summary": "Cut short vertical/square clips with burned-in subtitles", "description": "Video clipping: cut a long video into short vertical clips with burned-in subtitles; for TikTok and Shorts; returns MP4.", "tags": ["media", "video", "clips"], "security": [], "x-payment-info": {"price": {"mode": "fixed", "currency": "USD", "amount": "0.005000"}, "protocols": [{"x402": {}}]}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"url": {"type": "string", "format": "uri", "description": "Public http(s) video URL (6-600 s)"}, "clips": {"type": "integer", "minimum": 1, "maximum": 3, "default": 1}, "format": {"type": "string", "enum": ["vertical", "square", "landscape"], "default": "vertical"}}, "required": ["url"]}}}}, "responses": {"200": {"description": "Work done and paid. JSON with files and payment receipt.", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}, "payment": {"type": "object"}, "files": {"type": "object"}, "details": {"type": "object"}, "seconds": {"type": "number"}}}}}}, "400": {"description": "Invalid JSON or invalid input"}, "402": {"description": "Payment Required — x402 v2 challenge in the JSON body (accepts[]) and PAYMENT-REQUIRED header"}}}}, "/v1/dub": {"post": {"operationId": "dub", "summary": "Dub a video into another language, keep music, return SRT", "description": "Video dubbing: translate a video into another language and keep the music; for localization; returns MP4 plus SRT.", "tags": ["media", "video", "dubbing"], "security": [], "x-payment-info": {"price": {"mode": "fixed", "currency": "USD", "amount": "0.003000"}, "protocols": [{"x402": {}}]}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"url": {"type": "string", "format": "uri", "description": "Public http(s) video URL (<=90 s)"}, "lang": {"type": "string", "pattern": "^[a-z]{2}(-[A-Za-z]{2,4})?$", "default": "es", "description": "Target language code, e.g. es, de, fr, pt-BR"}, "voice": {"type": "string", "enum": ["female", "male"], "default": "female"}}, "required": ["url"]}}}}, "responses": {"200": {"description": "Work done and paid. JSON with files and payment receipt.", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}, "payment": {"type": "object"}, "files": {"type": "object"}, "details": {"type": "object"}, "seconds": {"type": "number"}}}}}}, "400": {"description": "Invalid JSON or invalid input"}, "402": {"description": "Payment Required — x402 v2 challenge in the JSON body (accepts[]) and PAYMENT-REQUIRED header"}}}}, "/v1/fetch": {"post": {"operationId": "fetch-page", "summary": "Fetch a public page → clean text, markdown or HTML", "description": "Web scraping: fetch any public page as clean text, markdown or JSON; for RAG and agents; returns the page body.", "tags": ["data", "web-scraping", "scraping"], "security": [], "x-payment-info": {"price": {"mode": "fixed", "currency": "USD", "amount": "0.005000"}, "protocols": [{"x402": {}}]}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"url": {"type": "string", "format": "uri", "description": "Public http(s) URL (private hosts blocked)"}, "format": {"type": "string", "enum": ["text", "markdown", "html"], "default": "text"}, "max_chars": {"type": "integer", "minimum": 1000, "maximum": 200000, "default": 20000}}, "required": ["url"]}}}}, "responses": {"200": {"description": "Work done and paid. JSON with files and payment receipt.", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}, "payment": {"type": "object"}, "files": {"type": "object"}, "details": {"type": "object"}, "seconds": {"type": "number"}}}}}}, "400": {"description": "Invalid JSON or invalid input"}, "402": {"description": "Payment Required — x402 v2 challenge in the JSON body (accepts[]) and PAYMENT-REQUIRED header"}}}}, "/v1/screenshot": {"post": {"operationId": "screenshot", "summary": "Render a page in a real Chromium → PNG", "description": "Screenshot: render any page in real headless Chromium; for previews and visual checks; returns a PNG.", "tags": ["media", "screenshot", "chromium"], "security": [], "x-payment-info": {"price": {"mode": "fixed", "currency": "USD", "amount": "0.010000"}, "protocols": [{"x402": {}}]}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"url": {"type": "string", "format": "uri", "description": "Public http(s) URL (private hosts blocked)"}, "width": {"type": "integer", "minimum": 320, "maximum": 1920, "default": 1280}, "height": {"type": "integer", "minimum": 240, "maximum": 2400, "default": 800}, "full_page": {"type": "boolean", "default": false}}, "required": ["url"]}}}}, "responses": {"200": {"description": "Work done and paid. JSON with files and payment receipt.", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}, "payment": {"type": "object"}, "files": {"type": "object"}, "details": {"type": "object"}, "seconds": {"type": "number"}}}}}}, "400": {"description": "Invalid JSON or invalid input"}, "402": {"description": "Payment Required — x402 v2 challenge in the JSON body (accepts[]) and PAYMENT-REQUIRED header"}}}}, "/v1/summarize": {"post": {"operationId": "summarize", "summary": "AI summarization API — condense long text into a short summary", "description": "Summarize: condense an article or transcript to N words; for digests and briefs; returns a summary string.", "tags": ["ai", "nlp", "llm"], "security": [], "x-payment-info": {"price": {"mode": "fixed", "currency": "USD", "amount": "0.002000"}, "protocols": [{"x402": {}}]}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"text": {"type": "string", "minLength": 1, "maxLength": 20000, "description": "Text to summarize"}, "max_words": {"type": "integer", "minimum": 20, "maximum": 400, "default": 120}}, "required": ["text"]}}}}, "responses": {"200": {"description": "Work done and paid. JSON with files and payment receipt.", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}, "payment": {"type": "object"}, "details": {"type": "object"}, "seconds": {"type": "number"}}}}}}, "400": {"description": "Invalid JSON or invalid input"}, "402": {"description": "Payment Required — x402 v2 challenge in the JSON body (accepts[]) and PAYMENT-REQUIRED header"}}}}, "/v1/rewrite": {"post": {"operationId": "rewrite", "summary": "AI paraphrasing API — rewrite or restyle text, keep the meaning", "description": "Rewrite: paraphrase text in a chosen style; for editing and tone shifts; returns the rewritten text.", "tags": ["ai", "nlp", "llm"], "security": [], "x-payment-info": {"price": {"mode": "fixed", "currency": "USD", "amount": "0.004000"}, "protocols": [{"x402": {}}]}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"text": {"type": "string", "minLength": 1, "maxLength": 20000, "description": "Text to rewrite"}, "style": {"type": "string", "maxLength": 40, "default": "clear and concise", "description": "Target style: concise, formal, casual, simple, …"}}, "required": ["text"]}}}}, "responses": {"200": {"description": "Work done and paid. JSON with files and payment receipt.", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}, "payment": {"type": "object"}, "details": {"type": "object"}, "seconds": {"type": "number"}}}}}}, "400": {"description": "Invalid JSON or invalid input"}, "402": {"description": "Payment Required — x402 v2 challenge in the JSON body (accepts[]) and PAYMENT-REQUIRED header"}}}}, "/v1/sentiment": {"post": {"operationId": "sentiment", "summary": "AI sentiment analysis — positive/neutral/negative + confidence (JSON)", "description": "Sentiment: label text positive, neutral or negative with confidence; for reviews and tickets; returns JSON.", "tags": ["ai", "nlp", "llm"], "security": [], "x-payment-info": {"price": {"mode": "fixed", "currency": "USD", "amount": "0.003000"}, "protocols": [{"x402": {}}]}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"text": {"type": "string", "minLength": 1, "maxLength": 20000, "description": "Text to analyze"}}, "required": ["text"]}}}}, "responses": {"200": {"description": "Work done and paid. JSON with files and payment receipt.", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}, "payment": {"type": "object"}, "details": {"type": "object"}, "seconds": {"type": "number"}}}}}}, "400": {"description": "Invalid JSON or invalid input"}, "402": {"description": "Payment Required — x402 v2 challenge in the JSON body (accepts[]) and PAYMENT-REQUIRED header"}}}}, "/v1/keywords": {"post": {"operationId": "keywords", "summary": "AI keyword extraction — ranked key phrases as JSON", "description": "Keywords: rank keywords and key phrases from text; for SEO and tagging; returns a JSON list.", "tags": ["ai", "nlp", "llm"], "security": [], "x-payment-info": {"price": {"mode": "fixed", "currency": "USD", "amount": "0.005000"}, "protocols": [{"x402": {}}]}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"text": {"type": "string", "minLength": 1, "maxLength": 20000, "description": "Text to extract keywords from"}, "limit": {"type": "integer", "minimum": 3, "maximum": 30, "default": 10}}, "required": ["text"]}}}}, "responses": {"200": {"description": "Work done and paid. JSON with files and payment receipt.", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}, "payment": {"type": "object"}, "details": {"type": "object"}, "seconds": {"type": "number"}}}}}}, "400": {"description": "Invalid JSON or invalid input"}, "402": {"description": "Payment Required — x402 v2 challenge in the JSON body (accepts[]) and PAYMENT-REQUIRED header"}}}}, "/v1/classify": {"post": {"operationId": "classify", "summary": "Text classification API — your own categories (topic/intent), confidence JSON", "description": "Classify: sort text into your own labels with confidence; for routing and moderation; returns JSON labels.", "tags": ["ai", "nlp", "llm"], "security": [], "x-payment-info": {"price": {"mode": "fixed", "currency": "USD", "amount": "0.005000"}, "protocols": [{"x402": {}}]}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"text": {"type": "string", "minLength": 1, "maxLength": 20000, "description": "Text to classify"}, "categories": {"type": "array", "minItems": 2, "maxItems": 30, "items": {"type": "string", "maxLength": 40}, "description": "Allowed labels; defaults to a generic topic set"}, "max_labels": {"type": "integer", "minimum": 1, "maximum": 5, "default": 3}}, "required": ["text"]}}}}, "responses": {"200": {"description": "Work done and paid. JSON with files and payment receipt.", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}, "payment": {"type": "object"}, "details": {"type": "object"}, "seconds": {"type": "number"}}}}}}, "400": {"description": "Invalid JSON or invalid input"}, "402": {"description": "Payment Required — x402 v2 challenge in the JSON body (accepts[]) and PAYMENT-REQUIRED header"}}}}, "/v1/outline": {"post": {"operationId": "outline", "summary": "AI outline generator — structured outline as JSON", "description": "Outline: build a structured outline of a document; for briefs and drafts; returns JSON headings.", "tags": ["ai", "nlp", "llm"], "security": [], "x-payment-info": {"price": {"mode": "fixed", "currency": "USD", "amount": "0.004000"}, "protocols": [{"x402": {}}]}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"text": {"type": "string", "minLength": 1, "maxLength": 20000, "description": "Text to outline"}, "style": {"type": "string", "enum": ["headings", "bullets"], "default": "headings"}}, "required": ["text"]}}}}, "responses": {"200": {"description": "Work done and paid. JSON with files and payment receipt.", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}, "payment": {"type": "object"}, "details": {"type": "object"}, "seconds": {"type": "number"}}}}}}, "400": {"description": "Invalid JSON or invalid input"}, "402": {"description": "Payment Required — x402 v2 challenge in the JSON body (accepts[]) and PAYMENT-REQUIRED header"}}}}, "/v1/ai/batch": {"post": {"operationId": "ai-batch", "summary": "Batch AI text API — 50 texts per call: summarize, rewrite, classify, sentiment", "description": "AI batch: run summarize, rewrite, sentiment, keywords, classify or outline on up to 50 texts; returns results in order.", "tags": ["ai", "nlp", "llm"], "security": [], "x-payment-info": {"price": {"mode": "fixed", "currency": "USD", "amount": "0.010000"}, "protocols": [{"x402": {}}]}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"task": {"type": "string", "enum": ["summarize", "rewrite", "sentiment", "keywords", "classify", "outline"], "default": "summarize", "description": "Task applied to every item"}, "items": {"type": "array", "minItems": 1, "maxItems": 50, "items": {"type": "string", "maxLength": 5000}, "description": "Texts to process; results come back in the same order"}, "max_words": {"type": "integer", "minimum": 20, "maximum": 400}, "limit": {"type": "integer", "minimum": 3, "maximum": 30}, "style": {"type": "string", "maxLength": 40}, "categories": {"type": "array", "minItems": 2, "maxItems": 30, "items": {"type": "string", "maxLength": 40}}, "max_labels": {"type": "integer", "minimum": 1, "maximum": 5}}, "required": ["items"]}}}}, "responses": {"200": {"description": "Work done and paid. JSON with files and payment receipt.", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}, "payment": {"type": "object"}, "details": {"type": "object"}, "seconds": {"type": "number"}}}}}}, "400": {"description": "Invalid JSON or invalid input"}, "402": {"description": "Payment Required — x402 v2 challenge in the JSON body (accepts[]) and PAYMENT-REQUIRED header"}}}}, "/v1/detect": {"post": {"operationId": "detect-ai-text", "summary": "Detect AI-written text — label + probability as JSON", "description": "AI-text detection: score whether text was written by a human or an AI; for moderation; returns label and probability.", "tags": ["ai", "nlp", "llm"], "security": [], "x-payment-info": {"price": {"mode": "fixed", "currency": "USD", "amount": "0.001000"}, "protocols": [{"x402": {}}]}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"text": {"type": "string", "minLength": 1, "maxLength": 20000, "description": "Text to score (human vs AI)"}}, "required": ["text"]}}}}, "responses": {"200": {"description": "Work done and paid. JSON with files and payment receipt.", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}, "payment": {"type": "object"}, "details": {"type": "object"}, "seconds": {"type": "number"}}}}}}, "400": {"description": "Invalid JSON or invalid input"}, "402": {"description": "Payment Required — x402 v2 challenge in the JSON body (accepts[]) and PAYMENT-REQUIRED header"}}}}, "/v1/tokenverdict": {"post": {"operationId": "token-verdict", "summary": "Grade a token A-F from live DEX metrics — score, verdict line, roast", "description": "Token verdict: grade any token A-F from live DEX liquidity, 24h volume, age and pair count; a trading-safety score plus a roast; for due diligence and memecoin checks; returns JSON.", "tags": ["crypto", "token", "token-verdict"], "security": [], "x-payment-info": {"price": {"mode": "fixed", "currency": "USD", "amount": "0.020000"}, "protocols": [{"x402": {}}]}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"tokenAddress": {"type": "string", "minLength": 20, "maxLength": 80, "description": "Contract address (EVM 0x…) or Solana mint"}, "chain": {"type": "string", "enum": ["base", "ethereum", "solana", "bsc", "arbitrum"], "default": "base", "description": "DEXScreener chain id"}, "format": {"type": "string", "enum": ["json", "html"], "default": "json", "description": "json (default) or a shareable HTML page"}}, "required": ["tokenAddress"]}}}}, "responses": {"200": {"description": "Work done and paid. JSON with files and payment receipt.", "content": {"application/json": {"schema": {"type": "object", "properties": {"ok": {"type": "boolean"}, "payment": {"type": "object"}, "details": {"type": "object"}, "seconds": {"type": "number"}}}}}}, "400": {"description": "Invalid JSON or invalid input"}, "402": {"description": "Payment Required — x402 v2 challenge in the JSON body (accepts[]) and PAYMENT-REQUIRED header"}}}}}}