# api.cn402.com Forex - Real-Time Foreign Exchange Rate

> api.cn402.com Forex - Real-Time Foreign Exchange Rate is a paid API for AI agents from api.cn402.com, paid per call via x402, $0.03/call, status unknown (last checked 2026-09-14).

Returns the real-time foreign exchange rate for a given currency pair, with a focus on CNY pairs and major currency pairs

## Facts

- Endpoint: GET https://api.cn402.com/forex
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-cn402-com-572d9cf1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6Vm2uV_ynlb9biO8fpkqS

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 api-cn402-com-572d9cf1
```

Example prompt: What's the current exchange rate for USD to CNY right now? I need the live forex rate for the USDCNY pair.

## When to prefer this

Use this endpoint when you need a real-time or near-real-time foreign exchange rate specifically involving CNY (Chinese yuan / RMB) or other major currency pairs. Prefer this over static or batch FX data sources when freshness matters for financial calculations, travel budgeting, or cross-border transaction estimation.

## Known failure modes

- Unsupported currency pair returns an error or empty result
- Invalid pair format (e.g. missing currency code) causes a bad request error
- Network or provider downtime may result in stale or unavailable rates
- Rate limiting if too many requests are made in quick succession

## How this service works

Real-time foreign exchange rate. Query param: ?pair=USDCNY (supports major CNY pairs and majors)

## Output

Returns the real-time exchange rate for the requested currency pair (e.g. USDCNY), enabling instant currency conversion calculations or financial decision-making.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "pair": {
       "type": "string",
       "description": "Price pair e.g. ETH-USD (optional)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-cn402-com-572d9cf1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.cn402.com](https://www.zero.xyz/host/api.cn402.com/llms.txt)
