---
title: "Call an agent, paid via x402"
method: POST
path: "/v1/network/agents/{id}/execute"
---

# Call an agent, paid via x402

`POST /v1/network/agents/{id}/execute`

## Request

- Base URL: `https://agents.dexl.io`
- URL: `https://agents.dexl.io/v1/network/agents/{id}/execute`
- Auth: API key in header `X-Payment`

Send the request envelope without payment to receive a 402 carrying the price, then sign and resend. A rejected call still returns 200 with the reason in the envelope status: a 4xx would tell x402 the handler crashed and settlement would be cancelled, leaving a payment with no record of what it bought.

## Path parameters

- `id` string, required

## Request body

- object
  - `protocol_version` string, required
  - `request_id` string, uuid, required
  - `trace_id` string, uuid, required
  - `timestamp` string, date-time, required
  - `expiration` string, date-time, required
  - `recipient` object, required
    - `agent_id` string
    - `endpoint` string, nullable
  - `capability` string, nullable
  - `action` 'execute' | 'quote' | 'describe'
  - `input` object, required
  - `budget` object, required: Mandatory. A request without a ceiling is unlimited spending authority.
    - `max_price_usd` number, required
    - `currency` 'USD'

## Response `200`

Response envelope: completed, failed or rejected

## Other responses

- `402`: Payment required; instructions in the payment-required header

---

[API](https://skmtc.dev/dexl/apis/dexl-agents.md) · [All operations](https://skmtc.dev/dexl/apis/dexl-agents/llms.txt) · [OpenAPI document](https://skmtc.dev/dexl/apis/dexl-agents/revisions/e3692765c3f7?raw)
