{"uid":"cap_F8hVQPSJGqB2SEjjyLeJo","slug":"delx-ratio-1b001264","name":"Delx Ratio","description":"Compute a/b ratio safely. Call when you need conversion rates or price ratios from agent numbers. Returns ratio or null if b=0 for $0.001 USDC via x402 on Base. No network, no keys, no retention; first-party local JSON only. Results are advisory; the caller owns budgets, auth, and production controls.","url":"https://api.delx.ai/api/v1/x402/ratio?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"a":{"type":"integer","description":"Input field: a."},"b":{"type":"integer","description":"Input field: b."}}},"responseSchema":{"type":"json","example":{"a":2,"b":4,"ratio":0.5,"schema":"delx/util-ratio/v1"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_InMxcJXdmEoBxFWFKq6YN","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Safely computes the ratio a/b, returning null instead of an error when b is zero","exampleAgentPrompt":"What is the ratio of 847 to 1200? I need it computed safely so if the denominator ends up being zero it just returns null instead of crashing.","exampleUseCases":[{"title":"Conversion rate from campaign metrics","prompt":"I have 342 clicks and 1500 impressions from today's campaign — can you compute the conversion ratio safely so I get null if impressions is somehow zero?"},{"title":"Price ratio between two assets","prompt":"What's the ratio of asset A priced at 4250 to asset B priced at 8500? Divide 4250 by 8500 and give me the decimal."},{"title":"Win rate calculation for a trading bot","prompt":"My bot had 73 winning trades out of 200 total trades — compute the win ratio for me, and return null if total is zero just in case."}],"resultDescription":"Returns a JSON object with the computed ratio as a float (a divided by b), or null if b equals zero, preventing divide-by-zero errors. No side effects or data retention.","failureModes":["b=0 returns null rather than an error — caller must handle null as 'undefined ratio'","Non-integer inputs may be rejected or coerced depending on schema validation","Missing required fields (a or b) will likely result in a 4xx error","Network or payment failures via x402 protocol may prevent the call from completing"],"whenToPreferThis":"Choose this endpoint when you need a lightweight, zero-safe integer division in an agent pipeline without implementing your own error handling for divide-by-zero. Ideal for computing rates, ratios, and fractions from agent-generated integers where the denominator could be zero. Prefer it over inline arithmetic when you want a guaranteed safe fallback (null) and a clean JSON result without custom exception logic.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-19T06:44:13.882Z","isFirstParty":false,"canonicalSlug":"delx-ratio-1b001264"}