# The /v1 platform API

> Index of every docs page as Markdown: [llms.txt](https://fxsocket.com/docs/llms.txt). All pages in one file: [llms-full.txt](https://fxsocket.com/llms-full.txt).

Source: https://fxsocket.com/docs/api

Every connected trading account has its own terminal, with its own REST and WebSocket API. The platform API is the layer above that: the endpoints that are about your whole account rather than one terminal. Trade across many accounts in one call, and fund them from a prepaid balance. It spans MetaTrader 4 and MetaTrader 5 alike, so the same batch can carry both.

Base URL: `https://api.fxsocket.com/v1`

Same authentication as the rest of the API: an `X-API-Key` header carrying the key from your [API Key page](https://app.fxsocket.com/dashboard/api-key). Paths have no trailing slash and are not rewritten, so `/v1/orders` is exact. Anything that moves money or places a trade needs the full `fxs_live_` key; a read-only `fxs_ro_` key can call every GET here and gets a `403` on the rest.

## Explore the platform API

- [Multi-account execution](https://fxsocket.com/docs/api/batch-orders.md): One order to many accounts, and selector-based closes across them.
- [Balance & top-ups](https://fxsocket.com/docs/api/wallet.md): Prepaid balance, crypto top-ups, seats and upcoming charges.

## Per-account routes live elsewhere

Linking accounts, reading balances and positions, quotes and price history, single-account order execution and the live WebSocket streams are all documented per terminal: [MetaTrader 5](https://fxsocket.com/docs/mt5.md) and [MetaTrader 4](https://fxsocket.com/docs/mt4.md). The `account_id` those pages talk about is the same one you pass to the batch endpoints here.

## OpenAPI and SDKs

The whole `/v1` surface, including everything on these pages, is published as OpenAPI 3 and browsable without a key:

- Swagger UI: https://api.fxsocket.com/v1/docs
- Raw spec: https://api.fxsocket.com/v1/schema: point any OpenAPI generator at this URL.

The official SDKs wrap it with typed models: `pip install fxsocket` ([PyPI](https://pypi.org/project/fxsocket/)) and `npm install @fxsocket/sdk` ([npm](https://www.npmjs.com/package/@fxsocket/sdk)).

For AI agents there is a read-only [MCP server](https://fxsocket.com/docs/mcp.md) over the same accounts and keys.
