{"uid":"cap_MUBY3xWHnHzSBvT0OGWQm","slug":"api-usage-secondary-measure-weighted-mean-calculator-a6f4b9b0","name":"API Usage Secondary-Measure Weighted Mean Calculator","description":"API usage - Secondary-measure weighted mean: Secondary-measure weighted mean for API usage. Up to 200 supplied typed records. Local numeric and data-quality processing; no external enrichment or forecasting. One of 25 profiles or calculations across 20 shared operations in this sector. 0.01 USDC includes one bounded secondary-measure weighted mean deliverable.","url":"https://market.datapackvibe.com/x402/assistant-sector-analytics-api-usage-weighted-average?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object","required":["row_id","endpoint","date","requests","latency_ms"],"properties":{"date":{"type":"string","default":"","pattern":"^\\d{4}-\\d{2}-\\d{2}$","maxLength":10},"row_id":{"type":"string","default":"","maxLength":80,"minLength":1},"endpoint":{"type":"string","default":"","maxLength":80},"requests":{"type":["number","null"],"maximum":1000000000000,"minimum":-1000000000000},"latency_ms":{"type":["number","null"],"maximum":1000000000000,"minimum":-1000000000000}},"additionalProperties":false},"default":[{"date":"2026-10-01","row_id":"row-1","endpoint":"group-a","requests":10,"latency_ms":1},{"date":"2026-10-02","row_id":"row-2","endpoint":"group-b","requests":20,"latency_ms":2},{"date":"2026-10-03","row_id":"row-3","endpoint":"group-a","requests":15,"latency_ms":3},{"date":"2026-10-04","row_id":"row-4","endpoint":"group-b","requests":30,"latency_ms":4}],"maxItems":200,"minItems":1},"field":{"enum":["requests","latency_ms"],"type":"string","default":"requests"}}},"responseSchema":null,"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_ptlVEByzxeyMJseHsou9N","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":"Computes a secondary-measure weighted mean (e.g. latency weighted by request count) across up to 200 API usage records, grouped by endpoint and date.","exampleAgentPrompt":"Calculate the weighted mean of latency_ms (weighted by requests) across these 4 API usage records: endpoint group-a on 2026-10-01 had 10 requests and 1ms latency, group-b on 2026-10-02 had 20 requests and 2ms, group-a on 2026-10-03 had 15 requests and 3ms, and group-b on 2026-10-04 had 30 requests and 4ms.","exampleUseCases":[{"title":"Latency weighted by traffic volume","prompt":"I have daily API usage logs for two endpoints over the past week — each row has the date, endpoint name, request count, and average latency in milliseconds. Can you compute the weighted mean latency using request count as the weight so I know the true traffic-adjusted average response time? The field I care about is latency_ms."},{"title":"Request volume weighted average across endpoints","prompt":"Here are 50 rows of API usage data with endpoint names, dates, and request counts. Can you calculate the weighted mean of the requests field using latency_ms as the secondary weight? I want to understand which endpoints dominate by weighted volume."},{"title":"API performance summary for weekly report","prompt":"I'm putting together a weekly API performance report and need the secondary-measure weighted mean of latency_ms weighted by requests for these 12 data points across my three production endpoints. Can you run that calculation for me?"}],"resultDescription":"Returns a single weighted mean value computed by using one numeric field (e.g. latency_ms) as the measure and the other (e.g. requests) as the weight, across all supplied API usage records. The calculation is performed locally with no external enrichment.","failureModes":["Empty or missing rows array returns validation error","More than 200 rows submitted exceeds maxItems limit","Invalid date format (not YYYY-MM-DD) causes schema rejection","Null values in both requests and latency_ms for all rows may produce undefined result","Invalid field enum value (not 'requests' or 'latency_ms') causes rejection","row_id missing or empty string triggers required field error"],"whenToPreferThis":"Choose this endpoint when you have tabular API usage data with request counts and latency values and need a statistically correct weighted mean rather than a simple arithmetic average. It is purpose-built for API analytics datasets with up to 200 records, processed locally without external dependencies. Prefer it over generic statistics APIs when your data matches the endpoint/date/requests/latency_ms schema exactly.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-18T00:58:39.874Z","isFirstParty":false,"canonicalSlug":"api-usage-secondary-measure-weighted-mean-calculator-a6f4b9b0"}