{ "openapi": "3.0.0", "info": { "title": "GlueX Router v1 API", "version": "1.0.0", "description": "API for interacting with the GlueX Router v1." }, "servers": [ { "url": "https://router.gluex.xyz", "description": "Production" } ], "components": { "securitySchemes": { "ApiKeyAuth": { "type": "apiKey", "in": "header", "name": "x-api-key" } }, "schemas": { "PriceRequest": { "allOf": [ { "type": "object", "properties": { "chainID": { "type": "string", "example": "ethereum" }, "inputToken": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "example": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" }, "outputToken": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "example": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" }, "inputAmount": { "type": "string", "example": "1000000000000000000" }, "orderType": { "type": "string", "enum": ["SELL", "BUY"] }, "userAddress": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "example": "0x174F75176b73124627116653085Ce9585E261388" }, "outputReceiver": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "example": "0x9A6D76cB905Df126832AEB1802A27a1b37a6e872" }, "uniquePID": { "type": "string", "example": "866a61811189692e8eccae5d2759724a812fa6f8703ebffe90c29dc1f886bbc1" } }, "required": [ "inputToken", "outputToken", "userAddress", "outputReceiver", "uniquePID" ] }, { "oneOf": [ { "required": ["chainID"] }, { "required": ["networkID"] } ] }, { "oneOf": [ { "required": ["inputAmount", "orderType"], "properties": { "orderType": { "enum": ["SELL"] } } }, { "required": ["outputAmount", "orderType"], "properties": { "orderType": { "enum": ["BUY"] } } } ] } ] }, "QuoteRequest": { "allOf": [ { "type": "object", "properties": { "chainID": { "type": "string", "example": "ethereum" }, "inputToken": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "example": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" }, "outputToken": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "example": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" }, "inputAmount": { "type": "string", "example": "1000000000000000000" }, "orderType": { "type": "string", "enum": ["SELL", "BUY"] }, "userAddress": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "example": "0x174F75176b73124627116653085Ce9585E261388" }, "outputReceiver": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "example": "0x9A6D76cB905Df126832AEB1802A27a1b37a6e872" }, "uniquePID": { "type": "string", "example": "866a61811189692e8eccae5d2759724a812fa6f8703ebffe90c29dc1f886bbc1" } }, "required": [ "inputToken", "outputToken", "inputAmount", "userAddress", "outputReceiver", "uniquePID" ] }, { "oneOf": [ { "required": ["chainID"] }, { "required": ["networkID"] } ] }, { "oneOf": [ { "required": ["inputAmount", "orderType"], "properties": { "orderType": { "enum": ["SELL"] } } }, { "required": ["outputAmount", "orderType"], "properties": { "orderType": { "enum": ["BUY"] } } } ] } ] }, "CommonResponse": { "type": "object", "properties": { "inputToken": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "example": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" }, "outputToken": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "example": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" }, "feeToken": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "example": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" }, "inputSender": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "example": "0x174F75176b73124627116653085Ce9585E261388" }, "outputReceiver": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "example": "0x9A6D76cB905Df126832AEB1802A27a1b37a6e872" }, "inputAmount": { "type": "string", "example": "1000000000000000000" }, "outputAmount": { "type": "string", "example": "1000000000000000000" }, "partnerFee": { "type": "string", "example": "0" }, "routingFee": { "type": "string", "example": "0" }, "effectiveInputAmount": { "type": "string", "example": "1000000000000000000" }, "effectiveOutputAmount": { "type": "string", "example": "1000000000000000000" }, "minOutputAmount": { "type": "string", "example": "1000000000000000000" }, "isNativeTokenInput": { "type": "boolean", "example": true }, "value": { "type": "string", "example": "1000000000000000000" }, "router": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$", "example": "0x6Ec7612828B776cC746fe0Ee5381CC93878844f7" } } }, "PriceResponse": { "allOf": [ { "$ref": "#/components/schemas/CommonResponse" }, { "type": "object", "properties": { "surgeValue": { "type": "integer", "example": 0 } } } ] }, "QuoteResponse": { "allOf": [ { "$ref": "#/components/schemas/CommonResponse" }, { "type": "object", "properties": { "calldata": { "type": "string" }, "revert": { "type": "boolean", "example": false }, "computationUnits": { "type": "integer", "example": 2000000 }, "lowBalance": { "type": "boolean", "example": false }, "blockNumber": { "type": "integer", "example": 12345678 }, "simulation": { "type": "string" } } } ] } } }, "security": [{ "ApiKeyAuth": [] }], "paths": { "/liquidity": { "get": { "summary": "Retrieve available chains and liquidity modules", "description": "Fetches a list of supported blockchain networks and their associated liquidity modules.", "responses": { "200": { "description": "Successful response containing available chains and liquidity modules.", "content": { "application/json": { "schema": { "type": "object", "properties": { "chains": { "type": "array", "items": { "type": "object", "properties": { "chainID": { "type": "string" }, "networkID": { "type": "string" } } } }, "liquidityModules": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } } } } } } } } } }, "/v1/price": { "post": { "summary": "Get swap price estimate (no calldata)", "parameters": [ { "in": "header", "name": "x-api-key", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PriceRequest" } } } }, "responses": { "200": { "description": "Price estimate response", "content": { "application/json": { "schema": { "type": "object", "properties": { "statusCode": { "type": "integer", "example": 200 }, "result": { "$ref": "#/components/schemas/PriceResponse" } }, "required": ["statusCode", "result"] } } } } } } }, "/v1/quote": { "post": { "summary": "Get full swap quote with calldata", "parameters": [ { "in": "header", "name": "x-api-key", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QuoteRequest" } } } }, "responses": { "200": { "description": "Quote response", "content": { "application/json": { "schema": { "type": "object", "properties": { "statusCode": { "type": "integer", "example": 200 }, "result": { "$ref": "#/components/schemas/QuoteResponse" } }, "required": ["statusCode", "result"] } } } } } } } } }