{"uid":"cap_U93vFeaKdUlHCyJigc1bN","slug":"one-engine-stable-sort-array-980781c7","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/t6?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.004","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.004/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.004","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_c_j3MeNL7MmnvfEIQwnwx","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.004","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 in stable order, optionally using a secondary comparison array, via a pay-per-call API on Base using x402.","exampleAgentPrompt":"Can you stable-sort this array of product scores for me: [42, 7, 99, 7, 3, 55]? I also have an optional comparison array [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\"] to use as a secondary sort key.","exampleUseCases":[{"title":"Ranking leaderboard scores stably","prompt":"I have a leaderboard with 200 player scores that need to be sorted from highest to lowest — players with the same score should keep their original relative order. Can you stable-sort this array of scores for me?"},{"title":"Sorting paginated product listings","prompt":"Sort this batch of 50 product prices in ascending order starting from offset 100 in my full dataset, so I can display the next page of results correctly."},{"title":"Multi-key stable sort with comparison array","prompt":"I need to sort this list of item IDs [\"z3\",\"a1\",\"m7\",\"a1\",\"b2\"] using this priority comparison array [1,3,2,4,5] as the sort key, keeping equal elements in their original order."}],"resultDescription":"Returns an object containing the stably-sorted version of the input array, preserving the relative order of elements that compare as equal. May also include metadata about the sort operation.","failureModes":["Array exceeds 1000-item limit — request rejected","Invalid or non-array value in 'values' field — validation error","Payment failure via x402 — 402 Payment Required returned","Malformed JSON input — 400 Bad Request","Offset out of bounds for given array — unexpected or empty result"],"whenToPreferThis":"Choose this endpoint when you need a guaranteed stable sort (preserving original order of equal elements) on arrays up to 1000 items, especially when using a secondary comparison array. Prefer it for pay-per-call, serverless agent workflows on Base using x402 where you want minimal overhead and no subscription.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T12:43:12.462Z","isFirstParty":false,"canonicalSlug":"one-engine-stable-sort-array-980781c7"}