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

# POST /v1/x402-endpoints/probe

Probe an x402 endpoint to get its payment requirements

` POST /v1/x402-endpoints/probe `

Probe an x402 endpoint to get its payment requirements

## Request body (required)

Content type: ` application/json `

Endpoint URL to probe

- ` value `: type ` unknown `

  - ` oneOf alternative 1 `: type ` object `

  - ` oneOf alternative 2 `: type ` object `

    - Required fields: ` resourceUrl `

    - ` body `: type ` string ` — Optional body to send with the probe request. Some endpoints require valid input before returning 402.

    - ` method `: type ` string ` — Optional HTTP method to use. If not specified, tries POST then GET. Valid values: GET, POST, PUT, PATCH, DELETE

      - enum: ` ["GET","POST","PUT","PATCH","DELETE"] `

    - ` resourceUrl `: type ` string `

## Responses

### ` 200 ` — OK

Content type: ` application/json `

- ` value `: type ` object `

  - ` code `: type ` integer `

    - example: ` 200 `

  - ` data `: type ` object `

    - ` accepts `: type ` array ` — Full accepts array for reference

      - ` array item `: type ` object `

        - ` amount `: type ` string ` — Amount is the v2 equivalent of MaxAmountRequired. During normalization, Amount is copied to MaxAmountRequired if MaxAmountRequired is empty.

        - ` asset `: type ` string `

        - ` description `: type ` string `

        - ` extra `: type ` object `

          - ` chainId `: type ` integer ` — ChainID is the chain ID for EIP-712 domain (from quote)

          - ` facilitatorAddress `: type ` string ` — FacilitatorAddress is the facilitator's address that will be approved as spender

          - ` name `: type ` string ` — Name is the ERC20 token name (used in EIP-712 domain)

          - ` signatureType `: type ` string ` — SignatureType specifies the signature method: "authorization" (EIP-3009) or "permit" (ERC-2612)

          - ` verifyingContract `: type ` string ` — VerifyingContract is the token contract address for EIP-712 domain (from quote)

          - ` version `: type ` string ` — Version is the ERC20 token version (used in EIP-712 domain)

        - ` maxAmountRequired `: type ` string `

        - ` maxTimeoutSeconds `: type ` integer `

        - ` mimeType `: type ` string `

        - ` network `: type ` string `

        - ` outputSchema `: type ` object ` — OutputSchema for discovery registration (matches TypeScript SDK format)

          - ` discoveryOutput `: type ` object `

            - ` example `: type ` unknown ` — Example provides a sample value for documentation and testing

            - ` schema `: type ` object ` — Schema is a JSON Schema definition for validation

          - ` input `: type ` object `

            - ` body `: type ` object ` — Body contains JSON Schema for body parameters (used by some x402 providers)

            - ` bodyFields `: type ` object ` — BodyFields contains body field definitions in alternative CDP format

            - ` bodyParams `: type ` object ` — BodyParams contains body param definitions in CDP format

            - ` discoverable `: type ` boolean `

            - ` discoveryInput `: type ` object `

              - ` example `: type ` unknown ` — Example provides a sample value for documentation and testing

              - ` schema `: type ` object ` — Schema is a JSON Schema definition for validation

            - ` method `: type ` string `

            - ` query `: type ` object ` — Query contains JSON Schema for query parameters (used by some x402 providers)

            - ` queryParams `: type ` object ` — QueryParams contains query param definitions in CDP format

            - ` type `: type ` string `

          - ` metadata `: type ` object `

            - ` category `: type ` string ` — Category groups workflows (e.g., "data", "automation", "ai")

            - ` description `: type ` string ` — Description provides details about what the workflow does

            - ` documentation `: type ` string ` — Documentation URL for additional documentation

            - ` logo `: type ` string ` — Logo URL for the workflow/provider logo

            - ` name `: type ` string ` — Name is the display name for the workflow

            - ` provider `: type ` string ` — Provider is the name of the entity providing this workflow

            - ` tags `: type ` array ` — Tags for searchable keywords

              - ` array item `: type ` string `

          - ` output `: type ` unknown `

        - ` payTo `: type ` string `

        - ` resource `: type ` string `

        - ` scheme `: type ` string `

        - ` srcAmountRequired `: type ` string `

        - ` srcNetwork `: type ` string `

        - ` srcTokenAddress `: type ` string ` — Cross-token payment fields (set when buyer uses X-PREFERRED-TOKEN)

    - ` baseUrl `: type ` string ` — === PARSED FROM URL ===

    - ` bodyParams `: type ` object `

    - ` description `: type ` string `

    - ` detectedParams `: type ` object ` — Query params found in URL

    - ` error `: type ` string ` — Error message if probe failed

    - ` headerParams `: type ` object `

    - ` method `: type ` string ` — === OPTIONAL (from 402 response) ===

    - ` mimeType `: type ` string `

    - ` network `: type ` string `

    - ` outputSchema `: type ` object `

    - ` payTo `: type ` string `

    - ` price `: type ` string ` — === ALWAYS AVAILABLE (core protocol) ===

    - ` queryParams `: type ` object ` — === EXTRACTED FROM outputSchema (normalized) ===

    - ` success `: type ` boolean ` — Whether the probe succeeded

    - ` tokenAddress `: type ` string `

    - ` tokenDecimals `: type ` integer `

    - ` tokenName `: type ` string `

    - ` tokenSymbol `: type ` string `

  - ` message `: type ` string `

    - example: ` "success" `

  - ` requestId `: type ` string `

    - example: ` "abc-123" `

### ` 400 ` — Bad Request

Content type: ` application/json `

- ` value `: type ` object `

  - ` code `: type ` integer `

  - ` details `: type ` array `

    - ` array item `: type ` unknown `

  - ` message `: type ` string `

  - ` requestId `: type ` string `

## Request examples

### cURL

```curl
curl -X POST 'https://api.example.com/v1/x402-endpoints/probe' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{}'
```

### JavaScript

```javascript
const response = await fetch('https://api.example.com/v1/x402-endpoints/probe', {
  method: 'POST',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  },
  body: JSON.stringify({})
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.post('https://api.example.com/v1/x402-endpoints/probe', headers=headers, json={})
print(response.json())
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{}`)
	req, _ := http.NewRequest("POST", "https://api.example.com/v1/x402-endpoints/probe", body)
	req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
	req.Header.Set("Content-Type", "application/json")

	resp, _ := http.DefaultClient.Do(req)
	defer resp.Body.Close()
	result, _ := io.ReadAll(resp.Body)
	fmt.Println(string(result))
}
```