# Brazil Macro API – PTAX USD/BRL Exchange Rate

> Brazil Macro API – PTAX USD/BRL Exchange Rate is a paid API for AI agents from api-macro-br-production.up.railway.app, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Returns the official Brazilian Central Bank PTAX USD/BRL exchange rate, including both buy and sell rates.

## Facts

- Endpoint: GET https://api-macro-br-production.up.railway.app/v1/ptax
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/brazil-macro-api-ptax-usd-brl-exchange-rate-10e0cc78
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0TZVvomq17v31PPVNnHsQ

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability brazil-macro-api-ptax-usd-brl-exchange-rate-10e0cc78
```

Example prompt: What is the official Brazilian Central Bank PTAX exchange rate for the US dollar right now — give me both the buy and sell rates?

## When to prefer this

Choose this endpoint when you need the official, authoritative PTAX USD/BRL exchange rate published by the Banco Central do Brasil — especially for regulatory, accounting, tax, or compliance use cases where only the official central bank rate is acceptable. Prefer it over commercial FX APIs when the legal or official rate is required rather than a market mid-rate.

## Known failure modes

- BCB data source temporarily unavailable — upstream API may return 503 or empty data
- Outside Brazilian business hours the PTAX rate may not have been published yet for the day
- Network timeout on Railway-hosted infrastructure
- Invalid or unsupported HTTP method returns 405

## How this service works

Official PTAX USD/BRL exchange rate, buy and sell.

## Output

Returns the official PTAX USD/BRL exchange rate as published by the Banco Central do Brasil, including the buy rate (taxa de compra) and sell rate (taxa de venda), along with the reference date/time of the quote.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brazil-macro-api-ptax-usd-brl-exchange-rate-10e0cc78/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api-macro-br-production.up.railway.app](https://www.zero.xyz/host/api-macro-br-production.up.railway.app/llms.txt)
