{"uid":"cap_3HPxMOWuBruH_9lI8ds71","slug":"keyronne-text-similarity-clustering-3536e46f","name":"Keyronne Text Similarity & Clustering","description":"Compute pairwise text similarity, find near-duplicates, and cluster a batch of texts (2–300 items). Character n-gram cosine similarity: language-agnostic, robust to small edits, no model calls. Returns similar pairs above a threshold, connected-component clusters, and the full matrix for small batches. POST a JSON body like: {\"texts\":[\"hello world\",\"hello world!\",\"unrelated\"],\"threshold\":0.8}","url":"https://keyronne.com/api/similarity","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"ngram":{"type":"integer","default":3,"maximum":5,"minimum":2,"description":"Character n-gram size."},"texts":{"type":"array","items":{"type":"string"},"maxItems":300,"minItems":2,"description":"Texts to compare (each up to 20,000 characters)."},"threshold":{"type":"number","default":0.8,"maximum":1,"minimum":0,"description":"Similarity threshold for pairs and clustering."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_PJgNJ1Q5Qr_A2jOkSDpAx","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes pairwise character n-gram cosine similarity across a batch of 2–300 texts, returning similar pairs above a threshold, connected-component clusters, and a full similarity matrix.","exampleAgentPrompt":"I have these 5 product titles and want to know which ones are near-duplicates — can you group them using character n-gram similarity with a threshold of 0.85? Titles: 'Apple iPhone 15', 'Apple iPhone 15 Pro', 'iPhone 15 by Apple', 'Samsung Galaxy S24', 'Galaxy S24 Samsung'.","exampleUseCases":null,"resultDescription":"Returns an object containing: a list of similar pairs (indices and similarity scores above the threshold), connected-component clusters (groups of mutually similar texts), and for small batches the full N×N cosine similarity matrix.","failureModes":["Fewer than 2 texts provided — returns validation error","More than 300 texts provided — exceeds maxItems limit","Individual text exceeds 20,000 characters — may be rejected or truncated","Threshold outside 0–1 range — validation error","Non-string items in texts array — schema validation failure","Network timeout for very large batches near the 300-item limit"],"whenToPreferThis":"Choose this endpoint when you need fast, language-agnostic similarity computation without invoking an embedding model or LLM. Ideal for deduplication, fuzzy matching, and clustering tasks where character-level similarity (robust to minor edits, typos, and formatting differences) is sufficient. Especially useful for multilingual text or when low latency and deterministic results are required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:53:11.929Z","isFirstParty":false}