The PMXT SDKs manage a local server automatically. When you create an exchange instance without a hosted API key, the SDK spawns a local server process, waits for it to become healthy, and routes every request through it. TheDocumentation Index
Fetch the complete documentation index at: https://pmxt-feat-series-api.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
server namespace gives you explicit control over that local server
lifecycle.
Quick reference
| Method | Description |
|---|---|
server.start() | Start the local server if it is not already running (idempotent). |
server.stop() | Stop the running local server (SIGTERM + lock file cleanup). |
server.restart() | Stop then start. |
server.status() | Structured snapshot: running, pid, port, version, uptime. |
server.health() | true/True if /health responds OK, false/False otherwise. |
server.logs(n) | Last n lines from ~/.pmxt/server.log (default 50). |
Start
Idempotent. If the local server is already running and healthy, returns immediately. Otherwise spawnspmxt-ensure-server and waits for the
health check.
- Python
- TypeScript
You rarely need to call
start() yourself — creating an exchange
instance (e.g. pmxt.Polymarket()) calls it automatically.Stop
Reads the lock file at~/.pmxt/server.lock, sends SIGTERM to the
local server process, and removes the lock file.
- Python
- TypeScript
Restart
Equivalent tostop() followed by start().
- Python
- TypeScript
Status
Returns a structured snapshot of the local server state. A new object is returned on every call (no shared mutable references).- Python
- TypeScript
| Field | Type | Description |
|---|---|---|
running | bool | Whether the local server is alive and responding to /health. |
pid | int | null | Process ID from the lock file. |
port | int | null | Port the local server is listening on (default 3847). |
version | string | null | Server version from the lock file. |
uptime_seconds / uptimeSeconds | float | null | Seconds since the lock file was written. |
lock_file / lockFile | string | Absolute path to ~/.pmxt/server.lock. |
Health
Returnstrue/True if the local server’s /health endpoint responds with
{"status": "ok"}, false/False otherwise.
- Python
- TypeScript
Logs
Returns the last n lines from~/.pmxt/server.log. Defaults to 50.
Returns an empty list/array if the log file does not exist.
- Python
- TypeScript
Deprecated aliases
The top-levelstop_server() / stopServer() and restart_server() /
restartServer() functions still work but emit deprecation warnings. Use
the server namespace instead.
Environment variables
| Variable | Effect |
|---|---|
PMXT_ALWAYS_RESTART=1 | Force-restart the local server on every ensure_server_running / ensureServerRunning call (useful during development). |

