Agentic Payments
Agentic payments let an AI agent call supported CarsXE APIs without a CarsXE API key. Instead, the agent uses an x402-compatible payment client or wallet, reads the payment requirements from the API response, pays for the request, and retries with the payment proof.
Use this when you want an agent to buy a single vehicle data lookup on demand, such as decoding a VIN, checking recalls, getting market value, or resolving a license plate.
If your request includes a CarsXE API key with key=YOUR_API_KEY, the API
uses normal API-key authentication. x402 is only used when no CarsXE API key
is sent.
What to ask your agent
Give your agent a direct instruction that includes the vehicle task and tells it to use x402:
Each lookup is a paid API call. Prices are small and vary by endpoint — a VIN
decode is around $0.15, for example. Your agent reads the exact, current
price from the 402 Payment Required response before paying, so it never
guesses.
Prompt examples
Agent flow
An x402-capable agent should follow this flow:
- Make the CarsXE API request without
key. - Read the
402 Payment Requiredresponse. - Inspect the returned payment requirements, including price, network, and resource.
- Submit payment with an x402-compatible wallet or payment client.
- Retry the same API request with the x402 payment header.
- Read the normal CarsXE JSON response and answer the user.
Pricing is returned in the payment requirement and can vary by endpoint. Your agent should not hardcode prices; it should read the current requirement from the 402 response.
Minimal HTTP shape
First, the agent calls the endpoint without a CarsXE API key:
Request
The API responds with payment instructions:
Payment required
After the agent pays with an x402-compatible client, it retries the same request with the payment proof header. Header names can vary by x402 client; CarsXE accepts the standard x402 payment header used by the client.
Paid retry
Successful paid responses include the normal CarsXE API JSON body. The response can also include an X-PAYMENT-RESPONSE header that the agent may keep with its run logs.
If a paid retry returns 500 after the payment settled, do not submit another
payment for the same request. Retain the X-PAYMENT-RESPONSE value or
transaction hash and contact CarsXE support so the result can be recovered or
the settlement can be refunded.
Supported endpoints
| Product | Method | Path | Required parameters | Optional parameters |
|---|---|---|---|---|
| Vehicle Specifications | GET | /specs | vin | deepdata, format, disableIntVINDecoding |
| Market Value v1 | GET | /marketvalue | vin | format |
| Market Value v2 | GET | /v2/marketvalue | vin | country, state, mileage, condition |
| Vehicle History | GET | /history | vin | format |
| International VIN Decoder | GET | /v1/international-vin-decoder | vin | — |
| Vehicle Recalls | GET | /v1/recalls | vin | — |
| Vehicle Recalls Report | GET | /v1/recalls-reports | vin | — |
| Lien & Theft | GET | /v1/lien-theft | vin | — |
| Plate Decoder | GET | /platedecoder | plate, state | format, country |
| Plate Decoder v2 | GET | /v2/platedecoder | plate, state | district, country, require_vin |
| US-Only Plate Decoder | GET | /v1/us-platedecoder | plate, state | decodeVIN |
| Vehicle Images | GET | /images | make, model | year, trim, color, angle, body, background |
| Year Make Model | GET | /v1/ymm | year, make, model | trim, allTrimOptions |
| Vehicle Recalls by YMM | GET | /v1/recalls-ymm | year, make, model | — |
| OBD Codes Decoder | GET | /obdcodesdecoder | code or obd_code | — |
| Plate Image Recognition | POST | /platerecognition | JSON body with one image URL field | — |
| VIN OCR | POST | /v1/vinocr | JSON body with one image URL or image data field | — |
| Recalls Batch Submit | POST | /v1/recalls-batch/submit | JSON vins array | webhookUrl |
Recalls Batch with x402
For x402, submit a JSON vins array. Duplicate VINs are normalized and charged once, and the payment requirement is the current per-VIN starter price multiplied by the unique VIN count. The csv and csvUrl request forms remain available with CarsXE API-key authentication only.
The successful 202 response includes data.batchToken. Keep this token secret: it is returned once and grants access only to that batch. Send it as X-CarsXE-Batch-Token when calling /v1/recalls-batch/status, /v1/recalls-batch/results, or /v1/recalls-batch/download. These follow-up calls do not require another x402 payment.
curl -G "https://api.carsxe.com/v1/recalls-batch/status" \
-d batchId=brb_mnablbn7_wvbaqv \
-H "X-CarsXE-Batch-Token: <batch-token>"Agent checklist
- Do not include
keywhen using x402. - Keep the request parameters identical between the unpaid request and the paid retry.
- Read the current price and network from the
402response. - Use the same endpoint path shown in the payment requirement.
- Return the CarsXE API result to the user after the paid retry succeeds.
Let AI agents pay for supported CarsXE API calls with x402, without first creating or storing a CarsXE API key.