FMF Tools AI: pay-per-call chat, translate, embeddings and rerank (no API key, MPP)

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.

No account and no API key. Pay per successful call with MPP on Tempo (USDC.e or pathUSD). Invalid input or an upstream failure returns 402 and is not charged.

Routes

RoutePriceWhat you get
POST /mpp/chat$0.002Chat 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.003Translate 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.0005Text 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.001Rerank 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.

Copy-paste examples

These call POST /mpp/embeddings ($0.0005) — Text embeddings (multilingual). Swap the path for any other route in the table.

mppx CLI

npx mppx https://mpp-ai.fmf-x402.workers.dev/mpp/embeddings -X POST -H 'content-type: application/json' -d '{"texts":["machine payments","pay per call API"]}'

The CLI creates or reuses a Tempo account in your keychain and pays the 402 automatically. See mpp.dev/sdk.

curl (unpaid — shows the 402, not charged)

curl -i -X POST https://mpp-ai.fmf-x402.workers.dev/mpp/embeddings -H 'content-type: application/json' -d '{"texts":["machine payments","pay per call API"]}'

TypeScript SDK (mppx)

import { Mppx, tempo } from 'mppx/client'
import { privateKeyToAccount } from 'viem/accounts'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount(process.env.TEMPO_PRIVATE_KEY) })],
})

// Global fetch now pays the 402 automatically.
const res = await fetch('https://mpp-ai.fmf-x402.workers.dev/mpp/embeddings', {
  method: 'POST',  headers: {
    'content-type': 'application/json',
  },
  body: JSON.stringify({"texts":["machine payments","pay per call API"]}),
})
console.log(await res.json())

Python SDK (pympp)

# pip install pympp
# Docs: https://mpp.dev/sdk/python
import asyncio
from mpp.client import Mpp
from mpp.methods.tempo import TempoAccount
from mpp.methods.tempo import client as tempo

account = TempoAccount.from_key("0x...")

async def main():
    async with Mpp(methods=[tempo.charge(account=account)]) as mpp:
        response = await mpp.fetch("https://mpp-ai.fmf-x402.workers.dev/mpp/embeddings", method="POST", json={"texts":["machine payments","pay per call API"]})
        print(await response.json())

asyncio.run(main())

MCP config (Cursor, Claude Desktop, VS Code)

{
  "mcpServers": {
    "fmf-mpp-ai": {
      "url": "https://mpp-ai.fmf-x402.workers.dev/mcp"
    }
  }
}

Transport is Streamable HTTP at https://mpp-ai.fmf-x402.workers.dev/mcp. tools/list is free. Paid tools/call needs an MPP Payment header, or just use mppx against the HTTP route.

Sources and licences

Models: Meta M2M-100 1.2B (MIT), BAAI bge-m3 and bge-reranker-base (MIT) on Cloudflare Workers AI.

Sister services