# Delx Commerce Token Estimate API

> Delx Commerce Token Estimate API is a paid API for AI agents from commerce.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-01).

Estimates the token cost for a given HTTP request/response pair before executing a pay-per-result API call via x402

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/token-estimate?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-commerce-token-estimate-api-73e1b8ba
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Ra01dC1HFYftJqeU4x4JF

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-commerce-token-estimate-api-73e1b8ba -d '<json body>'
```

Example prompt: Before I actually pay for this Delx Commerce API call, can you estimate how many tokens it will use? The input is a JSON POST body with fields like {"query": "latest BTC price"} and the expected output example is {"price": 12345}.

## When to prefer this

Use this endpoint when you need to preview or budget the token cost of a Delx Commerce pay-per-result API call before actually executing it and paying. Ideal for autonomous agents that need cost-awareness before committing USDC via x402, or for developers testing and optimizing request payloads to minimize per-call expense.

## Known failure modes

- Missing required 'input' or 'output' fields returns a 400 validation error
- Invalid bodyType enum value (not 'json', 'form-data', or 'text') causes schema rejection
- Empty or malformed body object may yield inaccurate or zero token estimates
- Network timeout if the estimation service is temporarily unavailable
- Invalid input type (not 'http') returns a constraint violation error

## How this service works

Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.

## Output

Returns a JSON object containing the estimated token count for the described HTTP request/response pair, enabling the caller to anticipate cost in USDC before actually executing and paying for the call via x402.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input",
  "output"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "additionalProperties": true
    },
    "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",
    "example"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "json"
    },
    "example": {
     "type": "object",
     "additionalProperties": true
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {}
}
```

## More

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