> ## 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.

# discover_api_endpoints

> Find all available endpoints on an origin.

The `discover_api_endpoints` tool fetches the OpenAPI document from an origin and returns a list of all available endpoints. Works with any origin that publishes a spec, not just the pre-indexed ones.

Equivalent CLI command: `npx agentcash discover <url>`

## Parameters

<ParamField body="url" type="string" required>
  The origin URL to discover endpoints on (e.g., `https://stableenrich.dev`).
</ParamField>

## Response

<ResponseField name="origin" type="string">
  The origin that was queried.
</ResponseField>

<ResponseField name="endpoints" type="object[]">
  List of discovered endpoints.

  <Expandable>
    <ResponseField name="path" type="string">Endpoint path.</ResponseField>
    <ResponseField name="method" type="string">HTTP method.</ResponseField>
    <ResponseField name="description" type="string">What the endpoint does.</ResponseField>
    <ResponseField name="price" type="string">Cost in USDC.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="instructions" type="string">
  Usage instructions from the origin, if provided.
</ResponseField>

## Behavior

1. Fetches `/openapi.json` from the origin (falls back to `/.well-known/x402`)
2. Parses the OpenAPI document and its `x-payment-info` annotations
3. Returns endpoints with their descriptions, pricing, and accepted protocols

## Known origins

These origins are pre-indexed and available by default:

* `stableenrich.dev`
* `stablesocial.dev`
* `stablestudio.dev`
* `stableupload.dev`
* `stableemail.dev`

## Example

Ask your agent:

> Discover all available endpoints on stableenrich.dev using AgentCash.
