{"uid":"cap_S9CtZdxmvoPovTxIWWu-b","slug":"one-engine-stable-sort-array-b4b88f11","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/t4?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.0015","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.0015/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0015","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0015","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_UZM0KVjlsdnTwCil81RiY","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0015","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 support.","exampleAgentPrompt":"Sort this array of values [42, 7, 19, 3, 55, 7, 1] using a stable sort so equal elements keep their original relative order.","exampleUseCases":[{"title":"Sorting leaderboard scores stably","prompt":"I have a list of player scores [1500, 2300, 1500, 800, 2300, 400] — can you stable-sort them so players with equal scores stay in their original order?"},{"title":"Ordering product prices for display","prompt":"Sort these product prices [29.99, 9.99, 49.99, 9.99, 19.99] in ascending order, keeping duplicates in the order they came in."},{"title":"Ranking items against a reference array","prompt":"I have a values array [3, 1, 4, 1, 5, 9] and a comparison array [1, 2, 3, 4, 5, 6, 7, 8, 9] — stable-sort my values using that reference ordering."}],"resultDescription":"Returns a JSON object containing the stably-sorted version of the input array, preserving the relative order of equal elements as they appeared in the original input.","failureModes":["Array exceeds 1000 items — request rejected","Invalid or non-array 'values' field — validation error","Malformed JSON body — parse error","Payment not provided or insufficient — 402 Payment Required","Comparison array type mismatch — sort may error or return unexpected results"],"whenToPreferThis":"Choose this endpoint when you need a guaranteed stable sort (equal elements preserve their original order) on a JSON array of up to 1000 items without spinning up your own compute. Ideal for autonomous agents needing lightweight, pay-per-call data ordering without managing server infrastructure. Prefer over client-side sorting when the agent runtime lacks reliable sort primitives or when auditability of the sort operation is needed.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T12:44:28.110Z","isFirstParty":false,"canonicalSlug":"one-engine-stable-sort-array-980781c7"}