{"uid":"cap_P1AzC2EcRF2tw3sTkfvFP","slug":"one-engine-array-flatten-ff67b975","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/v1/array/flatten?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"depth":{"type":"integer","maximum":10,"minimum":1},"values":{"type":"array"}}},"responseSchema":{"type":"json","example":{"values":[1,2,3]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.0011","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.0011/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0011","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0011","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Mpnz1wY2oyYIS9SZ-P9ia","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0011","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Flattens a nested array to a specified depth, returning a single-level or partially-flattened array.","exampleAgentPrompt":"Flatten this nested array [[1,[2,3]],[4,[5,[6]]]] to a depth of 2 so I can process it as a simple list.","exampleUseCases":[{"title":"ETL pipeline data normalization","prompt":"I have a deeply nested array from my data source: [[1,[2,[3,4]]],[[5,6],7]]. Can you flatten it to depth 3 so I can feed it into my flat processing pipeline?"},{"title":"API response unwrapping","prompt":"The API returned me this nested structure: [[\"a\",\"b\"],[\"c\",[\"d\",\"e\"]]]. Flatten it one level deep so the values are easier to iterate over."},{"title":"Batch data preprocessing","prompt":"I need to normalize this nested dataset before running analysis — here's the array: [[10,[20,30]],[40,[50,[60,70]]]]. Flatten it completely to depth 10."}],"resultDescription":"Returns a JSON object with a 'values' key containing the flattened array, e.g. {\"values\":[1,2,3,4,5]}. Elements are unwrapped to the specified depth, with deeper nesting preserved beyond that depth.","failureModes":["Depth outside 1–10 range returns a validation error","Non-array 'values' input returns a schema error","Extremely large arrays may hit payload size limits","Missing 'values' field returns a 400 bad request","Network timeout on very large array processing"],"whenToPreferThis":"Choose this endpoint when you need a lightweight, pay-per-call array flattening operation inside an agent workflow without spinning up a compute environment. Ideal for small-to-medium arrays in automated pipelines where cost-per-call matters and depth control (1–10) is needed. Prefer it over in-process flattening when the agent runtime lacks code execution capability.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T12:43:42.868Z","isFirstParty":false,"canonicalSlug":"one-engine-array-flatten-2651dc85"}