> ## Documentation Index
> Fetch the complete documentation index at: https://agentcash.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# agentcash fetch, check, discover, search

> Make authenticated and paid HTTP requests, check schemas, discover endpoints, and search for providers from the command line.

## fetch

```bash theme={null}
npx agentcash fetch <url> [options]
```

Sends an HTTP request with automatic SIWX authentication and payment handling. If the endpoint returns `402`, AgentCash attempts SIWX first and only pays if the route still requires it. Equivalent to the MCP [`fetch`](/tools/fetch) tool.

<Tip>
  Run `check <url>` first to confirm the request body schema. Skipping this often causes 400 errors from wrong field names.
</Tip>

### Options

| Flag                            | Description                                            |
| ------------------------------- | ------------------------------------------------------ |
| `-m` / `--method <method>`      | HTTP method (default: GET)                             |
| `-b` / `--body <string>`        | Raw request body string, passed through as-is          |
| `-H` / `--header <name:value>`  | HTTP header in `Name: value` format (repeatable)       |
| `--timeout <ms>`                | Request timeout in milliseconds                        |
| `--payment-protocol <protocol>` | Force a specific payment protocol: `x402` or `mpp`     |
| `--payment-network <network>`   | Preferred network for SIWX and payment when applicable |
| `--max-amount <usd>`            | Abort if the payment challenge exceeds this amount     |

### Example

```bash theme={null}
npx agentcash fetch https://stableenrich.dev/api/apollo/people-enrich \
  -m POST \
  -b '{"email":"user@example.com"}'
```

## fetch-auth

```bash theme={null}
npx agentcash fetch-auth <url> [options]
```

Deprecated alias for `fetch`. It uses the same unified flow and accepts the same options, but new integrations should call [`fetch`](/tools/fetch) directly.

## check

```bash theme={null}
npx agentcash check <url> [options]
```

Gets the input/output schema and auth mode (paid or SIWX) for an endpoint. Returns exact field names from the OpenAPI spec. Equivalent to the MCP [`check_endpoint_schema`](/tools/check-endpoint-schema) tool.

Call this before `fetch` to avoid 400 errors from wrong field names.

### Options

| Flag                           | Description                                                                           |
| ------------------------------ | ------------------------------------------------------------------------------------- |
| `-H` / `--header <name:value>` | HTTP header in `Name: value` format (repeatable)                                      |
| `-b` / `--body <json>`         | Probe the endpoint live for an exact price quote (useful when pricing is range-based) |

### Example

```bash theme={null}
npx agentcash check https://stableenrich.dev/api/apollo/people-enrich
```

## discover

```bash theme={null}
npx agentcash discover <url> [options]
```

Lists available endpoints at an API origin with descriptions and auth modes (paid or SIWX). Works with any origin, not just registered ones. Equivalent to the MCP [`discover_api_endpoints`](/tools/discover-api-endpoints) tool.

### Options

| Flag                 | Description                                                                                            |
| -------------------- | ------------------------------------------------------------------------------------------------------ |
| `--include-guidance` | Return full provider documentation (useful when composing multiple endpoints or when usage is unclear) |

### Example

```bash theme={null}
npx agentcash discover https://stableenrich.dev
```

## search

```bash theme={null}
npx agentcash search "<query>"
```

Finds paid API services by natural-language query. Returns matching origins with endpoints and pricing. Use this to find an API before you know which origin to call. Equivalent to the MCP [`search`](/tools/search) tool.

### Example

```bash theme={null}
npx agentcash search "send a physical postcard"
```

## try

```bash theme={null}
npx agentcash try <url>
```

Fetches a new origin's resources and returns a prompt guiding you through calling the first endpoint. Good for exploring an unfamiliar origin.

## register

```bash theme={null}
npx agentcash register <url>
```

Registers an origin with AgentCash by discovering and indexing its endpoints.

### Example

```bash theme={null}
npx agentcash register https://stableenrich.dev
```
