{"uid":"cap_YEO9wNKETQGY9K33JSN8p","slug":"relaystation-derive-computed-columns-5b62ab08","name":"Relaystation Derive Computed Columns","description":"$0.0002/MB. Add computed columns from structured expressions — injection-safe, no formula eval. 1¢ x402 min; remainder auto-credits — relaystation.ai/penny","url":"https://api.relaystation.ai/v1/data/derive","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"properties":{}},"type":{"type":"string","const":"http"},"method":{"enum":["POST","PUT","PATCH"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","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_QGS4EyGGIp29f2ZnNweOQ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Adds computed columns to structured data using injection-safe expressions without formula evaluation","exampleAgentPrompt":"Take my product table and add a 'margin_pct' column derived from (price - cost) / price, and a 'discounted_price' column computed as price * 0.85 — use injection-safe expression evaluation so no raw formula is executed.","exampleUseCases":[{"title":"E-commerce margin calculation","prompt":"I have a CSV of products with 'unit_cost' and 'selling_price' columns — add a computed 'profit_margin' column as (selling_price - unit_cost) / selling_price, injection-safe, no formula eval."},{"title":"Lead scoring augmentation","prompt":"Take my leads table with 'days_since_signup' and 'num_actions' columns and add a computed 'engagement_score' column equal to num_actions / days_since_signup so I can rank leads."},{"title":"Inventory reorder flag","prompt":"I have an inventory dataset with 'stock_qty' and 'reorder_threshold' columns — derive a boolean 'needs_reorder' column that's true whenever stock_qty is less than reorder_threshold."}],"resultDescription":"Returns the original structured dataset augmented with one or more new computed columns, where each new column's values are calculated per-row from the provided expressions. The evaluation is injection-safe and does not run arbitrary formula code. Billed at $0.0002/MB of data processed with a 1¢ minimum via x402; any remainder is auto-credited.","failureModes":["Invalid or unparseable column expression — returns an error describing which expression failed","Reference to a non-existent source column — returns a field resolution error","Malformed input data structure — returns a schema validation error","Division by zero or null reference in expression — returns a per-row computation error or null for affected rows","Insufficient x402 payment credits — returns a payment required error"],"whenToPreferThis":"Choose this endpoint when you need to safely add computed or derived columns to structured/tabular data using declarative expressions, especially when security is a concern and arbitrary formula execution (e.g., spreadsheet EVAL) is not acceptable. Prefer it over general-purpose code execution when you want a lightweight, per-MB-billed operation that is idempotent and side-effect-free. It is ideal for ETL pipelines, data enrichment steps, and preprocessing stages where new fields must be derived from existing ones without running untrusted code.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T12:52:45.183Z","isFirstParty":false}