OpenAPI Spec
dex-skills includes an OpenAPI 3.1 specification that describes all operations as RESTful endpoints. Use it to generate REST API wrappers, client libraries, or documentation in any language.
Loading the Spec
From the SDK
load-spec.ts
import { openApiSpec } from "dex-skills";
// openApiSpec is a parsed JavaScript object
console.log(openApiSpec.info.title); // "dex-skills"
console.log(openApiSpec.info.version); // package version From the JSON file
The raw JSON file is available at
dist/openapi.json in the
published package. Load it directly when you need the spec outside of a Node.js context:
Terminal
cat node_modules/dex-skills/dist/openapi.json Endpoints
The spec defines four endpoints:
| Method | Path | Description |
|---|---|---|
| GET | /platforms | List supported platforms and their capabilities. |
| POST | /launch | Launch a new token on the specified platform. |
| GET | /tokens/{platform}/{address} | Get detailed info for a specific token. |
| GET | /tokens/{platform} | List tokens with optional sorting and pagination. |
Spec Structure
openapi.json (abbreviated)
{
"openapi": "3.1.0",
"info": {
"title": "dex-skills",
"description": "Multi-chain DEX launchpad API",
"version": "1.0.0"
},
"paths": {
"/platforms": {
"get": {
"operationId": "listPlatforms",
"summary": "List supported platforms",
"responses": {
"200": {
"description": "Array of platform objects",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": { "$ref": "#/components/schemas/PlatformInfo" }
}
}
}
}
}
}
},
"/launch": {
"post": {
"operationId": "launchToken",
"summary": "Launch a new token",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/LaunchParams" }
}
}
},
"responses": {
"200": {
"description": "Launch result",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/LaunchResult" }
}
}
}
}
}
},
"/tokens/{platform}/{address}": {
"get": {
"operationId": "getTokenInfo",
"summary": "Get token information",
"parameters": [
{ "name": "platform", "in": "path", "required": true, "schema": { "type": "string" } },
{ "name": "address", "in": "path", "required": true, "schema": { "type": "string" } }
],
"responses": {
"200": {
"description": "Token information",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/TokenInfo" }
}
}
}
}
}
},
"/tokens/{platform}": {
"get": {
"operationId": "listTokens",
"summary": "List tokens from a platform",
"parameters": [
{ "name": "platform", "in": "path", "required": true, "schema": { "type": "string" } },
{ "name": "limit", "in": "query", "schema": { "type": "integer", "default": 20 } },
{ "name": "sortBy", "in": "query", "schema": { "type": "string", "default": "createdAt" } },
{ "name": "sortOrder", "in": "query", "schema": { "type": "string", "default": "desc" } }
],
"responses": {
"200": {
"description": "Array of token objects",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": { "$ref": "#/components/schemas/TokenInfo" }
}
}
}
}
}
}
}
}
} Building a REST API Wrapper
You can use the OpenAPI spec to generate server stubs or client code with any compatible
code generator. For example, with
openapi-generator-cli:
Terminal
# Generate a Python client
npx @openapitools/openapi-generator-cli generate -i node_modules/dex-skills/dist/openapi.json -g python -o ./generated/python-client
# Generate an Express server stub
npx @openapitools/openapi-generator-cli generate -i node_modules/dex-skills/dist/openapi.json -g nodejs-express-server -o ./generated/express-server Schema components
The full spec includes
components/schemas definitions
for all types (Platform, Chain, LaunchParams, LaunchResult, TokenInfo, ListTokensParams).
See the Types reference for the
corresponding TypeScript definitions.