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 and English embeddings (bge-m3, bge-small/base/large, qwen3-embedding), cross-encoder reranking, semantic similarity, zero-shot classification, sentiment, summarization, language detection, keyword extraction and PII/secret redaction. Most routes $0.0005, each with a free ?sample=1. 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.
Full docs with copy-paste examples (mppx CLI, curl, TypeScript, Python, MCP).
| Route | Price | What you get |
|---|---|---|
POST /mpp/chat | $0.002 | Chat completion (small open models) 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. |
POST /mpp/translate | $0.003 | Translate text (100 languages) 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. |
POST /mpp/embeddings | $0.0005 | Text embeddings (multilingual) 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). |
POST /mpp/rerank | $0.001 | Rerank documents for a query 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. |
POST /mpp/embeddings/bge-small | $0.0005 | Text embeddings: bge-small-en-v1.5 (384 dimensions) Dense vector embeddings with bge-small-en-v1.5 (384 dimensions, MIT) on Cloudflare Workers AI, English, fastest. Up to 32 texts per call, L2-normalised for cosine similarity. OpenAI-style response (data[i].embedding). Free sample: add ?sample=1. |
POST /mpp/embeddings/bge-base | $0.0005 | Text embeddings: bge-base-en-v1.5 (768 dimensions) Dense vector embeddings with bge-base-en-v1.5 (768 dimensions, MIT) on Cloudflare Workers AI, English. Up to 32 texts per call, L2-normalised for cosine similarity. OpenAI-style response (data[i].embedding). Free sample: add ?sample=1. |
POST /mpp/embeddings/bge-large | $0.0005 | Text embeddings: bge-large-en-v1.5 (1024 dimensions) Dense vector embeddings with bge-large-en-v1.5 (1024 dimensions, MIT) on Cloudflare Workers AI, English, highest quality of the BGE English models. Up to 32 texts per call, L2-normalised for cosine similarity. OpenAI-style response (data[i].embedding). Free sample: add ?sample=1. |
POST /mpp/embeddings/qwen3 | $0.0005 | Text embeddings: qwen3-embedding-0.6b (1024 dimensions) Dense vector embeddings with qwen3-embedding-0.6b (1024 dimensions, Apache-2.0) on Cloudflare Workers AI, 100+ languages. Up to 32 texts per call, L2-normalised for cosine similarity. OpenAI-style response (data[i].embedding). Free sample: add ?sample=1. |
POST /mpp/similarity | $0.0005 | Semantic similarity: score texts against a query Cosine similarity between a query and up to 32 candidate texts using BAAI bge-m3 multilingual embeddings (MIT). Returns each candidate with a similarity score (-1..1), best first. One call instead of embedding + maths. Free sample: add ?sample=1. |
POST /mpp/classify | $0.0005 | Zero-shot text classification (your labels) Classify a text into your own labels with no training, by embedding similarity (BAAI bge-m3, multilingual, MIT). Returns labels ranked with a softmax probability and raw cosine score. Fast and cheap; for fine-grained or adversarial tasks use the chat route. Free sample: add ?sample=1. |
POST /mpp/sentiment | $0.0005 | Sentiment analysis (positive / negative) Binary sentiment (POSITIVE / NEGATIVE with confidence) for up to 25 texts per call, using DistilBERT SST-2 (Apache-2.0) on Cloudflare Workers AI. English works best. Free sample: add ?sample=1. |
POST /mpp/summarize | $0.001 | Summarize text (bullet or paragraph) Abstractive summary of up to 16,000 characters as a paragraph, bullets or a one-line TL;DR, with IBM Granite 4 Micro (Apache-2.0) on Cloudflare Workers AI. Flat price. Free sample: add ?sample=1. |
POST /mpp/language/detect | $0.0005 | Language detection (80+ languages) Detect the language of up to 100 texts per call (franc trigram model, 80+ languages, MIT). Returns the ISO 639-1 code where one exists, the ISO 639-3 code, the score margin over the runner-up and ranked candidates (relative scores, best = 1). Short texts (<20 chars) are flagged as low confidence. No model call, instant. Free sample: add ?sample=1. |
POST /mpp/keywords | $0.0005 | Keyword and key-phrase extraction Extract ranked key phrases (RAKE-style co-occurrence scoring with stopword splitting) from up to 50,000 characters. Returns phrase, score and count. Deterministic, instant, no model call. English stopwords; works on most Latin-script text. Free sample: add ?sample=1. |
POST /mpp/pii/detect | $0.0005 | Detect and redact PII and secrets in text Find emails, phone numbers, credit card numbers (Luhn-checked), IBANs, US SSNs, IPv4/IPv6, Ethereum addresses, API keys (Stripe, AWS, GitHub, Slack) and token-bearing URLs in text, with offsets, and return a redacted copy. Pattern based, deterministic, nothing stored or logged (only counts). Free sample: add ?sample=1. |
POST /mpp/pro/embeddings | $0.001 | Text embeddings (multilingual) (listed tier) 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). Listed tier: same output as /mpp/embeddings ($0.0005); $0.001 per call, x402 settled via the Coinbase CDP facilitator. |
POST /mpp/pro/embeddings/bge-small | $0.001 | Text embeddings: bge-small-en-v1.5 (384 dimensions) (listed tier) Dense vector embeddings with bge-small-en-v1.5 (384 dimensions, MIT) on Cloudflare Workers AI, English, fastest. Up to 32 texts per call, L2-normalised for cosine similarity. OpenAI-style response (data[i].embedding). Listed tier: same output as /mpp/embeddings/bge-small ($0.0005); $0.001 per call, x402 settled via the Coinbase CDP facilitator. |
POST /mpp/pro/embeddings/bge-base | $0.001 | Text embeddings: bge-base-en-v1.5 (768 dimensions) (listed tier) Dense vector embeddings with bge-base-en-v1.5 (768 dimensions, MIT) on Cloudflare Workers AI, English. Up to 32 texts per call, L2-normalised for cosine similarity. OpenAI-style response (data[i].embedding). Listed tier: same output as /mpp/embeddings/bge-base ($0.0005); $0.001 per call, x402 settled via the Coinbase CDP facilitator. |
POST /mpp/pro/embeddings/bge-large | $0.001 | Text embeddings: bge-large-en-v1.5 (1024 dimensions) (listed tier) Dense vector embeddings with bge-large-en-v1.5 (1024 dimensions, MIT) on Cloudflare Workers AI, English, highest quality of the BGE English models. Up to 32 texts per call, L2-normalised for cosine similarity. OpenAI-style response (data[i].embedding). Listed tier: same output as /mpp/embeddings/bge-large ($0.0005); $0.001 per call, x402 settled via the Coinbase CDP facilitator. |
POST /mpp/pro/sentiment | $0.001 | Sentiment analysis (positive / negative) (listed tier) Binary sentiment (POSITIVE / NEGATIVE with confidence) for up to 25 texts per call, using DistilBERT SST-2 (Apache-2.0) on Cloudflare Workers AI. English works best. Listed tier: same output as /mpp/sentiment ($0.0005); $0.001 per call, x402 settled via the Coinbase CDP facilitator. |
POST /mpp/pro/keywords | $0.001 | Keyword and key-phrase extraction (listed tier) Extract ranked key phrases (RAKE-style co-occurrence scoring with stopword splitting) from up to 50,000 characters. Returns phrase, score and count. Deterministic, instant, no model call. English stopwords; works on most Latin-script text. Listed tier: same output as /mpp/keywords ($0.0005); $0.001 per call, x402 settled via the Coinbase CDP facilitator. |
POST /mpp/pro/pii/detect | $0.001 | Detect and redact PII and secrets in text (listed tier) Find emails, phone numbers, credit card numbers (Luhn-checked), IBANs, US SSNs, IPv4/IPv6, Ethereum addresses, API keys (Stripe, AWS, GitHub, Slack) and token-bearing URLs in text, with offsets, and return a redacted copy. Pattern based, deterministic, nothing stored or logged (only counts). Listed tier: same output as /mpp/pii/detect ($0.0005); $0.001 per call, x402 settled via the Coinbase CDP facilitator. |
Models: Meta M2M-100 1.2B (MIT), BAAI bge-m3, bge-small/base/large-en-v1.5 and bge-reranker-base (MIT), Qwen3-Embedding-0.6B (Apache-2.0), DistilBERT SST-2 (Apache-2.0), IBM Granite 4 Micro (Apache-2.0) on Cloudflare Workers AI; franc-min language detection (MIT).