# Delx Commerce — Array First Element Extraction

> Delx Commerce — Array First Element Extraction 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).

Returns the first element of an input array, with a flag indicating whether the array was non-empty, payable per-call via USDC on Base or Solana.

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/arr-first?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-array-first-element-extraction-100c4255
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PjpiVm8x6mZfov1RNyL88

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-array-first-element-extraction-100c4255 -d '<json body>'
```

Example prompt: I have an array like ["alpha", "beta", "gamma"] — can you get me the first element from it and tell me if the array was empty?

## When to prefer this

Choose this endpoint when you need a simple, trustless, pay-per-call utility to extract the first element of an array without standing up your own infrastructure. It is ideal for AI agents that need lightweight array-head operations within a verifiable, blockchain-settled micropayment workflow (x402 on Base or Solana), especially when avoiding API key management or subscription overhead is a priority.

## Known failure modes

- Empty input — if items array is missing or null, behavior is undefined; check the `empty` flag in the response
- Non-array input — passing a non-array type to items may result in an error or unexpected output
- Payment failure — if USDC payment via x402 is not completed, the API returns a 402 status and no result is delivered
- Malformed request — missing or invalid JSON body returns a 4xx error

## How this service works

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

## Output

A JSON object with an `empty` boolean indicating whether the input array had any elements, a `value` field containing the first element of the array (if non-empty), and a `schema` field identifying the response format as `delx/util-arr-first/v1`.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "items": {
   "type": "array",
   "description": "Input field: items."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "empty": false,
  "value": "alpha",
  "schema": "delx/util-arr-first/v1"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-commerce-array-first-element-extraction-100c4255/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)
