# Delx Commerce — Basename Extractor API

> Delx Commerce — Basename Extractor 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-02).

Extracts the basename (final path component) from a given file or URL path string

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/basename?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-commerce-basename-extractor-api-5a710879
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RgQZbWP0hB7CiamUXLmOY

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-basename-extractor-api-5a710879 -d '<json body>'
```

Example prompt: What's the basename of the path '/usr/local/share/docs/readme.txt'? Just give me the final filename segment.

## When to prefer this

Choose this endpoint when you need a lightweight, pay-per-call basename extraction with no signup, no API key management, and verifiable delivery via x402 micropayments on Base or Solana. Ideal for AI agents that need to process paths on-demand at $0.001 USDC per call without committing to a subscription. Prefer alternatives if you need bulk batch processing or if you already have a local string utility available.

## Known failure modes

- Empty or missing 'path' input returns {empty: true, basename: ''}
- Malformed JSON request body returns a 4xx error
- Payment failure via x402 protocol blocks the request
- Path with only directory separators may return empty basename
- Network timeout if upstream service is unavailable

## 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 an 'empty' boolean indicating whether the basename is empty, a 'schema' field ('delx/util-basename/v1'), and a 'basename' string with the extracted final path component (e.g. 'readme.txt' from '/usr/local/docs/readme.txt').

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "path": {
   "type": "string",
   "description": "Input field: path."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "empty": false,
  "schema": "delx/util-basename/v1",
  "basename": "hash"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-commerce-basename-extractor-api-5a710879/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)
