> For the complete documentation index, see [llms.txt](https://minara.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://minara.ai/docs/minara-handbook/tr/islem-yap/agent-api/api-reference-x402.md).

# API Referansı (x402)

### Geliştirici x402 API

Pay-As-You-Go modelini kullanan Minara'nın x402 uç noktaları için teknik özellikler.

**Temel URL**: `https://x402.minara.ai`

## Chat (Base Chain)

> Ask Minara AI - Intelligent crypto assistant

```json
{"openapi":"3.0.0","info":{"title":"Minara x402 API","version":"1.0"},"servers":[{"url":"https://x402.minara.ai"}],"security":[{"x402Payment":[]}],"components":{"securitySchemes":{"x402Payment":{"type":"apiKey","in":"header","name":"x-payment-response","description":"Payment proof token obtained from x402 payment challenge flow. Required after completing payment."}},"schemas":{"ChatRequest":{"type":"object","required":["userQuery"],"properties":{"userQuery":{"type":"string","description":"Required. User query content."}}},"ChatResponse":{"type":"object","properties":{"content":{"type":"string","description":"AI response content."}}},"BadRequestError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}},"UnauthorizedError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}},"PaymentRequiredError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"paymentInstructions":{"type":"object","properties":{"amount":{"type":"string","description":"Payment amount required."},"currency":{"type":"string","description":"Payment currency (e.g., USDC)."},"recipient":{"type":"string","description":"Payment recipient address."},"chain":{"type":"string","description":"Blockchain for payment."}}}}}}},"paths":{"/x402/chat":{"post":{"summary":"Chat (Base Chain)","description":"Ask Minara AI - Intelligent crypto assistant","operationId":"x402Chat","tags":["AI"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"400":{"description":"Bad Request - Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"description":"Unauthorized - Invalid payment response token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredError"}}}}}}}}}
```

## Chat Expert (Base Chain)

> Ask Minara AI - Intelligent crypto assistant

```json
{"openapi":"3.0.0","info":{"title":"Minara x402 API","version":"1.0"},"servers":[{"url":"https://x402.minara.ai"}],"security":[{"x402Payment":[]}],"components":{"securitySchemes":{"x402Payment":{"type":"apiKey","in":"header","name":"x-payment-response","description":"Payment proof token obtained from x402 payment challenge flow. Required after completing payment."}},"schemas":{"ChatRequest":{"type":"object","required":["userQuery"],"properties":{"userQuery":{"type":"string","description":"Required. User query content."}}},"ChatResponse":{"type":"object","properties":{"content":{"type":"string","description":"AI response content."}}},"PaymentRequiredError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"paymentInstructions":{"type":"object","properties":{"amount":{"type":"string","description":"Payment amount required."},"currency":{"type":"string","description":"Payment currency (e.g., USDC)."},"recipient":{"type":"string","description":"Payment recipient address."},"chain":{"type":"string","description":"Blockchain for payment."}}}}}}},"paths":{"/x402/chat/expert":{"post":{"summary":"Chat Expert (Base Chain)","description":"Ask Minara AI - Intelligent crypto assistant","operationId":"x402ChatExpert","tags":["AI"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"400":{"description":"Bad Request - Invalid parameters"},"401":{"description":"Unauthorized - Invalid payment response token"},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredError"}}}}}}}}}
```

## Chat (Polygon Chain)

> Ask Minara AI - Intelligent crypto assistant

```json
{"openapi":"3.0.0","info":{"title":"Minara x402 API","version":"1.0"},"servers":[{"url":"https://x402.minara.ai"}],"security":[{"x402Payment":[]}],"components":{"securitySchemes":{"x402Payment":{"type":"apiKey","in":"header","name":"x-payment-response","description":"Payment proof token obtained from x402 payment challenge flow. Required after completing payment."}},"schemas":{"ChatRequest":{"type":"object","required":["userQuery"],"properties":{"userQuery":{"type":"string","description":"Required. User query content."}}},"ChatResponse":{"type":"object","properties":{"content":{"type":"string","description":"AI response content."}}},"BadRequestError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}},"UnauthorizedError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}},"PaymentRequiredError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"paymentInstructions":{"type":"object","properties":{"amount":{"type":"string","description":"Payment amount required."},"currency":{"type":"string","description":"Payment currency (e.g., USDC)."},"recipient":{"type":"string","description":"Payment recipient address."},"chain":{"type":"string","description":"Blockchain for payment."}}}}}}},"paths":{"/x402/polygon/chat":{"post":{"summary":"Chat (Polygon Chain)","description":"Ask Minara AI - Intelligent crypto assistant","operationId":"x402PolygonChat","tags":["AI"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"400":{"description":"Bad Request - Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"description":"Unauthorized - Invalid payment response token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredError"}}}}}}}}}
```

## Chat Expert (Polygon Chain)

> Ask Minara AI - Intelligent crypto assistant

```json
{"openapi":"3.0.0","info":{"title":"Minara x402 API","version":"1.0"},"servers":[{"url":"https://x402.minara.ai"}],"security":[{"x402Payment":[]}],"components":{"securitySchemes":{"x402Payment":{"type":"apiKey","in":"header","name":"x-payment-response","description":"Payment proof token obtained from x402 payment challenge flow. Required after completing payment."}},"schemas":{"ChatRequest":{"type":"object","required":["userQuery"],"properties":{"userQuery":{"type":"string","description":"Required. User query content."}}},"ChatResponse":{"type":"object","properties":{"content":{"type":"string","description":"AI response content."}}},"PaymentRequiredError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"paymentInstructions":{"type":"object","properties":{"amount":{"type":"string","description":"Payment amount required."},"currency":{"type":"string","description":"Payment currency (e.g., USDC)."},"recipient":{"type":"string","description":"Payment recipient address."},"chain":{"type":"string","description":"Blockchain for payment."}}}}}}},"paths":{"/x402/polygon/chat/expert":{"post":{"summary":"Chat Expert (Polygon Chain)","description":"Ask Minara AI - Intelligent crypto assistant","operationId":"x402PolygonChatExpert","tags":["AI"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"400":{"description":"Bad Request - Invalid parameters"},"401":{"description":"Unauthorized - Invalid payment response token"},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredError"}}}}}}}}}
```

## Chat (Solana Chain)

> Ask Minara AI - Intelligent crypto assistant

```json
{"openapi":"3.0.0","info":{"title":"Minara x402 API","version":"1.0"},"servers":[{"url":"https://x402.minara.ai"}],"security":[{"x402Payment":[]}],"components":{"securitySchemes":{"x402Payment":{"type":"apiKey","in":"header","name":"x-payment-response","description":"Payment proof token obtained from x402 payment challenge flow. Required after completing payment."}},"schemas":{"ChatRequest":{"type":"object","required":["userQuery"],"properties":{"userQuery":{"type":"string","description":"Required. User query content."}}},"ChatResponse":{"type":"object","properties":{"content":{"type":"string","description":"AI response content."}}},"PaymentRequiredError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"paymentInstructions":{"type":"object","properties":{"amount":{"type":"string","description":"Payment amount required."},"currency":{"type":"string","description":"Payment currency (e.g., USDC)."},"recipient":{"type":"string","description":"Payment recipient address."},"chain":{"type":"string","description":"Blockchain for payment."}}}}}}},"paths":{"/x402/solana/chat":{"post":{"summary":"Chat (Solana Chain)","description":"Ask Minara AI - Intelligent crypto assistant","operationId":"x402SolanaChat","tags":["AI"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"400":{"description":"Bad Request - Invalid parameters"},"401":{"description":"Unauthorized - Invalid payment response token"},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredError"}}}}}}}}}
```

## Chat Expert (Solana Chain)

> Ask Minara AI - Intelligent crypto assistant

```json
{"openapi":"3.0.0","info":{"title":"Minara x402 API","version":"1.0"},"servers":[{"url":"https://x402.minara.ai"}],"security":[{"x402Payment":[]}],"components":{"securitySchemes":{"x402Payment":{"type":"apiKey","in":"header","name":"x-payment-response","description":"Payment proof token obtained from x402 payment challenge flow. Required after completing payment."}},"schemas":{"ChatRequest":{"type":"object","required":["userQuery"],"properties":{"userQuery":{"type":"string","description":"Required. User query content."}}},"ChatResponse":{"type":"object","properties":{"content":{"type":"string","description":"AI response content."}}},"PaymentRequiredError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"paymentInstructions":{"type":"object","properties":{"amount":{"type":"string","description":"Payment amount required."},"currency":{"type":"string","description":"Payment currency (e.g., USDC)."},"recipient":{"type":"string","description":"Payment recipient address."},"chain":{"type":"string","description":"Blockchain for payment."}}}}}}},"paths":{"/x402/solana/chat/expert":{"post":{"summary":"Chat Expert (Solana Chain)","description":"Ask Minara AI - Intelligent crypto assistant","operationId":"x402SolanaChatExpert","tags":["AI"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"400":{"description":"Bad Request - Invalid parameters"},"401":{"description":"Unauthorized - Invalid payment response token"},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredError"}}}}}}}}}
```

## Perpetual Trading Suggestion

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

```json
{"openapi":"3.0.0","info":{"title":"Minara x402 API","version":"1.0"},"servers":[{"url":"https://x402.minara.ai"}],"security":[{"x402Payment":[]}],"components":{"securitySchemes":{"x402Payment":{"type":"apiKey","in":"header","name":"x-payment-response","description":"Payment proof token obtained from x402 payment challenge flow. Required after completing payment."}},"schemas":{"PerpTradingRequest":{"type":"object","required":["symbol"],"properties":{"symbol":{"type":"string","description":"Required. Trading symbol (e.g., 'BTC', 'ETH', 'SOL')."},"style":{"type":"string","enum":["scalping","day-trading","swing-trading"],"default":"scalping","description":"Optional. Trading style: 'scalping', 'day-trading', or 'swing-trading'. Default: 'scalping'."},"marginUSD":{"type":"number","default":1000,"description":"Optional. Margin in USD. Default: 1000."},"leverage":{"type":"number","default":10,"minimum":1,"maximum":40,"description":"Optional. Leverage multiplier (max: 40). Default: 10."},"strategy":{"type":"string","default":"max-profit","description":"Optional. Strategy type. Default: 'max-profit'. More strategies coming soon."}}},"PerpTradingResponse":{"type":"object","properties":{"entryPrice":{"type":"number","description":"Recommended entry price."},"side":{"type":"string","enum":["long","short"],"description":"Trading side recommendation."},"stopLossPrice":{"type":"number","description":"Recommended stop loss price."},"takeProfitPrice":{"type":"number","description":"Recommended take profit price."},"confidence":{"type":"number","minimum":0,"maximum":100,"description":"Confidence score (0-100)."},"reasons":{"type":"array","items":{"type":"string"},"description":"Analysis reasons based on technical indicators."},"risks":{"type":"array","items":{"type":"string"},"description":"Risk factors to consider."}}},"PaymentRequiredError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"paymentInstructions":{"type":"object","properties":{"amount":{"type":"string","description":"Payment amount required."},"currency":{"type":"string","description":"Payment currency (e.g., USDC)."},"recipient":{"type":"string","description":"Payment recipient address."},"chain":{"type":"string","description":"Blockchain for payment."}}}}}}},"paths":{"/x402/perp-trading-suggestion":{"post":{"summary":"Perpetual Trading Suggestion","description":"Get AI-powered perpetual trading suggestions with long/short recommendations, entry price, stop loss, take profit levels, and confidence score.","operationId":"x402PerpTradingSuggestion","tags":["Trading"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerpTradingRequest"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerpTradingResponse"}}}},"400":{"description":"Bad Request - Invalid parameters"},"401":{"description":"Unauthorized - Invalid payment response token"},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredError"}}}}}}}}}
```

## Intent to Swap Transaction

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

```json
{"openapi":"3.0.0","info":{"title":"Minara x402 API","version":"1.0"},"servers":[{"url":"https://x402.minara.ai"}],"security":[{"x402Payment":[]}],"components":{"securitySchemes":{"x402Payment":{"type":"apiKey","in":"header","name":"x-payment-response","description":"Payment proof token obtained from x402 payment challenge flow. Required after completing payment."}},"schemas":{"IntentToSwapRequest":{"type":"object","required":["intent","walletAddress"],"properties":{"intent":{"type":"string","description":"Required. Natural language swap intent (e.g., 'swap 0.1 ETH to USDC')."},"walletAddress":{"type":"string","description":"Required. User wallet address (0x...)."},"chain":{"type":"string","description":"Optional. Chain name (e.g., 'base', 'ethereum', 'bsc', 'arbitrum', 'optimism')."}}},"SwapTransactionResponse":{"type":"object","properties":{"transaction":{"type":"object","description":"Swap transaction details","properties":{"chain":{"type":"string","description":"Chain name."},"inputTokenAddress":{"type":"string","description":"Input token contract address."},"inputTokenSymbol":{"type":"string","description":"Input token symbol."},"outputTokenAddress":{"type":"string","description":"Output token contract address."},"outputTokenSymbol":{"type":"string","description":"Output token symbol."},"amount":{"type":"string","description":"Transaction amount."},"amountPercentage":{"type":"number","description":"Amount percentage."},"slippagePercent":{"type":"string","description":"Slippage percentage."}}}}},"PaymentRequiredError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"paymentInstructions":{"type":"object","properties":{"amount":{"type":"string","description":"Payment amount required."},"currency":{"type":"string","description":"Payment currency (e.g., USDC)."},"recipient":{"type":"string","description":"Payment recipient address."},"chain":{"type":"string","description":"Blockchain for payment."}}}}}}},"paths":{"/x402/intent-to-swap-tx":{"post":{"summary":"Intent to Swap Transaction","description":"Convert natural language trading intent into an executable swap transaction payload. Compatible with OKX DEX by default.","operationId":"x402IntentToSwap","tags":["Trading"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntentToSwapRequest"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwapTransactionResponse"}}}},"400":{"description":"Bad Request - Invalid parameters"},"401":{"description":"Unauthorized - Invalid payment response token"},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredError"}}}}}}}}}
```

## Prediction Market Analysis (Base Chain)

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

```json
{"openapi":"3.0.0","info":{"title":"Minara x402 API","version":"1.0"},"servers":[{"url":"https://x402.minara.ai"}],"security":[{"x402Payment":[]}],"components":{"securitySchemes":{"x402Payment":{"type":"apiKey","in":"header","name":"x-payment-response","description":"Payment proof token obtained from x402 payment challenge flow. Required after completing payment."}},"schemas":{"PredictionMarketRequest":{"type":"object","required":["link","mode"],"properties":{"link":{"type":"string","description":"Required. Prediction market page link (e.g., Polymarket event URL)."},"mode":{"type":"string","enum":["fast","expert"],"description":"Required. Chat mode: 'fast' or 'expert'."},"only_result":{"type":"boolean","default":false,"description":"Optional. Only return prediction probabilities without reasoning. Default: false."},"customPrompt":{"type":"string","description":"Optional. Custom instructions to guide the analysis. Use this to specify focus areas, risk preferences, or analysis style."}}},"PredictionMarketResponse":{"type":"object","properties":{"predictions":{"type":"array","description":"Array of prediction outcomes. Each outcome represents an event option with its yes/no probabilities.","items":{"type":"object","properties":{"outcome":{"type":"string","description":"Outcome name (event option, e.g., candidate name, team name)."},"yesProb":{"type":"number","description":"Probability of YES for this outcome (0-1)."},"noProb":{"type":"number","description":"Probability of NO for this outcome (0-1)."}}}},"reasoning":{"type":"string","description":"AI reasoning and analysis (empty if only_result=true)."}}},"BadRequestError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}},"UnauthorizedError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}}},"PaymentRequiredError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"paymentInstructions":{"type":"object","properties":{"amount":{"type":"string","description":"Payment amount required."},"currency":{"type":"string","description":"Payment currency (e.g., USDC)."},"recipient":{"type":"string","description":"Payment recipient address."},"chain":{"type":"string","description":"Blockchain for payment."}}}}}}},"paths":{"/x402/prediction-market-ask":{"post":{"summary":"Prediction Market Analysis (Base Chain)","description":"AI-powered prediction market analysis. Analyze prediction market events and get probability estimates for each outcome with detailed reasoning.","operationId":"x402PredictionMarketAsk","tags":["Prediction"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionMarketRequest"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionMarketResponse"}}}},"400":{"description":"Bad Request - Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}},"401":{"description":"Unauthorized - Invalid payment response token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthorizedError"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredError"}}}}}}}}}
```

## Uç Noktalar

### Sohbet (Base zinciri)

**Uç Nokta:** `POST /x402/chat`

#### İstek

**Başlıklar:**

* `x-payment-response` (gerekli) - x402 protokolünden ödeme kanıtı belirteci
* `Content-Type: application/json`

**Gövde Parametreleri:**

| Parametre   | Tür    | Gerekli | Açıklama                |
| ----------- | ------ | ------- | ----------------------- |
| `userQuery` | string | Evet    | Kullanıcı sorgu içeriği |

#### Örnek İstek

```bash
curl -X POST https://x402.minara.ai/x402/chat \
  -H "x-payment-response: <payment_proof_token>" \
  -H "Content-Type: application/json" \\
  -d '{
    "userQuery": "BTC'nin güncel fiyatı nedir ve temel destek seviyeleri nelerdir?"
  }'
```

#### Yanıt

**Durum:** 201 Created

```json
{
  "content": "BTC şu anda 98.450 $ seviyesinde işlem görüyor. Temel destek seviyeleri 96.500 $ ve 94.200 $ seviyelerinde. 97.000 $ üzerine güçlü hacimle yapılan son kırılım, yükselişin devam edeceğini gösteriyor..."
}
```

***

### Sohbet Uzmanı (Base zinciri)

**Uç Nokta:** `POST /x402/chat/expert`

Minara AI'ya sorun - Base zinciri üzerinde uzman modlu akıllı kripto asistanı

#### İstek

**Başlıklar:**

* `x-payment-response` (gerekli) - x402 protokolünden ödeme kanıtı belirteci
* `Content-Type: application/json`

**Gövde Parametreleri:**

| Parametre   | Tür    | Gerekli | Açıklama                |
| ----------- | ------ | ------- | ----------------------- |
| `userQuery` | string | Evet    | Kullanıcı sorgu içeriği |

#### Örnek İstek

```bash
curl -X POST https://x402.minara.ai/x402/chat/expert \
  -H "x-payment-response: <payment_proof_token>" \
  -H "Content-Type: application/json" \\
  -d '{
    "userQuery": "On-chain metrikler ve işlem stratejisi dahil ETH'nin kapsamlı analizini sunun"
  }'
```

#### Yanıt

**Durum:** 201 Created

```json
{
  "content": "Kapsamlı ETH Analizi:\n\n**Fiyat Hareketi**: ETH 3.420 $ seviyesinde işlem görüyor, 3.400-3.500 $ aralığında konsolide oluyor...\n\n**On-Chain Metrikler**: Aktif adresler haftalık bazda %12 arttı, bu da ağ etkinliğinin büyüdüğünü gösteriyor...\n\n**İşlem Stratejisi**: 3.300 $ desteğine geri çekilmelerde biriktirmeyi, 3.600 $ ve 3.850 $ hedeflerini değerlendirin..."
}
```

***

### Sohbet (Solana zinciri)

**Uç Nokta:** `POST /x402/solana/chat`

#### İstek

**Başlıklar:**

* `x-payment-response` (gerekli) - x402 protokolünden ödeme kanıtı belirteci
* `Content-Type: application/json`

**Gövde Parametreleri:**

| Parametre   | Tür    | Gerekli | Açıklama                |
| ----------- | ------ | ------- | ----------------------- |
| `userQuery` | string | Evet    | Kullanıcı sorgu içeriği |

#### Örnek İstek

```bash
curl -X POST https://x402.minara.ai/x402/solana/chat \
  -H "x-payment-response: <payment_proof_token>" \
  -H "Content-Type: application/json" \\
  -d '{
    "userQuery": "Bana şu anda Solana'daki en trend tokenları göster"
  }'
```

#### Yanıt

**Durum:** 201 Created

```json
{
  "content": "Solana'daki en trend tokenlar:\n1. WIF - 45 milyon $ 24 saatlik hacimle %24 arttı\n2. BONK - güçlü topluluk etkinliğiyle %18 arttı\n3. JUP - son yükselişin ardından konsolide oluyor, hacim 38 milyon $..."
}
```

### Sohbet Uzmanı (Solana zinciri)

**Uç Nokta:** `POST /x402/solana/chat/expert`

Minara AI'ya sorun - Solana zinciri üzerinde uzman modlu akıllı kripto asistanı

#### İstek

**Başlıklar:**

* `x-payment-response` (gerekli) - x402 protokolünden ödeme kanıtı belirteci
* `Content-Type: application/json`

**Gövde Parametreleri:**

| Parametre   | Tür    | Gerekli | Açıklama                |
| ----------- | ------ | ------- | ----------------------- |
| `userQuery` | string | Evet    | Kullanıcı sorgu içeriği |

#### Örnek İstek

```bash
curl -X POST https://x402.minara.ai/x402/solana/chat/expert \
  -H "x-payment-response: <payment_proof_token>" \
  -H "Content-Type: application/json" \\
  -d '{
    "userQuery": "JUP tokenı için likidite dağılımını ve balina hareketlerini analiz et"
  }'
```

#### Yanıt

**Durum:** 201 Created

```json
{
  "content": "**JUP Tokeninin Derin Analizi**\n\n**Likidite Dağılımı**: Büyük DEX'lerde toplam likidite 125 milyon $, bunun %65'i 0,85-0,92 $ aralığında yoğunlaşmış durumda...\n\n**Balina Aktivitesi**: İlk 10 cüzdan arzın %34'ünü kontrol ediyor. Son 24 saatte toplam 4,2 milyon $ tutarında 3 önemli balina işlemi tespit edildi...\n\n**Risk Değerlendirmesi**: 1,00 $ seviyesinin üzerinde orta düzeyde likidite riski var. Pozisyon büyüklüğünü belirlerken bunu dikkate alın..."
}
```

***

### Sohbet (Polygon zinciri)

**Uç Nokta:** `POST /x402/polygon/chat`

Minara AI'ya sorun - Polygon zinciri üzerinde akıllı kripto asistanı

#### İstek

**Başlıklar:**

* `x-payment-response` (gerekli) - x402 protokolünden ödeme kanıtı belirteci
* `Content-Type: application/json`

**Gövde Parametreleri:**

| Parametre   | Tür    | Gerekli | Açıklama                |
| ----------- | ------ | ------- | ----------------------- |
| `userQuery` | string | Evet    | Kullanıcı sorgu içeriği |

#### Örnek İstek

```bash
curl -X POST https://x402.minara.ai/x402/polygon/chat \
  -H "x-payment-response: <payment_proof_token>" \
  -H "Content-Type: application/json" \\
  -d '{
    "userQuery": "BTC'nin güncel fiyatı nedir ve temel destek seviyeleri nelerdir?"
  }'
```

#### Yanıt

**Durum:** 201 Created

```json
{
  "content": "BTC şu anda 98.450 $ seviyesinde işlem görüyor. Temel destek seviyeleri 96.500 $ ve 94.200 $ seviyelerinde. 97.000 $ üzerine güçlü hacimle yapılan son kırılım, yükselişin devam edeceğini gösteriyor..."
}
```

***

### Sohbet Uzmanı (Polygon zinciri)

**Uç Nokta:** `POST /x402/polygon/chat/expert`

Minara AI'ya sorun - Polygon zinciri üzerinde uzman modlu akıllı kripto asistanı

#### İstek

**Başlıklar:**

* `x-payment-response` (gerekli) - x402 protokolünden ödeme kanıtı belirteci
* `Content-Type: application/json`

**Gövde Parametreleri:**

| Parametre   | Tür    | Gerekli | Açıklama                |
| ----------- | ------ | ------- | ----------------------- |
| `userQuery` | string | Evet    | Kullanıcı sorgu içeriği |

#### Örnek İstek

```bash
curl -X POST https://x402.minara.ai/x402/polygon/chat/expert \
  -H "x-payment-response: <payment_proof_token>" \
  -H "Content-Type: application/json" \\
  -d '{
    "userQuery": "On-chain metrikler ve işlem stratejisi dahil ETH'nin kapsamlı analizini sunun"
  }'
```

#### Yanıt

**Durum:** 201 Created

```json
{
  "content": "**Kapsamlı ETH Analizi**\n\n**Fiyat Hareketi**: ETH 3.420 $ seviyesinde işlem görüyor, 3.400-3.500 $ aralığında konsolide oluyor...\n\n**On-Chain Metrikler**: Aktif adresler haftalık bazda %12 arttı, bu da ağ etkinliğinin büyüdüğünü gösteriyor...\n\n**İşlem Stratejisi**: 3.300 $ desteğine geri çekilmelerde biriktirmeyi, 3.600 $ ve 3.850 $ hedeflerini değerlendirin..."
}
```

***

## İşlem Uç Noktaları

### Swap İşlemi Niyeti

**Uç Nokta:** `POST /x402/intent-to-swap-tx`

Doğal dildeki işlem niyetini yürütülebilir bir swap işlemi yüküne dönüştürün. Varsayılan olarak OKX DEX ile uyumludur.

#### İstek

**Başlıklar:**

* `x-payment-response` (gerekli) - x402 protokolünden ödeme kanıtı belirteci
* `Content-Type: application/json`

**Gövde Parametreleri:**

| Parametre       | Tür    | Gerekli | Açıklama                                                            |
| --------------- | ------ | ------- | ------------------------------------------------------------------- |
| `intent`        | string | Evet    | Doğal dilde swap niyeti (ör. "0.1 ETH'yi USDC'ye çevir")            |
| `walletAddress` | string | Evet    | Kullanıcı cüzdan adresi (0x...)                                     |
| `chain`         | string | Hayır   | Zincir adı (örn. "base", "ethereum", "bsc", "arbitrum", "optimism") |

#### Örnek İstek

```bash
curl -X POST https://x402.minara.ai/x402/intent-to-swap-tx \
  -H "x-payment-response: <payment_proof_token>" \
  -H "Content-Type: application/json" \\
  -d '{
    "intent": "0.1 ETH'yi USDC'ye çevir",
    "walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1",
    "chain": "base"
  }'
```

#### Yanıt

**Durum:** 201 Created

```json
{
  "transaction": {
    "chain": "base",
    "inputTokenAddress": "0x4200000000000000000000000000000000000006",
    "inputTokenSymbol": "ETH",
    "outputTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "outputTokenSymbol": "USDC",
    "amount": "0.1",
    "amountPercentage": 100,
    "slippagePercent": "0.5"
  }
}
```

***

### Sürekli Vadeli İşlem Önerisi

**Uç Nokta:** `POST /x402/perp-trading-suggestion`

Kapsamlı piyasa analizine dayalı, uzun/kısa önerileri, giriş fiyatı, zararı durdur, kâr al seviyeleri ve güven puanı içeren yapay zekâ destekli sürekli vadeli işlem önerileri alın.

#### İstek

**Başlıklar:**

* `x-payment-response` (gerekli) - x402 protokolünden ödeme kanıtı belirteci
* `Content-Type: application/json`

**Gövde Parametreleri:**

| Parametre   | Tür    | Gerekli | Varsayılan   | Açıklama                                                    |
| ----------- | ------ | ------- | ------------ | ----------------------------------------------------------- |
| `symbol`    | string | Evet    | -            | İşlem sembolü (ör. "BTC", "ETH", "SOL")                     |
| `style`     | string | Hayır   | "scalping"   | İşlem stili: "scalping", "day-trading" veya "swing-trading" |
| `marginUSD` | number | Hayır   | 1000         | USD cinsinden marjin                                        |
| `leverage`  | number | Hayır   | 10           | Kaldıraç çarpanı (maks: 40)                                 |
| `strategy`  | string | Hayır   | "max-profit" | Strateji türü (daha fazla strateji yakında geliyor)         |

#### Örnek İstek

```bash
curl -X POST https://x402.minara.ai/x402/perp-trading-suggestion \
  -H "x-payment-response: <payment_proof_token>" \
  -H "Content-Type: application/json" \\
  -d '{
    "symbol": "BTC",
    "style": "day-trading",
    "marginUSD": 1000,
    "leverage": 10,
    "strategy": "max-profit"
  }'
```

#### Yanıt

**Durum:** 201 Created

```json
{
  "entryPrice": 98450,
  "side": "long",
  "stopLossPrice": 96200,
  "takeProfitPrice": 102800,
  "confidence": 78,
  "reasons": [
    "BTC broke above key resistance at $97,500 with strong volume",
    "RSI at 62 indicates bullish momentum without being overbought",
    "MACD showing bullish crossover on 4H timeframe",
    "Volume profile shows accumulation at current levels"
  ],
  "risks": [
    "Potential pullback at $100,000 psychological resistance",
    "High volatility expected around upcoming Fed meeting",
    "Funding rates on major exchanges trending higher"
  ]
}
```

***

### Tahmin Piyasası Analizi (Base zinciri)

**Uç Nokta:** `POST /x402/prediction-market-ask`

Tahmin piyasası olaylarını analiz eden yapay zekâ destekli analiz. Her bir sonuç için ayrıntılı gerekçelendirmeyle olasılık tahminleri alın.

#### İstek

**Başlıklar:**

* `x-payment-response` (gerekli) - x402 protokolünden ödeme kanıtı belirteci
* `Content-Type: application/json`

**Gövde Parametreleri:**

| Parametre      | Tür     | Gerekli | Varsayılan | Açıklama                                                             |
| -------------- | ------- | ------- | ---------- | -------------------------------------------------------------------- |
| `link`         | string  | Evet    | -          | Tahmin piyasası sayfası bağlantısı (örn. Polymarket etkinlik URL'si) |
| `mode`         | string  | Evet    | -          | Sohbet modu: "fast" veya "expert"                                    |
| `only_result`  | boolean | Hayır   | false      | Yalnızca gerekçelendirme olmadan tahmin olasılıklarını döndürün      |
| `customPrompt` | string  | Hayır   | -          | Analizi yönlendirmek için özel talimatlar                            |

#### Örnek İstek

```bash
curl -X POST https://x402.minara.ai/x402/prediction-market-ask \
  -H "x-payment-response: <payment_proof_token>" \
  -H "Content-Type: application/json" \\
  -d '{
    "link": "https://polymarket.com/event/will-there-be-another-us-government-shutdown-by-january-31",
    "mode": "fast",
    "only_result": false,
    "customPrompt": "Son haberlere ve duygu analizine odaklanın. Olasılık tahminlerinde daha muhafazakâr olun."
  }'
```

#### Yanıt

**Durum:** 201 Created

```json
{
  "predictions": [
    {
      "outcome": "Donald Trump",
      "yesProb": 0.65,
      "noProb": 0.35
    },
    {
      "outcome": "Kamala Harris",
      "yesProb": 0.3,
      "noProb": 0.7
    }
  ],
  "reasoning": "Son anket verilerine ve tarihsel trendlere dayanarak Trump, kilit salıncak eyaletlerde hafif bir üstünlüğe sahip. Ancak yarış hâlâ oldukça rekabetçi ve önemli belirsizlikler barındırıyor..."
}
```

***

### Tahmin Piyasası Analizi (Polygon zinciri)

**Uç Nokta:** `POST /x402/polygon/prediction-market-ask`

Polygon zinciri üzerinde yapay zekâ destekli tahmin piyasası analizi. Base zinciri uç noktasıyla aynı işlevselliğe sahiptir.

#### İstek

**Başlıklar:**

* `x-payment-response` (gerekli) - x402 protokolünden ödeme kanıtı belirteci
* `Content-Type: application/json`

**Gövde Parametreleri:**

Yukarıdaki Base zinciri uç noktasıyla aynı.

#### Örnek İstek

```bash
curl -X POST https://x402.minara.ai/x402/polygon/prediction-market-ask \
  -H "x-payment-response: <payment_proof_token>" \
  -H "Content-Type: application/json" \\
  -d '{
    "link": "https://polymarket.com/event/will-there-be-another-us-government-shutdown-by-january-31",
    "mode": "fast",
    "only_result": false
  }'
```

#### Yanıt

**Durum:** 201 Created

Base zinciri uç noktasıyla aynı yanıt biçimi.

***

## Hata Yanıtları

### 402 Ödeme Gerekli

Ödeme kimlik bilgileri olmadan yapılan ilk istek şu yanıtı döndürür:

```json
{
  "error": "payment_required",
  "message": "Bu kaynağa erişmek için ödeme gerekiyor",
  "paymentInstructions": {
    "amount": "0.20",
    "currency": "USDC",
    "recipient": "0x...",
    "chain": "base"
  }
}
```

### 401 Yetkisiz

Geçersiz veya süresi dolmuş ödeme kanıtı:

```json
{
  "error": "unauthorized",
  "message": "Geçersiz ödeme yanıtı belirteci"
}
```

### 400 Hatalı İstek

Geçersiz istek parametreleri:

```json
{
  "error": "bad_request",
  "message": "Eksik gerekli parametre: userQuery"
}
```

***

## Hız Limitleri

x402 uç noktaları cüzdan adresi başına hız sınırına tabidir:

* **Yapay Zekâ Uç Noktaları:** Dakikada 60 istek
* **İşlem Uç Noktaları:** Dakikada 30 istek

Hız limitlerini aşmak şu yanıtı döndürür:

```json
{
  "error": "rate_limit_exceeded",
  "message": "Çok fazla istek. Lütfen 30 saniye sonra tekrar deneyin.",
  "retryAfter": 30
}
```

***

## Notlar

* Tüm x402 uç noktaları şunu gerektirir: `x-payment-response` ödeme doğrulama sürecini tamamladıktan sonra başlık
* Fiyatlar ağ koşullarına bağlı olarak değişebilir
* x402 protokolü hakkında daha fazla bilgi için bkz. [x402 Dokümantasyonu](https://x402scan.com/server)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://minara.ai/docs/minara-handbook/tr/islem-yap/agent-api/api-reference-x402.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
