# Endpoint Reference

This page gives a compact endpoint map for quick lookup.

This reference includes hosted user facing endpoints only.

## Quick setup

```bash
BASE_URL="https://api.ardentresearch.xyz"
API_KEY="your_api_key"
REQUEST_ID="your_request_id"
```

## Public endpoints

1. `GET /health`
2. `GET /feed/recent`

### `GET /health`

```bash
curl -X GET "$BASE_URL/health"
```

### `GET /feed/recent`

```bash
curl -X GET "$BASE_URL/feed/recent?limit=12"
```

## Protected endpoints

1. `GET /wallet`
2. `POST /simulate`
3. `POST /execute`
4. `GET /status/:id`

Authentication:

```bash
X-API-Key: <api_key>
```

Optional execution payment header (for manual API key users):

```bash
X-Payment-Proof: {"request_id":"your_request_id","payer":"0xYourPayer","token":"USDC","chain":"ethereum","tx_hash":"0xYourPaymentTxHash"}
```

### `GET /wallet`

```bash
curl -X GET "$BASE_URL/wallet?agent_id=my-agent-001&chain=ethereum" \
  -H "X-API-Key: $API_KEY"
```

### `POST /simulate`

```bash
curl -X POST "$BASE_URL/simulate" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -d '{
    "agent_id": "my-agent-001",
    "chain": "ethereum",
    "target_contract": "0xTargetContract",
    "calldata": "0xCalldata",
    "value": "0"
  }'
```

### `POST /execute`

```bash
curl -X POST "$BASE_URL/execute" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -d '{
    "agent_id": "my-agent-001",
    "chain": "ethereum",
    "target_contract": "0xTargetContract",
    "calldata": "0xCalldata",
    "value": "0"
  }'
```

Manual payment mode re-submit (after `402 Payment Required`):

```bash
curl -X POST "$BASE_URL/execute" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $API_KEY" \
  -H 'X-Payment-Proof: {"request_id":"your_request_id","payer":"0xYourPayer","token":"USDC","chain":"ethereum","tx_hash":"0xYourPaymentTxHash"}' \
  -d '{
    "agent_id": "my-agent-001",
    "chain": "ethereum",
    "target_contract": "0xTargetContract",
    "calldata": "0xCalldata",
    "value": "0"
  }'
```

### `GET /status/:id`

```bash
curl -X GET "$BASE_URL/status/$REQUEST_ID" \
  -H "X-API-Key: $API_KEY"
```

## Standard content type

For JSON request bodies:

```bash
Content-Type: application/json
```

## Common status codes

1. `200 OK`
2. `400 Bad Request`
3. `401 Unauthorized`
4. `402 Payment Required`
5. `404 Not Found`
6. `429 Too Many Requests`
7. `500 Internal Server Error`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ardentresearch.xyz/endpoint-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
