canonical: https://jentic.com/apis/fxapis.com/fxapis

# Fx fxapis

The fxapis API connects a MetaTrader 5 trading account once and then trades it and reads it over plain HTTP. It places market and pending orders, modifies and closes positions, and returns an account's positions, orders, and full deal history, with an execution-wave endpoint that places one trade across many accounts at once. Accounts can be warmed online or cooled offline on demand, and the service exposes broker symbols, instrument mappings, and market hours drawn from each account's broker. Workspace features cover API keys with per-key scopes, TradingView alert hooks, webhook deliveries, billing usage, and members.

## For AI agents

Connect MetaTrader 5 accounts and place market and pending orders, modify and close positions, and read positions and deal history over HTTP. Authenticates with a scoped bearer key and can place one trade across many accounts.

## Scope

Does not handle price quotes, charting, or fiat and crypto on-ramps beyond its own billing. Use for executing and tracking MetaTrader 5 trades only.

## Capabilities

- Connect a MetaTrader 5 brokerage account and bring it online or offline on demand
- Place market and pending orders and modify or close open positions
- Read an account's positions, orders, and full deal history
- Place one trade across many accounts at once with execution waves
- Calculate required margin or expected profit before placing an order
- Route TradingView alerts to accounts through alert hooks and track webhook deliveries
- Read plan usage and billing for the workspace's trading activity

## Use cases

### AI Agent Trade Execution via Jentic

An AI agent reaches fxapis through Jentic to trade a MetaTrader 5 account without wiring the bearer key or the broker connection itself. It searches by intent, receives the matching operation and its input schema, and executes the order with the key injected at run time. This lets the agent act on a trading signal and confirm the result in one flow.

Example prompt: Search Jentic for 'place a market order on my MT5 account', load the POST `/v1/accounts/{id}/orders/market` schema, and execute it with the fxapis key injected at run time

### Signal-to-Order Execution

A trading system turns a signal into a sized, placed, and confirmed order. fxapis calculates the required margin, places the market order on the connected account, and returns the open positions so the system can verify the fill. Every response carries a requestId that can be quoted in support to trace the order.

Example prompt: Call POST `/v1/accounts/{id}/calculate` to size the trade, POST `/v1/accounts/{id}/orders/market` to place it, then GET `/v1/accounts/{id}/positions` to confirm the position opened

### Multi-Account Copy Execution

A money manager or signal provider places the same trade across many accounts at once. fxapis takes one execution wave and sends it to the chosen accounts, then reports how each account filled so the provider can reconcile differences. A wave can be cancelled before it is sent if conditions change.

Example prompt: Call POST `/v1/execution-waves` to place one trade across several accounts, then GET `/v1/execution-waves/{id}` to follow how each account filled

### Position and History Monitoring

A dashboard or risk workflow tracks a trading account's live state and realized history. fxapis returns the open positions on an account and its full deal history, so an agent can watch exposure in real time and reconcile closed trades. The reconcile endpoint confirms pending results with the broker when a figure looks stale.

Example prompt: Call GET `/v1/accounts/{id}/positions` for open positions and GET `/v1/accounts/{id}/deals` for the account's closed deal history

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/v1/accounts` | Connect an MT5 account |
| GET | `/v1/accounts/{id}/positions` | Positions on an account |
| POST | `/v1/accounts/{id}/orders/market` | Place a market order |
| POST | `/v1/accounts/{id}/orders/pending` | Place a limit, stop, or stop-limit order |
| POST | `/v1/accounts/{id}/positions/{positionId}/close` | Close a position |
| GET | `/v1/accounts/{id}/deals` | An account's full deal history |
| POST | `/v1/execution-waves` | Place one trade on many accounts |
| POST | `/v1/accounts/{id}/calculate` | Margin required or profit at a price |

## Key resources

- **Accounts** — Connect, warm, cool, and inspect MT5 accounts via `/v1/accounts` and its sub-resources
- **Orders and Positions** — Place market and pending orders and manage positions via `/v1/accounts/{id}/orders` and `/v1/accounts/{id}/positions`
- **Execution Waves** — Place and follow one trade across many accounts via `/v1/execution-waves`
- **Market Reference** — Read instruments, broker symbols, and market hours via `/v1/instruments` and `/v1/accounts/{id}/symbols`
- **Workspace** — Manage keys, alert hooks, webhooks, billing, and members via `/v1/api-keys`, `/v1/alert-hooks`, `/v1/webhooks`, and `/v1/billing`

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 51 / 100
- **Maturity:** Foundational
- **Dimensions:**
  - Foundational Compliance: 99 / 100
  - Developer Experience & Jentic Compatibility: 65 / 100
  - AI-Readiness & Agent Experience: 25 / 100
  - Agent Usability: 89 / 100
  - Security: 60 / 100
  - AI Discoverability: 78 / 100
- **View full report:** https://jentic.com/apis/fxapis.com/fxapis/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring fxapis by hand means handling its bearer auth with an fx_live_ key, connecting and warming each MetaTrader 5 account, and polling account status and reconciliation yourself. Through Jentic you install once, import fxapis from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** fxapis puts the account id in the URL path (`/v1/accounts/{id}/...`), so a rule can pin your agent to one connected account: it can read that account's positions and deals and place orders on it, and nothing else. You choose which operations it may call, so destructive ones like deleting an account or revoking a key are not included unless you add them.
- **Credential handling:** Your fxapis key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'place a market order' or 'read my open positions', and Jentic returns the matching fxapis operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Alpaca Trading** — Commission-free US equities and crypto trade execution over a REST API
- **Tradier** — Brokerage API for US equities and options order placement and account data
- **Polygon** — Real-time and historical market data for stocks, options, forex, and crypto

## FAQ

### What authentication does the fxapis API use?

The fxapis API authenticates with a bearer token per its OpenAPI spec: you send an Authorization header carrying an fx_live_ or fx_test_ key, and each key's scopes decide what it can do, so a key without the accounts write scope can read accounts but not change them. The liveness and readiness endpoints are open. Through Jentic the key is stored encrypted by your own Jentic One instance and injected at execution time, so it never reaches the agent.

### What are the rate limits for the fxapis API?

The OpenAPI spec does not specify request rate limits. fxapis meters usage for billing instead: the billing usage operations report this month's usage and what it would cost, and the plans endpoint lists the available plans. See https://api.fxapis.com for current terms.

### Can I place trades with the fxapis API?

Yes. POST `/v1/accounts/{id}/orders/market` places a market order and POST `/v1/accounts/{id}/orders/pending` places a limit, stop, or stop-limit order on a connected account. You can modify or close the resulting position, and POST `/v1/execution-waves` places one trade across several accounts at once.

### Is there an fxapis MCP server?

You don't need an MCP server to give your agent fxapis. Jentic connects it directly from the API Directory: import it and your agent calls the account, order, and position operations on demand, discovering each operation's schema when it needs it rather than loading a separate server's tool definitions into context.

### How do I place a trade with the fxapis API through Jentic?

Search Jentic for 'place a market order on my MT5 account', and it returns the fxapis order operation with its input schema. Load it and execute POST `/v1/accounts/{id}/orders/market` with the key injected at run time. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Can I limit what my agent is allowed to do with the fxapis API?

Yes. Because fxapis carries the account id in the URL path, write a rule that allows only the read and order operations for one account id, so the agent can place trades and read deals on that account but cannot delete it, rotate keys, or touch another account. Every call runs through your own instance, so each one is logged for you to review.
