> ## Documentation Index
> Fetch the complete documentation index at: https://x402-stellar.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Proxy Configuration

> Defining routing rules, assets, and prices in config.yaml

## YAML Configuration Reference

Create a `config.yaml` file in your proxy directory:

```yaml theme={null}
listen_addr: ":8080"
network: "stellar:testnet"

routes:
  - path: "/v1/chat/completions"
    upstream: "http://localhost:8000"
    asset: "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC" # Testnet USDC
    price: "0.01"
    recipient: "GCALKSGAZRJLSUEJT3M5W6LN4R7XQOLIRCOS6ZA6EDZVTZDBIIPPFKJ6"

  - path: "/v1/embeddings"
    upstream: "http://localhost:8000"
    asset: "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC"
    price: "0.002"
    recipient: "GCALKSGAZRJLSUEJT3M5W6LN4R7XQOLIRCOS6ZA6EDZVTZDBIIPPFKJ6"

  - path: "/health"
    upstream: "http://localhost:8000"
    # Routes without price/recipient are treated as public pass-through
```

## Running the Proxy

```bash theme={null}
cd proxy
go run cmd/gateway/main.go --config config.yaml
```
