Search a supplied text corpus
Rank supplied documents with fixed-parameter lexical BM25 and exact original UTF-16 token spans. Scores are binary64 logarithm approximations ordered at 12 decimal places, with exact ID ties. No embeddings, persistent index, web search or semantic relevance guarantee.
text · Operation ID: corpus-bm25-search
Choose this operation when
- Rank my supplied documents by lexical BM25
- Retrieve matching passages from caller-supplied text with exact token offsets
Outside this profile
- Web search, semantic/vector search, linguistic segmentation, relevance certification or verifying whether a passage supports a claim
- Network calls, external actions, supplied-evidence authenticity or factual correctness certification
Exact release references
Static JSON contract · Markdown reference · Fixed example response
Complete input schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"documents": {
"minItems": 1,
"maxItems": 128,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"text": {
"type": "string",
"maxLength": 20000
}
},
"required": [
"id",
"text"
],
"additionalProperties": false
}
},
"queries": {
"minItems": 1,
"maxItems": 16,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"text": {
"type": "string",
"maxLength": 1024
},
"topK": {
"type": "integer",
"minimum": 1,
"maximum": 20
}
},
"required": [
"id",
"text",
"topK"
],
"additionalProperties": false
}
}
},
"required": [
"documents",
"queries"
],
"additionalProperties": false
}
Complete output-envelope schema
{
"type": "object",
"required": [
"operation",
"version",
"result",
"provenance"
],
"properties": {
"operation": {
"const": "corpus-bm25-search",
"type": "string"
},
"version": {
"const": "0.29.0",
"type": "string"
},
"result": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"advisoryOnly": {
"type": "boolean",
"const": true
},
"externalRequests": {
"type": "number",
"const": 0
},
"profile": {
"type": "string",
"const": "supplied-unicode-word-bm25-v1"
},
"documentCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"tokenCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"queries": {
"maxItems": 16,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"status": {
"type": "string",
"enum": [
"ranked",
"empty-query"
]
},
"terms": {
"maxItems": 64,
"type": "array",
"items": {
"type": "string",
"maxLength": 512
}
},
"candidateCount": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"omittedCandidates": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"hits": {
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"sourceIndex": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"score": {
"type": "string",
"pattern": "^\\d+\\.\\d{12}$"
},
"matchedTerms": {
"maxItems": 64,
"type": "array",
"items": {
"type": "string",
"maxLength": 512
}
},
"spans": {
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"term": {
"type": "string",
"maxLength": 512
},
"start": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"end": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"term",
"start",
"end"
],
"additionalProperties": false
}
},
"omittedSpans": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"id",
"sourceIndex",
"score",
"matchedTerms",
"spans",
"omittedSpans"
],
"additionalProperties": false
}
}
},
"required": [
"id",
"status",
"terms",
"candidateCount",
"omittedCandidates",
"hits"
],
"additionalProperties": false
}
},
"semanticRelevanceVerified": {
"type": "boolean",
"const": false
},
"scoreArithmetic": {
"type": "string",
"const": "binary64-logarithm-approximation"
},
"scoreOrdering": {
"type": "string",
"const": "fixed-12-decimal-score-descending-then-UTF16-id"
},
"offsetUnits": {
"type": "string",
"const": "UTF-16 code units; zero-based, end-exclusive"
}
},
"required": [
"advisoryOnly",
"externalRequests",
"profile",
"documentCount",
"tokenCount",
"queries",
"semanticRelevanceVerified",
"scoreArithmetic",
"scoreOrdering",
"offsetUnits"
],
"additionalProperties": false
},
"provenance": {
"type": "object",
"required": [
"inputSha256",
"outputSha256",
"deterministic",
"externalRequests"
],
"properties": {
"inputSha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"outputSha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"deterministic": {
"const": true
},
"externalRequests": {
"const": 0
}
}
}
},
"additionalProperties": false
}
Fixed example
One accepted fixed example, not a custom-input trial. No operation runs when this static page is requested.
Example input
{
"documents": [
{
"id": "d1",
"text": "red fox"
},
{
"id": "d2",
"text": "blue dog"
}
],
"queries": [
{
"id": "q1",
"text": "red",
"topK": 2
}
]
}
Example response
{
"operation": "corpus-bm25-search",
"version": "0.29.0",
"result": {
"advisoryOnly": true,
"externalRequests": 0,
"profile": "supplied-unicode-word-bm25-v1",
"documentCount": 2,
"tokenCount": 4,
"queries": [
{
"id": "q1",
"status": "ranked",
"terms": [
"red"
],
"candidateCount": 1,
"omittedCandidates": 0,
"hits": [
{
"id": "d1",
"sourceIndex": 0,
"score": "0.693147180560",
"matchedTerms": [
"red"
],
"spans": [
{
"term": "red",
"start": 0,
"end": 3
}
],
"omittedSpans": 0
}
]
}
],
"semanticRelevanceVerified": false,
"scoreArithmetic": "binary64-logarithm-approximation",
"scoreOrdering": "fixed-12-decimal-score-descending-then-UTF16-id",
"offsetUnits": "UTF-16 code units; zero-based, end-exclusive"
},
"provenance": {
"inputSha256": "b0875c7142d0bbaaced040f155f697415bc61a604d6f69e4dda2ab57deae1de9",
"outputSha256": "39eac80fbdd9d2318a7ab087a0a3fe92145f6ddb0ebfa26619059e4e5ffaa7d2",
"deterministic": true,
"externalRequests": 0
}
}
Bounds and precision
JavaScript IEEE-754 numbers; use strings for large integer IDs/exact decimals where the schema accepts strings. No lossless numeric parsing.
{
"global": {
"requestBytes": 131072,
"responseBytes": 524288,
"jsonDepth": 32,
"jsonNodes": 20000,
"requestsPerMinute": 60,
"paidAttemptsPerMinute": 20,
"idempotencyHours": 24
},
"operation": {
"inputBytes": 100000,
"outputBytes": 400000,
"jsonNodes": 12000,
"depth": 20,
"documents": 128,
"queries": 16,
"corpusBytes": 60000,
"documentBytes": 20000,
"corpusTokens": 12000,
"corpusTerms": 4096,
"queryTerms": 64,
"queryCodePoints": 512,
"tokenCodePoints": 128,
"topK": 20,
"hitSpans": 20,
"contributionChecks": 131072
}
}
Complete schemas, descriptions and cross-field validation may impose additional limits.
Proposed price and protocol definitions
{
"unit": "one successful operation call",
"proposedNominalUsd": "0.005",
"sixDecimalTokenBaseUnits": "5000",
"subscription": false,
"includesPayerWalletOrNetworkFees": false,
"liveQuoteVerified": false,
"condition": "Actual SDK challenge is authoritative only within the caller's explicit authorization; configured six-decimal token peg is an operator assertion, not a conversion guarantee."
}
Protocol definitions: x402, mpp. MPP uses Tempo charge. Paid MCP execution is unsupported. All runtime readiness is not evaluated in this build.
API path templates, not endpoints on this documentation host
{
"x402": "/v1/x402/corpus-bm25-search",
"mpp": "/v1/mpp/corpus-bm25-search"
}
Required headers
{
"Content-Type": "application/json",
"Idempotency-Key": "random 16–128 character operation identifier"
}
Actual SDK challenge amount, asset, network, recipient and wallet costs must pass independent authorization. Preserve identical key, body, protocol and credential on retries; on PAYMENT_UNCERTAIN stop and reconcile.
Execution profile and provider conditions
{
"deterministic": true,
"externalRequests": 0,
"maxExternalRequests": 0,
"resultSnapshotPersisted": false,
"fixedExampleIsIllustrativeSnapshot": false,
"requiresPayment": true,
"supportsMcpExecution": false
}
Deterministic supplied-input operation with no external requests or stored request/result bodies. Payment infrastructure retains payment metadata and hashes.
Failure handling
- HTTP 400: Malformed JSON, missing/invalid idempotency key, or payment identifier mismatch Correct the request before payment
- HTTP 402: Payment challenge or rejected payment Use official protocol SDK; inspect payment outcome before another payment
- HTTP 409: Idempotency conflict, duplicate proof, or PAYMENT_UNCERTAIN Keep original key, body, and proof; reconcile uncertainty with operator; never blindly repay
- HTTP 413: Input or generated output too large Reduce input; no payment attempted for validation failure
- HTTP 415: Unsupported media type or compression Send uncompressed application/json
- HTTP 422: Schema or service-specific semantic validation failure Correct input using returned error code; no payment attempted
- HTTP 429: Request/payment-attempt rate exceeded Wait for rate limit window; preserve existing payment identity
- HTTP 503: Payment configuration/provider/state unavailable, or live DNS preparation failed before settlement Check readiness; DNS preparation failures may retry the identical key/body/credential only; uncertainty requires reconciliation
Declared requirements
Before any paid call, refresh the live operation contract and POST the complete bounded budgeted plan to the separate API's /preflight. Unknown requirements block selection; compatible preflight is not permission to spend.