# Introduction

Source: https://docs.pipsocket.com/

Hosted MT5 accounts behind an API.

Pipsocket runs your MT5 accounts on its own hosts, each in its own MT5 terminal, and gives you one API for all of them: trade, read positions and history, and get prices and fills as they happen.

## How a call works

Every call is for one account:

```text
https://api.pipsocket.com/v1/accounts/{account}/...
Authorization: Bearer $PIPSOCKET_KEY
```

The API checks your workspace's key, finds the host that runs the account, and hands the call to the account's terminal. Hosts don't accept connections from the internet: each keeps one connection open to Pipsocket, and calls and events travel over it.

## One call, one MT5 request

A trade call is exactly one MT5 trade request (`MqlTradeRequest`), sent once:

- **Nothing is changed.** No splitting, no retries, no rounding, no picked filling mode. Fields you leave out are MT5's own empty values (0, `""`, `gtc`).
- **MT5's answer, as it is.** A fill and a rejection both come back as `200` with MT5's `retcode`. A rejection is not an HTTP error: read the `retcode`.
- **5 seconds for the broker.** If the trade server hasn't answered by then, you get `202` with `"state": "pending"`. The request is never sent again; [look it up](/api/look-up-a-request) or watch for it on the [stream](/websocket).
- **Safe to retry.** Send an `Idempotency-Key` and a repeat returns the first request instead of trading again.

## What's here

- [Quickstart](/quickstart): your first calls, from key to a closed position.
- [Authentication](/authentication): your workspace's key, and rolling it.
- [Accounts and ids](/accounts): account ids, tickets, request ids, and times.
- [API reference](/api/place-an-order): every call, its fields with their MT5 fields, and its answers.
- [The WebSocket stream](/websocket): fills, deals, prices and the account as they happen, and calls over the same socket.
- [Errors and retcodes](/errors), the [MT5 field map](/mt5-field-map) and [rate limits](/rate-limits).

The API reference is generated from the engine's own routes, and the whole API is also an [OpenAPI document](/openapi.json). For tools and LLMs, [`/llms.txt`](/llms.txt) lists every page as Markdown, and [`/llms-full.txt`](/llms-full.txt) is all of them in one file.

