{"openapi":"3.1.0","info":{"title":"Agent AI Tools (MPP): chat, translate, embeddings, rerank","version":"1.0.0","description":"Pay-per-call AI primitives for agents: chat completions with small open models (Gemma 4 26B-A4B, Granite 4 Micro, gpt-oss-20b), machine translation (100 languages), multilingual embeddings and cross-encoder reranking. Open models with commercial-use licences (Apache-2.0, MIT). No account or API key: pay per call with MPP on Tempo (USDC.e or pathUSD). Invalid input, a failed model call or the daily capacity limit returns 402 and is not charged. Docs: https://mpp-ai.fmf-x402.workers.dev/docs — copy-paste examples for the mppx CLI, curl, the TypeScript SDK (mppx) and the Python SDK (pympp), plus an MCP config. Machine-readable: https://mpp-ai.fmf-x402.workers.dev/llms.txt and https://mpp-ai.fmf-x402.workers.dev/openapi.json. MCP (Streamable HTTP): https://mpp-ai.fmf-x402.workers.dev/mcp. Fleet of sister services: https://mpp-docs.fmf-x402.workers.dev, https://mpp-agent-data.fmf-x402.workers.dev, https://mpp-tools.fmf-x402.workers.dev, https://mpp-ai.fmf-x402.workers.dev, https://mpp-browser.fmf-x402.workers.dev, https://mpp-research.fmf-x402.workers.dev, https://controlplane-x402.fmf-x402.workers.dev. Models: Meta M2M-100 1.2B (MIT), BAAI bge-m3 and bge-reranker-base (MIT) on Cloudflare Workers AI.","x-guidance":"POST JSON (or GET with query params) to any /mpp/* route and pay the MPP 402 challenge on Tempo (USDC.e or pathUSD). Bad input or an upstream failure returns 402 with an error and you are not charged.","contact":{"url":"https://mpp-ai.fmf-x402.workers.dev/docs"},"x-docs":"https://mpp-ai.fmf-x402.workers.dev/docs","x-mcp":"https://mpp-ai.fmf-x402.workers.dev/mcp","x-llms":"https://mpp-ai.fmf-x402.workers.dev/llms.txt","x-fmf-id":"ai"},"servers":[{"url":"https://mpp-ai.fmf-x402.workers.dev"}],"paths":{"/mpp/chat":{"post":{"operationId":"chat","summary":"Chat completion (small open models)","description":"OpenAI-style chat with open-weight models on Cloudflare Workers AI: gemma-4-26b-a4b (default), granite-4-micro (fastest), gpt-oss-20b (all Apache-2.0). Send messages[] or a prompt; up to ~6k input tokens and 1,024 output tokens per call, flat price. Returns the reply, token usage and finish reason. Daily capacity is limited; when it is reached you get 402 and are not charged. Price $0.002 per call.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","description":"[{role: system|user|assistant, content}]"},"prompt":{"type":"string"},"system":{"type":"string"},"model":{"type":"string","enum":["gemma-4-26b","granite-4-micro","gpt-oss-20b"]},"max_tokens":{"type":"integer","description":"1-1024 (default 512)"},"temperature":{"type":"number","description":"0-2 (default 0.6)"},"reasoning":{"type":"boolean","description":"include the model reasoning text if it produces one (default false)"}}},"example":{"messages":[{"role":"system","content":"Answer in one sentence."},{"role":"user","content":"What is the Machine Payments Protocol?"}],"max_tokens":200}}}},"x-payment-info":{"protocols":[{"mpp":{"method":"tempo","intent":"charge","currency":"0x20C000000000000000000000b9537d11c60E8b50"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.002"}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"402":{"description":"Payment required (MPP, Tempo USDC.e or pathUSD); also returned with an error message, not charged, for invalid input"}}}},"/mpp/translate":{"post":{"operationId":"translate","summary":"Translate text (100 languages)","description":"Machine translation between 100 languages (Meta M2M-100 1.2B, MIT licence): one text up to 5,000 characters or up to 20 texts per call, source and target as ISO codes or names. Long text is split by sentence and reassembled. Price $0.003 per call.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","description":"text, up to 5,000 characters"},"texts":{"type":"array","items":{"type":"string"},"description":"or up to 20 texts (5,000 chars total)"},"target":{"type":"string","description":"target language code or name, e.g. fr"},"source":{"type":"string","description":"source language (default: en)"}},"required":["target"]},"example":{"text":"Pay per call, no API key needed.","target":"fr"}}}},"x-payment-info":{"protocols":[{"mpp":{"method":"tempo","intent":"charge","currency":"0x20C000000000000000000000b9537d11c60E8b50"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.003"}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"402":{"description":"Payment required (MPP, Tempo USDC.e or pathUSD); also returned with an error message, not charged, for invalid input"}}}},"/mpp/embeddings":{"post":{"operationId":"embeddings","summary":"Text embeddings (multilingual)","description":"Dense vector embeddings for up to 100 texts per call (BAAI bge-m3, 1024 dimensions, 100+ languages, MIT licence), L2-normalised for cosine similarity. OpenAI-style response (data[i].embedding). Price $0.0005 per call.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"texts":{"type":"array","items":{"type":"string"},"description":"up to 100 texts, 8,000 chars each"},"text":{"type":"string"},"normalize":{"type":"boolean","default":true}}},"example":{"texts":["machine payments","pay per call API"]}}}},"x-payment-info":{"protocols":[{"mpp":{"method":"tempo","intent":"charge","currency":"0x20C000000000000000000000b9537d11c60E8b50"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.0005"}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"402":{"description":"Payment required (MPP, Tempo USDC.e or pathUSD); also returned with an error message, not charged, for invalid input"}}}},"/mpp/rerank":{"post":{"operationId":"rerank","summary":"Rerank documents for a query","description":"Score and sort up to 100 documents by relevance to a query with a cross-encoder (BAAI bge-reranker-base, MIT licence). Returns index, relevance score (0-1) and text, best first; top_n to truncate. Ideal after search or embeddings retrieval. Price $0.001 per call.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"},"documents":{"type":"array","items":{"type":"string"},"description":"up to 100 documents, 4,000 chars each"},"top_n":{"type":"integer"}},"required":["query","documents"]},"example":{"query":"how do agents pay for APIs?","documents":["MPP lets agents pay per HTTP call.","Bananas are rich in potassium."]}}}},"x-payment-info":{"protocols":[{"mpp":{"method":"tempo","intent":"charge","currency":"0x20C000000000000000000000b9537d11c60E8b50"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.001"}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"402":{"description":"Payment required (MPP, Tempo USDC.e or pathUSD); also returned with an error message, not charged, for invalid input"}}}}},"externalDocs":{"description":"Copy-paste examples (CLI, curl, TypeScript, Python, MCP)","url":"https://mpp-ai.fmf-x402.workers.dev/docs"},"components":{"securitySchemes":{"Payment":{"type":"http","scheme":"Payment","description":"MPP Payment credential on Tempo (USDC.e or pathUSD). Clients such as mppx handle the 402 challenge automatically. See https://mpp.dev/sdk"}}},"tags":[{"name":"paid","description":"Pay-per-call MPP routes. Unpaid requests receive 402. Invalid input is not charged."},{"name":"discovery","description":"Free discovery surfaces: /docs, /llms.txt, /openapi.json, /mcp, /health."}]}