{"uid":"cap_W7CLl0BvTULjds6lu4pji","slug":"one-engine-array-flatten-75687f99","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/t8?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.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_VwQw7QgU7I0atf2HWZcG3","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","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 slicing and comparison array support.","exampleAgentPrompt":"Flatten this nested JSON array for me — it has up to 50 items and looks like [[1,2],[3,[4,5]],6] — I just need all the values in one flat list, starting from offset 0.","exampleUseCases":[{"title":"Normalizing nested API response data","prompt":"I've got a nested JSON array from an API response — something like [[\"a\",\"b\"],[\"c\",[\"d\",\"e\"]]] with about 20 items — can you flatten it into a single-level list for me?"},{"title":"Preprocessing data for ML pipeline","prompt":"Before I feed this dataset into my model I need to flatten the nested feature arrays. Here's my array with around 200 items: [[[1,0],[0,1]],[[1,1],[0,0]]]. Flatten it all into one level for me."},{"title":"Comparing flattened arrays for diff","prompt":"I have two arrays — a nested main one with 15 items and a comparison array [10,20,30] — can you flatten the main one and compare it against the comparison array?"}],"resultDescription":"Returns a JSON object containing the flattened (single-level) version of the input nested array, with optional offset and size slicing applied. The response schema is open (additionalProperties: true), so the flattened result and any metadata are included in the response object.","failureModes":["Input array exceeds 1000-item limit — returns an error or truncated result","Malformed JSON array in 'values' field — returns a parsing or validation error","Payment failure via x402 on Base — request not processed, 402 response returned","Empty 'values' array — may return an empty result or minimal response","Invalid types for 'offset' or 'size' — may return a validation error"],"whenToPreferThis":"Choose this endpoint when you need a lightweight, pay-per-call array flattening operation without deploying your own transformation logic. Ideal for autonomous agents that need to normalize nested JSON arrays on demand at low cost ($0.01 USDC per call via x402 on Base). Best suited for arrays up to 1000 items. Prefer this over writing custom code when you need a quick, reliable serverless transformation in an agent workflow.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T12:44:08.250Z","isFirstParty":false,"canonicalSlug":"one-engine-array-flatten-2651dc85"}