API Reference (x402)

Developer x402 API

Technical specifications for Minara's x402 endpoints using the Pay-As-You-Go model.

Base URL: https://x402.minara.ai

Chat (Base Chain)

post

Ask Minara AI - Intelligent crypto assistant

Authorizations
x-payment-responsestringRequired

Payment proof token obtained from x402 payment challenge flow. Required after completing payment.

Body
userQuerystringRequired

Required. User query content.

Responses
chevron-right
201

Successful response

application/json
post
/x402/chat

Chat Expert (Base Chain)

post

Ask Minara AI - Intelligent crypto assistant

Authorizations
x-payment-responsestringRequired

Payment proof token obtained from x402 payment challenge flow. Required after completing payment.

Body
userQuerystringRequired

Required. User query content.

Responses
chevron-right
201

Successful response

application/json
post
/x402/chat/expert

Chat (Polygon Chain)

post

Ask Minara AI - Intelligent crypto assistant

Authorizations
x-payment-responsestringRequired

Payment proof token obtained from x402 payment challenge flow. Required after completing payment.

Body
userQuerystringRequired

Required. User query content.

Responses
chevron-right
201

Successful response

application/json
post
/x402/polygon/chat

Chat Expert (Polygon Chain)

post

Ask Minara AI - Intelligent crypto assistant

Authorizations
x-payment-responsestringRequired

Payment proof token obtained from x402 payment challenge flow. Required after completing payment.

Body
userQuerystringRequired

Required. User query content.

Responses
chevron-right
201

Successful response

application/json
post
/x402/polygon/chat/expert

Chat (Solana Chain)

post

Ask Minara AI - Intelligent crypto assistant

Authorizations
x-payment-responsestringRequired

Payment proof token obtained from x402 payment challenge flow. Required after completing payment.

Body
userQuerystringRequired

Required. User query content.

Responses
chevron-right
201

Successful response

application/json
post
/x402/solana/chat

Chat Expert (Solana Chain)

post

Ask Minara AI - Intelligent crypto assistant

Authorizations
x-payment-responsestringRequired

Payment proof token obtained from x402 payment challenge flow. Required after completing payment.

Body
userQuerystringRequired

Required. User query content.

Responses
chevron-right
201

Successful response

application/json
post
/x402/solana/chat/expert

Perpetual Trading Suggestion

post

Get AI-powered perpetual trading suggestions with long/short recommendations, entry price, stop loss, take profit levels, and confidence score.

Authorizations
x-payment-responsestringRequired

Payment proof token obtained from x402 payment challenge flow. Required after completing payment.

Body
symbolstringRequired

Required. Trading symbol (e.g., 'BTC', 'ETH', 'SOL').

stylestring · enumOptional

Optional. Trading style: 'scalping', 'day-trading', or 'swing-trading'. Default: 'scalping'.

Default: scalpingPossible values:
marginUSDnumberOptional

Optional. Margin in USD. Default: 1000.

Default: 1000
leveragenumber · min: 1 · max: 40Optional

Optional. Leverage multiplier (max: 40). Default: 10.

Default: 10
strategystringOptional

Optional. Strategy type. Default: 'max-profit'. More strategies coming soon.

Default: max-profit
Responses
chevron-right
201

Successful response

application/json
post
/x402/perp-trading-suggestion

Intent to Swap Transaction

post

Convert natural language trading intent into an executable swap transaction payload. Compatible with OKX DEX by default.

Authorizations
x-payment-responsestringRequired

Payment proof token obtained from x402 payment challenge flow. Required after completing payment.

Body
intentstringRequired

Required. Natural language swap intent (e.g., 'swap 0.1 ETH to USDC').

walletAddressstringRequired

Required. User wallet address (0x...).

chainstringOptional

Optional. Chain name (e.g., 'base', 'ethereum', 'bsc', 'arbitrum', 'optimism').

Responses
chevron-right
201

Successful response

application/json
post
/x402/intent-to-swap-tx

Prediction Market Analysis (Base Chain)

post

AI-powered prediction market analysis. Analyze prediction market events and get probability estimates for each outcome with detailed reasoning.

Authorizations
x-payment-responsestringRequired

Payment proof token obtained from x402 payment challenge flow. Required after completing payment.

Body
linkstringRequired

Required. Prediction market page link (e.g., Polymarket event URL).

modestring · enumRequired

Required. Chat mode: 'fast' or 'expert'.

Possible values:
only_resultbooleanOptional

Optional. Only return prediction probabilities without reasoning. Default: false.

Default: false
customPromptstringOptional

Optional. Custom instructions to guide the analysis. Use this to specify focus areas, risk preferences, or analysis style.

Responses
chevron-right
201

Successful response

application/json
post
/x402/prediction-market-ask

Endpoints

Chat (Base Chain)

Endpoint: POST /x402/chat

Request

Headers:

  • x-payment-response (required) - Payment proof token from x402 protocol

  • Content-Type: application/json

Body Parameters:

Parameter
Type
Required
Description

userQuery

string

Yes

User query content

Example Request

Response

Status: 201 Created


Chat Expert (Base Chain)

Endpoint: POST /x402/chat/expert

