{"uid":"cap_KIkx4zO3bf4RmKBI-pcgr","slug":"one-engine-array-flatten-2651dc85","name":"ONE Engine Array Flatten","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/flatten/t9?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.018","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.018/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.018","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.018","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_X02wOMeIpskFYovndxsql","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.018","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Flattens a nested JSON array into a single-level array, with optional size and offset parameters.","exampleAgentPrompt":"Can you flatten this nested JSON array for me: [[1,2],[3,[4,5]],6] — I want it as a single flat list, limited to 10 items starting at offset 0.","exampleUseCases":[{"title":"Normalize nested API response data","prompt":"I got back a deeply nested array from another API — [[\"a\",[\"b\",\"c\"]],[\"d\"]] — can you flatten it into a simple one-level list so I can iterate over the items?"},{"title":"Paginate through flattened results","prompt":"I have this nested array [[1,2,3],[4,[5,6]],7,8,9,10] and I want just 5 items starting at offset 3 after flattening — can you do that for me?"},{"title":"Compare flattened array against reference","prompt":"Take this nested array [[\"apple\",[\"banana\",\"cherry\"]],\"date\"] and flatten it, then compare it against [\"apple\",\"banana\",\"cherry\",\"date\"] so I can see if they match up."}],"resultDescription":"Returns a JSON object containing the flattened (single-level) version of the input array, along with any metadata from the operation. The flattened array has all nested sub-arrays unwound into a single sequential list, optionally trimmed by size and starting at offset.","failureModes":["Input array exceeds 1000 items — request will be rejected","Malformed JSON in the values field — will return a parse error","Invalid offset or size values (negative integers or non-integer types) — validation error","Payment failure via x402 on Base — 402 response before processing begins","Empty values array — may return empty result or error depending on server handling"],"whenToPreferThis":"Choose this endpoint when you need a simple, low-cost, pay-per-call utility to flatten nested JSON arrays without standing up your own transformation logic. Ideal for AI agents that occasionally need to normalize nested data structures from external APIs, especially when operating in a crypto-native x402 payment context on Base. Not suitable for very large arrays exceeding 1000 items.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T12:43:48.494Z","isFirstParty":false,"canonicalSlug":"one-engine-array-flatten-2651dc85"}