For the complete documentation index, see llms.txt. This page is also available as Markdown.

x402

x402 — это метод доступа к API с оплатой за использование, не требующий подписки. Вы платите за каждый вызов напрямую, используя стейблкоины, такие как USDC, в Base, Solana или Polygon.

Конечная точка Minara x402: https://x402.minara.ai

Изучите все конечные точки: Minara на x402scan


Как работает x402

x402 следует схеме платежного вызова:

  1. Вы отправляете запрос к защищённой конечной точке без оплаты.

  2. Сервер отвечает 402 Требуется оплата и инструкциями по оплате (сумма, валюта, адрес получателя, сеть).

  3. Вы включаете подтверждение оплаты в x-payment-response заголовок и повторяете запрос.

  4. Сервер проверяет подтверждение, обрабатывает платёж в блокчейне и возвращает ответ API.

Рекомендуемый подход — использовать SDK x402, который автоматически обрабатывает этот поток.


Начало работы с SDK

Предварительные требования

  • Криптокошелёк с USDC (любой EVM-совместимый кошелёк или кошелёк Solana)

  • Node.js / Python / Go

  • Приватный ключ вашего кошелька (для подписания платежей)

Установка

Выполните запрос

SDK автоматически обрабатывает платежные вызовы. Просто выполняйте запросы как обычно.

Полный краткий старт по x402 см. в документации x402.


Справка по API

Базовый URL: https://x402.minara.ai

Все конечные точки требуют x-payment-response заголовка (SDK обрабатывает это автоматически).

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
201

Successful response

application/json
contentstringOptional

AI response content.

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
201

Successful response

application/json
contentstringOptional

AI response content.

post/x402/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
201

Successful response

application/json
entryPricenumberOptional

Recommended entry price.

sidestring · enumOptional

Trading side recommendation.

Possible values:
stopLossPricenumberOptional

Recommended stop loss price.

takeProfitPricenumberOptional

Recommended take profit price.

confidencenumber · max: 100Optional

Confidence score (0-100).

reasonsstring[]Optional

Analysis reasons based on technical indicators.

risksstring[]Optional

Risk factors to consider.

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
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
201

Successful response

application/json
reasoningstringOptional

AI reasoning and analysis (empty if only_result=true).

post/x402/prediction-market-ask

Конечные точки для нескольких сетей

Варианты для Solana и Polygon доступны по адресу /x402/solana/chat, /x402/solana/chat/expert, /x402/polygon/chat и /x402/polygon/chat/expert с одинаковой структурой запроса/ответа.


Обработка ошибок

Код
Ошибка
Значение

402

payment_required

Нормально — SDK обрабатывает это автоматически

401

unauthorized

Подтверждение платежа недействительно или истекло

400

bad_request

Отсутствуют или недействительны параметры запроса

429

rate_limit_exceeded

Конечные точки ИИ: 60 запросов/мин; торговые конечные точки: 30 запросов/мин


Ресурсы

Последнее обновление

Это было полезно?