{"uid":"cap_6kzJ-wQHTcYdRz9mn6Nv8","slug":"delx-commerce-choice-index-seeded-random-selection-a5a29c66","name":"Delx Commerce — Choice Index (Seeded Random Selection)","description":"Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.","url":"https://commerce.delx.ai/api/v1/x402/choice-index?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"seed":{"type":"string","description":"Input field: seed."},"length":{"type":"integer","description":"Input field: length."}}},"responseSchema":{"type":"json","example":{"ok":true,"index":3,"length":5,"schema":"delx/util-choice-index/v1"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_XCX17dsbUBgUeZ9_6kdoI","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Returns a deterministic, seeded random index within a given range, useful for reproducible choice selection in agent workflows.","exampleAgentPrompt":"Pick one item from a list of 5 options using the seed 'morning-blend-42' — give me back which index to use.","exampleUseCases":[{"title":"Reproducible agent A/B routing","prompt":"I have 3 response variants and I want to pick one deterministically using the session ID 'sess-abc123' as the seed — which index from 0 to 2 should I use?"},{"title":"Daily random prompt selection","prompt":"I have 7 writing prompts and I want to pick one for today using today's date '2025-06-10' as a seed — which index should I pick?"},{"title":"Weighted round-robin agent task assignment","prompt":"I have 4 agent workers and a task ID 'task-9872' — use that as a seed to deterministically pick which worker index from 0 to 3 should handle it."}],"resultDescription":"Returns a JSON object with 'ok' (boolean success flag), 'index' (the computed integer index, 0-based, within the given length), 'length' (the range provided), and 'schema' (a versioned schema identifier 'delx/util-choice-index/v1') confirming the computation type.","failureModes":["Missing or empty seed string results in a validation error","Length of 0 or negative integer may return an error or undefined behavior","Non-integer length value causes schema validation failure","Payment failure via x402 results in HTTP 402 response blocking the call","Malformed JSON body returns a 400-level error"],"whenToPreferThis":"Use this endpoint when you need fast, cheap, reproducible random index selection seeded by a string — ideal for agent workflows requiring deterministic sampling, consistent A/B routing, or repeatable choice logic without implementing local PRNG. Prefer it over local randomness when you want verifiable, pay-per-result delivery with no API key setup.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T00:53:40.820Z","isFirstParty":false,"canonicalSlug":"delx-commerce-choice-index-seeded-random-selection-a5a29c66"}