{"uid":"cap_g4CaDWlNgrmMzzX83mlvt","slug":"one-engine-stable-sort-array-444d9720","name":"ONE Engine Stable Sort (Array)","description":"Low-cost pay-per-call utility APIs for autonomous agents using x402 on Base.","url":"https://one-search.one-engine.workers.dev/v3/array/stable-sort/t2?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["values"],"properties":{"size":{"type":"integer"},"other":{"type":"array","description":"Optional comparison array"},"offset":{"type":"integer"},"values":{"type":"array","description":"JSON array with at most 1000 items"}}},"responseSchema":{"type":"object","additionalProperties":true},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.0007","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.0007/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0007","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0007","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_hsXqZtPQ7823B2PNL8SlJ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0007","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Sorts a JSON array of up to 1000 items using a stable sort algorithm, with optional comparison array and offset support.","exampleAgentPrompt":"Sort this array of values stably for me: [42, 7, 19, 3, 7, 15] — keep the relative order of any duplicate elements intact.","exampleUseCases":[{"title":"Ranking leaderboard scores stably","prompt":"I have a list of player scores [850, 200, 850, 400, 200, 950] and I need them sorted in a stable way so players with the same score stay in their original relative order — can you sort that array for me?"},{"title":"Sorting product prices with duplicates","prompt":"Sort this array of product prices [29.99, 9.99, 49.99, 9.99, 19.99] while making sure items with the same price keep their original order relative to each other."},{"title":"Ordering timestamped event data","prompt":"I have an array of event priority values [3, 1, 2, 1, 3, 2] that I need stably sorted so events with the same priority level stay in the sequence they arrived — please sort them."}],"resultDescription":"A JSON object containing the stably sorted result of the input array, preserving the relative order of equal elements. The response structure is open-ended (additionalProperties: true) and typically wraps the sorted array with metadata.","failureModes":["Input array exceeds 1000 items — request rejected","Missing required 'values' field — validation error","Malformed JSON in values array — parse error","Payment not attached or insufficient USDC — 402 Payment Required","Network timeout on Cloudflare Worker edge node"],"whenToPreferThis":"Choose this endpoint when you need a guaranteed stable sort (preserving relative order of equal elements) on a JSON array of up to 1000 items without running local compute. Ideal for autonomous agents operating in serverless environments where spawning a sort process is impractical, or when billing per-call via x402 on Base is preferred over maintaining sort infrastructure. Use when correctness of equal-element ordering matters (e.g., ranked lists, timestamped events, leaderboards).","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T12:43:07.819Z","isFirstParty":false,"canonicalSlug":"one-engine-stable-sort-array-571a9644"}