{"openapi":"3.1.0","info":{"title":"Retrieval","version":"1.0.0","description":"Text embeddings and reranking on Cloudal embeddings and rerank for semantic search andRAG.","contact":{"email":"support@payweave.app"},"x-guidance":"Text embeddings and reranking on Cloudal embeddings and rerank for semantic search andRAG.\nEach endpoint takes a JSON request and returns either a 200 with the result or a 402 Payment Required challenge (MPP / x402). Pricing is fixed per endpoint in USD; the per-operation `x-payment-info` block carries the exact challenge metadata (price, accepted protocols, payment realm).\nFor per-endpoint schemas, examples, and detailed usage, fetch https://api.payweave.app/app/app_olvhdxgjhov1h5q14cj2dn4x/skill.md or `<this-origin>/<path>/skill.md` for a single endpoint."},"x-service-info":{"categories":["Retrieval","RAG","Embeddings"]},"servers":[{"url":"https://retrieval.payweave.services"}],"paths":{"/embed":{"post":{"summary":"Retrieval: Text Embeddings","description":"Embed 1-100 texts into vectors using Cloudflare Workers AI BGE models (`bge-base` 768d default, `bge-large` 1024d, or multilingual `bge-m3` 1024d). Returns one vector per input text. Priced per text.","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.000200"},"protocols":[{"mpp":{"method":"tempo","intent":"charge","currency":"0x20c000000000000000000000b9537d11c60e8b50","network":"eip155:4217","amount":"200"}},{"mpp":{"method":"solana","intent":"charge","currency":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","amount":"200"}},{"x402":{"scheme":"exact","network":"eip155:8453","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amount":"200","extra":{"name":"USD Coin","version":"2"}}},{"x402":{"scheme":"exact","network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","currency":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","amount":"200"}}],"description":"Embed 1-100 texts into vectors using Cloudflare Workers AI BGE models (`bge-base` 768d default, `bge-large` 1024d, or multilingual `bge-m3` 1024d). Returns one vector per input text. Priced per text."},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"Workers AI model id used"},"dimensions":{"type":"integer","exclusiveMinimum":0,"description":"Length of each embedding vector"},"embeddings":{"type":"array","items":{"type":"array","items":{"type":"number"}},"description":"One embedding vector per input text, in the same order as `texts`"}},"required":["model","dimensions","embeddings"],"additionalProperties":false,"description":"Embedding vectors for the input texts"}}}},"402":{"description":"Payment Required"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"texts":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"minItems":1,"maxItems":100,"description":"Texts to embed, in order. 1-100 items, each up to 2000 characters. Priced per text."},"model":{"type":"string","enum":["bge-base","bge-large","bge-m3"],"description":"Embedding model: `bge-base` (768d, default), `bge-large` (1024d, higher quality), or `bge-m3` (1024d, multilingual). Defaults to `bge-base`."}},"required":["texts"],"additionalProperties":false}}}}}},"/rerank":{"post":{"summary":"Retrieval: Rerank","description":"Reorder up to 50 candidate documents by relevance to a query using Cloudflare Workers AI `@cf/baai/bge-reranker-base`. Returns documents with relevance scores, highest first. Pair with /embed to build a retrieve-then-rerank RAG pipeline.","x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.001000"},"protocols":[{"mpp":{"method":"tempo","intent":"charge","currency":"0x20c000000000000000000000b9537d11c60e8b50","network":"eip155:4217","amount":"1000"}},{"mpp":{"method":"solana","intent":"charge","currency":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","amount":"1000"}},{"x402":{"scheme":"exact","network":"eip155:8453","currency":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amount":"1000","extra":{"name":"USD Coin","version":"2"}}},{"x402":{"scheme":"exact","network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","currency":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","amount":"1000"}}],"description":"Reorder up to 50 candidate documents by relevance to a query using Cloudflare Workers AI `@cf/baai/bge-reranker-base`. Returns documents with relevance scores, highest first. Pair with /embed to build a retrieve-then-rerank RAG pipeline."},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"description":"Index into the input `documents` array"},"score":{"type":"number","description":"Relevance score; higher is more relevant"},"document":{"type":"string","description":"The document text at `index`"}},"required":["index","score","document"],"additionalProperties":false},"description":"Documents ordered by descending relevance score"}},"required":["results"],"additionalProperties":false,"description":"Reranked documents"}}}},"402":{"description":"Payment Required"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":2000,"description":"The search query. Up to 2000 characters."},"documents":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"minItems":1,"maxItems":50,"description":"Candidate documents to score against the query. 1-50 items, each up to 2000 characters."},"top_k":{"type":"integer","minimum":1,"maximum":50,"description":"Return only the top K highest-scoring documents. Defaults to all, ranked."}},"required":["query","documents"],"additionalProperties":false}}}}}}}}