Machine-friendly, flattened Markdown of the OKX V5 REST API, generated from the official documentation source. Built for AI agents and tooling to read and to write/verify OKX API integration code across multiple sites.
The primary lookup flow is for REST endpoints: endpoint path -> module index -> site/language doc. WebSocket Markdown is included when present as supplemental documentation and can be searched when needed, but it does not have the same deterministic REST endpoint routing/index.
Generated content — do not edit by hand.
sites.jsonandindex.jsoneach carry aversion(semver) and agenerated_attimestamp so you can tell which release you are reading.
This repository ships a self-contained skill: the okx-v5-api skill and all
of its data live together under skills/okx-v5-api/. Installing the skill (e.g.
npx skills add) brings the routing tables and the endpoint bodies with it —
there is nothing else to clone and no path to configure.
skills/okx-v5-api/ # self-contained okx-v5-api skill
SKILL.md # the skill (router instructions)
sites.json # site -> REST and WS domains (+ version, generated_at)
index/ # layered lookup tables (primary navigation)
modules.md # module list + per-site endpoint counts
<module>.md # one table per module: method|path|name|doc|per-site supported
index.json # full machine index: every endpoint, per-site "supported" + doc path (+ version, generated_at)
docs/<site>/<lang>/...md # endpoint bodies (usually one endpoint per file)
LICENSE # MIT (bundled so the standalone skill carries its own license)
README.md # this file
LICENSE # MIT (repo-level)
Other skills may live alongside under skills/ (e.g. an integration guide); they
are maintained independently of this generated okx-v5-api corpus.
sites.json and index.json carry a version field using semver
MAJOR.MINOR.PATCH (a bare string, e.g. 0.1.0 — no v prefix):
- MAJOR — breaking change to the data format (layout/schema). Tooling that consumes these files may need updating.
- MINOR — endpoints added or changed.
- PATCH — documentation fixes.
generated_at records when the build was produced. Use version to check
compatibility and generated_at for freshness.
- Sites:
okex(Global),us,my(EEA),turkey(Hong Kong is not covered). Each site's docs are flattened and self-contained — the domain and the set of supported endpoints already reflect that site. Do not assume the Global site's endpoints or domain apply elsewhere. - Languages:
enandzh. - Each endpoint Markdown file carries YAML frontmatter (
method,path,site,lang,rest,ws,module) so tools can read the essentials without parsing prose. - Some multi-endpoint source pages are preserved as one Markdown file and marked
multi_endpoint: true. Those files include anEndpoint sectionstable near the top so AI agents can locate a targetmethod pathand read only the matching section. In multi-endpoint files, the frontmattermethod/pathidentifies the first endpoint only; useindex.jsonplus the target section for the endpoint-specific method/path.
All paths below are relative to skills/okx-v5-api/. index/ is the primary way
to find an endpoint. It is plain Markdown — no code, no runtime, all local.
index/modules.mdlists every module with its total endpoint count and how many are supported per site — a quick overview and jump-off point.index/<module>.mdis a small table for one module. The module is the 2nd path segment (/api/v5/<module>/..., e.g./api/v5/trade/order→trade). Each row hasmethod | path | name | docplus a per-site✓ / ✗column.index.jsonremains available as the full machine index (per-sitedocis a per-language{ "en": ..., "zh": ... }map), but for lookups prefer theindex/tables — they are smaller and easier to scan.
All data paths are relative to skills/okx-v5-api/.
- Read
sites.jsonto get the target site'srestdomain. Use that as the REST base URL - never hardcode a single global domain.sites.jsonalso carrieswsdomains for supplemental WebSocket docs. - Derive the module from the endpoint path (2nd segment) and open
index/<module>.md. Confirm the endpoint's column for your site is✓. If it is✗(not supported), do not generate that call. - The module table's
docis a reference path. For the exact per-site/per-lang path, look up the endpoint inindex.jsonbymethod+path, takesites.<site>.doc.<lang>, and readdocs/<site>/<lang>/<that>(or more generally<docs_dir>/<lang>/<that>, wheredocs_dircomes fromsites.json, e.g.docs/us→docs/us/en/<that>). For normal single-endpoint files, YAML frontmatter carries the endpointmethod/path/rest/ws; the prose covers parameters, response, and rate limits.- If the doc frontmatter has
multi_endpoint: true, do not read the entire file for a single endpoint. Use the generatedEndpoint sectionstable orrg -n -F "<search key>" docs/<site>/<lang>/<that>to locate the target section, then read only that section and nearby shared definitions. For these files, keep the targetmethod/pathfromindex.jsonor the matched section; the file frontmattermethod/pathnames only the first endpoint in the file.
- If the doc frontmatter has
The skills/okx-v5-api/ skill is pure Markdown + bundled data — no Python, no
scripts, no runtime dependency, and no network at query time. Unlike earlier
releases, the routing layer and the endpoint bodies now travel with the skill,
so there is nothing separate to clone and no docs_path/config file to set up.
npx skills add (or copying the skills/okx-v5-api/ directory) installs
SKILL.md together with sites.json, index.json, index/, and docs/. The
skill resolves everything relative to its own directory:
- Route: read
sites.json+index/(next toSKILL.md) to find the site domain, per-site support, and the targetdocpath. - Read the body: open
docs/<site>/<lang>/<doc>under the skill directory.
Generated from the upstream OKX V5 API documentation source; see version and
generated_at in sites.json / index.json for the exact release. For the
authoritative, always-current reference, see the official OKX API documentation.
This mirror is provided to make the docs consumable by AI tooling; verify against
the official docs before relying on it in production.