# Delx Commerce Token Budget Split

> Delx Commerce Token Budget Split 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 how to split a model's context window into system, input, and output token budgets given total and reserved token counts

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/token-budget-split?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-token-budget-split-fa348a5d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_P7x4yXFEV1yT8dNzm3vrC

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-budget-split-fa348a5d -d '<json body>'
```

Example prompt: I have an 8000-token context window, 500 tokens reserved for the system prompt, and 1000 tokens reserved for output — can you calculate how many tokens I have left for user input and whether that allocation is feasible?

## When to prefer this

Choose this endpoint when an AI agent or pipeline needs a lightweight, deterministic utility to compute safe token budgets before calling an LLM — especially useful in agentic loops where context management is dynamic. Prefer it over manual arithmetic when you need a verifiable, pay-per-use microservice with no signup overhead, paid via USDC on Base or Solana.

## Known failure modes

- Infeasible split (available_input_tokens would be zero or negative): feasible returns false
- Missing required fields (total_tokens, system_tokens, reserved_output_tokens): likely 400 or validation error
- Payment failure via x402 protocol: 402 Payment Required if USDC payment not attached
- Non-numeric token values: schema validation 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 indicating whether the requested token split is feasible, along with the calculated available_input_tokens, and echoes back total_tokens, system_tokens, and reserved_output_tokens for confirmation. Schema version is included as 'delx/util-token-budget-split/v1'.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "total_tokens": {
   "type": "number",
   "description": "Model context window size in tokens."
  },
  "system_tokens": {
   "type": "number",
   "description": "Tokens already reserved for system/instructions."
  },
  "reserved_output_tokens": {
   "type": "number",
   "description": "Tokens reserved for model output."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "schema": "delx/util-token-budget-split/v1",
  "feasible": true,
  "total_tokens": 8000,
  "system_tokens": 500,
  "available_input_tokens": 6500,
  "reserved_output_tokens": 1000
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-commerce-token-budget-split-fa348a5d/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)
