# Delx Ratio

> Delx Ratio is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-19).

Safely computes the ratio a/b, returning null instead of an error when b is zero

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/ratio?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-ratio-1b001264
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_F8hVQPSJGqB2SEjjyLeJo

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability delx-ratio-1b001264 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "type": "integer",
   "description": "Input field: a."
  },
  "b": {
   "type": "integer",
   "description": "Input field: b."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "a": 2,
  "b": 4,
  "ratio": 0.5,
  "schema": "delx/util-ratio/v1"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-ratio-1b001264/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
