# Currency Converter (`fx.convert`)

Convert an amount between 31 currencies at the latest European Central Bank reference rate.

- **Route:** `POST /v1/run/fx.convert`
- **Price:** $0.0005 per request ($0.50 per 1,000) · `cost_usd` on every response
- **Source:** European Central Bank reference rates (`ecb`) · failover: no
- **Measured latency:** p50 66 ms · p95 66 ms · p99 66 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `amount` | number | yes |  | Amount to convert |
| `from` | string | yes |  | Source currency (ISO 4217) |
| `to` | string | yes |  | Target currency (ISO 4217) |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `result` | Converted amount. |
| `rate` | Units of the target per unit of the source. |
| `date` | Day of the reference rate. |
| `source` | Rate source and caveat. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/fx.convert \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":250,"from":"USD","to":"EUR"}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('fx.convert', {'amount': 250, 'from': 'USD', 'to': 'EUR'})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run fx.convert '{"amount":250,"from":"USD","to":"EUR"}'
```

Quote first (free, validates input): `POST /v1/quote/fx.convert` with the same body.
