# Text embeddings API A 1,024-dimension embedding vector for up to 4,000 characters of text in 100+ languages, from BAAI's BGE-M3. Use for semantic search, RAG retrieval, clustering and deduplication. ## When an agent wants this - Semantic search, RAG retrieval, clustering and deduplication - Embed up to 4,000 characters in 100+ languages - Use the same call through the OpenAI-compatible /v1/embeddings ## OpenAI compatible embeddings: BGE-M3, 1,024 dimensions OpenAI compatible embeddings: BGE-M3, 1,024 dimensions. $0.01 per successful call; failed calls are never charged. A 1,024-dimension embedding vector for up to 4,000 characters of text in 100+ languages, from BAAI's BGE-M3. Use for semantic search, RAG retrieval, clustering and deduplication. Inputs: text (required): Text to embed, up to 4,000 characters. Free first (25 successful calls per caller, no key): curl "https://tools.funwords.eu/ai/embed?text=pay-per-call%20APIs%20for%20AI%20agents&trial=1" With a card key from https://tools.funwords.eu/credits, in a header or, when your client can only fetch a URL, in the URL: curl -H "Authorization: Bearer adt_…" "https://tools.funwords.eu/ai/embed?text=pay-per-call%20APIs%20for%20AI%20agents" curl "https://tools.funwords.eu/ai/embed?text=pay-per-call%20APIs%20for%20AI%20agents&api_key=adt_…" Without a key the same URL answers 402 with x402 and MPP terms, so a wallet client pays USDC per call and retries. Over MCP (https://tools.funwords.eu/mcp) this tool is ai_embed. Example result: { "dimensions": 1024, "embedding": [ 0.0123, -0.0456, 0.0789 ], "model": "@cf/baai/bge-m3" } Tool page: https://tools.funwords.eu/tools/ai-embed ## Rerank documents by relevance: reranker for RAG Rerank documents by relevance: reranker for RAG. $0.002 per successful call; failed calls are never charged. Order up to 50 documents by how well each answers a query, with a relevance score from 0 to 1 (BAAI bge-reranker-base, a cross-encoder). Send documents as a JSON array or one per line; each is read up to 2,000 characters, 40,000 in all. Returns the original index, score and text, best first; top_n keeps only the best. Also available in the Cohere-style shape at /v1/rerank. Use to pick what a model reads after search or vector retrieval. Inputs: query (required): What the documents should answer (up to 2,000 characters); documents (required): Up to 50 documents: a JSON array of strings, or one per line; top_n: Keep only the best N results (default all). Free first (25 successful calls per caller, no key): curl "https://tools.funwords.eu/ai/rerank?query=What%20is%20the%20capital%20of%20France%3F&documents=%5B%22France%20has%20hundreds%20of%20cheeses.%22%2C%22Berlin%20is%20the%20capital%20of%20Germany.%22%2C%22Paris%20is%20the%20capital%20and%20largest%20city%20of%20France.%22%5D&trial=1" With a card key from https://tools.funwords.eu/credits, in a header or, when your client can only fetch a URL, in the URL: curl -H "Authorization: Bearer adt_…" "https://tools.funwords.eu/ai/rerank?query=What%20is%20the%20capital%20of%20France%3F&documents=%5B%22France%20has%20hundreds%20of%20cheeses.%22%2C%22Berlin%20is%20the%20capital%20of%20Germany.%22%2C%22Paris%20is%20the%20capital%20and%20largest%20city%20of%20France.%22%5D" curl "https://tools.funwords.eu/ai/rerank?query=What%20is%20the%20capital%20of%20France%3F&documents=%5B%22France%20has%20hundreds%20of%20cheeses.%22%2C%22Berlin%20is%20the%20capital%20of%20Germany.%22%2C%22Paris%20is%20the%20capital%20and%20largest%20city%20of%20France.%22%5D&api_key=adt_…" Without a key the same URL answers 402 with x402 and MPP terms, so a wallet client pays USDC per call and retries. Over MCP (https://tools.funwords.eu/mcp) this tool is ai_rerank. Example result: { "query": "What is the capital of France?", "results": [ { "index": 2, "relevance_score": 0.999785, "document": "Paris is the capital and largest city of France." }, { "index": 1, "relevance_score": 0.025102, "document": "Berlin is the capital of Germany." } ], "documents": 3, "clippedDocuments": 0, "model": "@cf/baai/bge-reranker-base" } Tool page: https://tools.funwords.eu/tools/ai-rerank ## Questions Docs for agents: https://tools.funwords.eu/llms.txt · OpenAPI: https://tools.funwords.eu/openapi.json · All guides: https://tools.funwords.eu/guides