{"uid":"cap_7jYdoL_TIcnDbeQw6mMyK","slug":"delx-choice-index-b0be0108","name":"Delx Choice Index","description":"Deterministic index from seed into [0,length). Call when you need stable A/B assignment without shared RNG state. Returns index, length, ok for $0.001 USDC via x402 on Base. No network, no keys, no retention; first-party local JSON only. Results are advisory; the caller owns budgets, auth, and production controls.","url":"https://api.delx.ai/api/v1/x402/choice-index","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_MdZ-Yx7VUPYEZ1SkeEPFz","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":"Deterministically maps a seed string into an integer index within [0, length) for stable, stateless A/B or bucket assignment","exampleAgentPrompt":"Using the choice index, deterministically assign seed 'user-42-session-9' to one of 4 buckets and tell me which index it maps to.","exampleUseCases":[{"title":"A/B test variant assignment","prompt":"I need to deterministically assign user ID 'usr_8821' to one of 3 experiment variants — always the same variant for that user — can you get the bucket index using that as the seed with length 3?"},{"title":"Stable content shard routing","prompt":"I have 8 content shards and need to route request key 'req-2024-abc' to a consistent shard every time without any shared state — what index does that seed map to across 8 options?"},{"title":"Reproducible feature flag selection","prompt":"For a reproducible feature flag rollout, map the seed 'tenant-corp-7' deterministically to one of 5 feature tiers and tell me which tier index it lands on."}],"resultDescription":"Returns a JSON object with an integer `index` in [0, length), the `length` that was passed in, and an `ok` boolean confirming success. The index is fully deterministic for any given seed and length pair, with no retained state or randomness.","failureModes":["Missing or empty seed string returns an error or ok:false","Length of 0 or negative integer causes invalid range error","Non-integer length value causes a schema validation failure","Network timeout on the paid x402 endpoint results in no response","Payment failure via x402 protocol blocks the request before computation"],"whenToPreferThis":"Choose this endpoint when you need stable, reproducible bucket or variant assignment from a string key without any shared random number generator state, database lookups, or external dependencies. It is ideal for distributed agent systems where multiple nodes must agree on the same assignment for a given seed, for A/B testing without a central experiment service, or for any deterministic routing/sharding use case where idempotency and zero side effects are required.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T19:02:41.293Z","isFirstParty":false}