# Delx Commerce — Batch Size Planner

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

Computes the optimal batch size for processing a collection of items given hard limits on count and byte size per batch.

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/batch-size-plan?utm_source=zero.xyz
- Price: $0.003/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-batch-size-planner-ad9aa5b7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_iDLPTtQvp8IwVzrjSG2uk

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-batch-size-planner-ad9aa5b7 -d '<json body>'
```

Example prompt: I need to batch-process 1000 items where each item is about 2000 bytes on average — what's the recommended batch size if I can't exceed 50 items or 80000 bytes per batch?

## When to prefer this

Use this endpoint when an AI agent needs to dynamically plan batching strategy for large datasets before executing bulk operations, especially when both item count and payload byte size are hard constraints. Prefer this over manual calculation when the agent must adapt batch sizes at runtime based on varying dataset sizes or API limits.

## Known failure modes

- Missing required fields may result in a 400 error or inaccurate output
- Providing avg_item_bytes of 0 may cause division errors or unreliable byte_limited_batch results
- If max_bytes is omitted, byte-based limiting is skipped and only item count is used
- Payment failure via x402 (insufficient USDC balance) will result in a 402 Payment Required response

## 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 with the schema identifier, the echoed max_batch and item_count, the estimated number of batches needed, the byte-constrained batch size (byte_limited_batch), and the final recommended_batch_size that respects both constraints.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "max_batch": {
   "type": "number",
   "description": "Hard maximum items per batch."
  },
  "max_bytes": {
   "type": "number",
   "description": "Hard maximum bytes per batch."
  },
  "item_count": {
   "type": "number",
   "description": "Number of items to batch."
  },
  "avg_item_bytes": {
   "type": "number",
   "description": "Average bytes per item used for the byte-limited batch size."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "schema": "delx/util-batch-size-plan/v1",
  "max_batch": 50,
  "item_count": 1000,
  "estimated_batches": 25,
  "byte_limited_batch": 40,
  "recommended_batch_size": 40
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-commerce-batch-size-planner-ad9aa5b7/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)