Ask Minara AI - Intelligent crypto assistant on Base chain with expert mode

Request

Headers:

  • x-payment-response (required) - Payment proof token from x402 protocol

  • Content-Type: application/json

Body Parameters:

Parameter
Type
Required
Description

userQuery

string

Yes

User query content

Example Request

Response

Status: 201 Created


Chat (Solana Chain)

Endpoint: POST /x402/solana/chat

Request

Headers:

  • x-payment-response (required) - Payment proof token from x402 protocol

  • Content-Type: application/json

Body Parameters:

Parameter
Type
Required
Description

userQuery

string

Yes

User query content

Example Request

Response

Status: 201 Created

Chat Expert (Solana Chain)

Endpoint: POST /x402/solana/chat/expert

Ask Minara AI - Intelligent crypto assistant on Solana chain with expert mode

Request

Headers:

  • x-payment-response (required) - Payment proof token from x402 protocol

  • Content-Type: application/json

Body Parameters:

Parameter
Type
Required
Description

userQuery

string

Yes

User query content

Example Request

Response

Status: 201 Created


Chat (Polygon Chain)

Endpoint: POST /x402/polygon/chat

Ask Minara AI - Intelligent crypto assistant on Polygon chain

Request

Headers:

  • x-payment-response (required) - Payment proof token from x402 protocol

  • Content-Type: application/json

Body Parameters:

Parameter
Type
Required
Description

userQuery

string

Yes

User query content

Example Request

Response

Status: 201 Created


Chat Expert (Polygon Chain)

Endpoint: POST /x402/polygon/chat/expert

Ask Minara AI - Intelligent crypto assistant on Polygon chain with expert mode

Request

Headers:

  • x-payment-response (required) - Payment proof token from x402 protocol

  • Content-Type: application/json

Body Parameters:

Parameter
Type
Required
Description

userQuery

string

Yes

User query content

Example Request

Response

Status: 201 Created


Trading Endpoints

Intent to Swap Transaction

Endpoint: POST /x402/intent-to-swap-tx

Convert natural language trading intent into an executable swap transaction payload. Compatible with OKX DEX by default.

Request

Headers:

  • x-payment-response (required) - Payment proof token from x402 protocol

  • Content-Type: application/json

Body Parameters:

Parameter
Type
Required
Description

intent

string

Yes

Natural language swap intent (e.g., "swap 0.1 ETH to USDC")

walletAddress

string

Yes

User wallet address (0x...)

chain

string

No

Chain name (e.g., "base", "ethereum", "bsc", "arbitrum", "optimism")

Example Request

Response

Status: 201 Created


Perpetual Trading Suggestion

Endpoint: POST /x402/perp-trading-suggestion

Get AI-powered perpetual trading suggestions with long/short recommendations, entry price, stop loss, take profit levels, and confidence score based on comprehensive market analysis.

Request

Headers:

  • x-payment-response (required) - Payment proof token from x402 protocol

  • Content-Type: application/json

Body Parameters:

Parameter
Type
Required
Default
Description

symbol

string

Yes

-

Trading symbol (e.g., "BTC", "ETH", "SOL")

style

string

No

"scalping"

Trading style: "scalping", "day-trading", or "swing-trading"

marginUSD

number

No

1000

Margin in USD

leverage

number

No

10

Leverage multiplier (max: 40)

strategy

string

No

"max-profit"

Strategy type (more strategies coming soon)

Example Request

Response

Status: 201 Created


Prediction Market Analysis (Base Chain)

Endpoint: POST /x402/prediction-market-ask

AI-powered prediction market analysis. Analyze prediction market events and get probability estimates for each outcome with detailed reasoning.

Request

Headers:

  • x-payment-response (required) - Payment proof token from x402 protocol

  • Content-Type: application/json

Body Parameters:

Parameter
Type
Required
Default
Description

link

string

Yes

-

Prediction market page link (e.g., Polymarket event URL)

mode

string

Yes

-

Chat mode: "fast" or "expert"

only_result

boolean

No

false

Only return prediction probabilities without reasoning

customPrompt

string

No

-

Custom instructions to guide the analysis

Example Request

Response

Status: 201 Created


Prediction Market Analysis (Polygon Chain)

Endpoint: POST /x402/polygon/prediction-market-ask

AI-powered prediction market analysis on Polygon chain. Same functionality as Base chain endpoint.

Request

Headers:

  • x-payment-response (required) - Payment proof token from x402 protocol

  • Content-Type: application/json

Body Parameters:

Same as Base chain endpoint above.

Example Request

Response

Status: 201 Created

Same response format as Base chain endpoint.


Error Responses

402 Payment Required

Initial request without payment credentials will return:

401 Unauthorized

Invalid or expired payment proof:

400 Bad Request

Invalid request parameters:


Rate Limits

x402 endpoints are rate-limited per wallet address:

  • AI Endpoints: 60 requests per minute

  • Trading Endpoints: 30 requests per minute

Exceeding rate limits will return:


Notes

  • All x402 endpoints require the x-payment-response header after completing the payment challenge

  • Prices are subject to change based on network conditions

  • For more information on x402 protocol, see x402 Documentationarrow-up-right

Last updated

Was this helpful?