{"uid":"cap_n9OFU4e64deP1X09R3cxk","slug":"402utils-text-embedding-via-cloudflare-workers-ai-8eff4b4e","name":"402utils Text Embedding via Cloudflare Workers AI","description":"Text → vector embeddings via Cloudflare Workers AI. Send {text} or {texts[]} (≤20, each ≤4000 chars); returns one float vector per input. Default model @cf/baai/bge-m3 (1024-dim, multilingual). The model is named in the response — embeddings only compare within the same model. Completes the RAG chain: readability → chunk → embed, no OpenAI account. Cosine-compare the vectors yourself. Unavailable model/binding → 503, not billed.","url":"https://402utils.com/v1/embed","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string","description":"A single text to embed (≤ 4000 chars)."},"model":{"enum":["@cf/baai/bge-m3","@cf/baai/bge-base-en-v1.5","@cf/baai/bge-large-en-v1.5","@cf/baai/bge-small-en-v1.5"],"type":"string","default":"@cf/baai/bge-m3","description":"Embedding model. Default @cf/baai/bge-m3. en-v1.5 models are English-only, 512-token max."},"texts":{"type":"array","items":{"type":"string"},"maxItems":20,"description":"Up to 20 texts to embed in one call (each ≤ 4000 chars)."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.004","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":1,"rating":{"score":"0.75","successRate":"1.00","reviews":1,"stars":"4.0","state":"rated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_6iGmeTIU_-ayL6e0QGZKG","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts one or a batch of text strings into float vector embeddings using Cloudflare Workers AI BAAI models, for use in semantic search, RAG pipelines, and similarity comparisons.","exampleAgentPrompt":"Generate multilingual vector embeddings for these three text chunks using the @cf/baai/bge-m3 model: 'The weather is sunny today', 'Il fait beau aujourd'hui', and 'El tiempo está soleado hoy' — I need the 1024-dimensional float vectors so I can compare their semantic similarity with cosine distance.","exampleUseCases":null,"resultDescription":"Returns one float vector per input text (1024 dimensions for the default bge-m3 model, fewer for smaller models), along with the model name used. Multiple texts in a batch return a corresponding array of vectors. If the model or Cloudflare binding is unavailable, returns 503 and the call is not billed.","failureModes":["503 Service Unavailable if the requested model or Cloudflare Workers AI binding is unavailable (not billed)","Input text exceeds 4000 characters per string","Batch exceeds 20 texts","English-only en-v1.5 models receive non-English text (may degrade quality silently)","Payment failure returns 402 before processing"],"whenToPreferThis":"Use this endpoint when you need text embeddings without an OpenAI account, want multilingual support via bge-m3, are building a RAG pipeline on Cloudflare infrastructure, or need to batch-embed up to 20 chunks in a single paid call at $0.004 USDC. Prefer over OpenAI embeddings when you want a self-contained x402-payment flow or specifically need the BAAI bge model family.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":8,"lastUsedAt":"2026-07-17T21:34:38.016Z","lastSuccessfullyRanAt":"2026-07-17T21:34:38.016Z","lastHealthCheckAt":"2026-09-13T12:43:43.061Z","isFirstParty":false}