Getting Started
📖 Introduction
🔑 Authentication
Endpoints
👤 Auth
⚡ Worker
🛒 Marketplace
🤖 GURU AI
📡 Bandwidth
🎁 Referral
🚀 Deploy
NRV Network API Reference
NRV Network REST API — GPU/CPU compute marketplace, GURU AI, bandwidth proxy ve referral sistemine erişim sağlar. Tüm istekler HTTPS üzerinden yapılmalıdır.
BASE URL
https://provider.nrv.batingroup.com.tr
🔑 Authentication
Korunan endpoint'lere erişmek için JWT Bearer token kullanın. Token'ı
/auth/login ile alabilirsiniz.
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
👤 Auth Endpoints
POST
/auth/login
No Auth
Login, get JWT token
REQUEST BODY
| Parametre | Tip | Zorunlu | Description |
|---|---|---|---|
| string | required | Kullanıcı email | |
| password | string | required | Kullanıcı şifre |
RESPONSE
{
"ok": true,
"token": "eyJhbGci...",
"user": {
"id": "1051dba3-...",
"username": "necati1",
"email": "user@example.com",
"nrv_balance": 323.33,
"usd_balance": 0.0
}
}
GET
/auth/me
🔑 JWT
Get session info
RESPONSE
{
"ok": true,
"id": "1051dba3-...",
"username": "necati1",
"nrv_balance": 323.33,
"usd_balance": 0.0,
"email_verified": true
}
⚡ Worker Endpoints
Worker devices management, token creation and heartbeat.
POST
/api/worker/token/create
🔑 JWT
Create worker token
REQUEST BODY
| Parametre | Tip | Zorunlu | Description |
|---|---|---|---|
| name | string | required | Token adı (örn: My Home PC) |
| device_type | string | optional | desktop, mini_pc, server, phone |
| min_price_usd | float | optional | Minimum fiyat (USD/saat) |
RESPONSE
{
"ok": true,
"token": "nrv_abc123...",
"token_id": "uuid-..."
}
POST
/api/worker/heartbeat
🔑 Worker Token
Send online signal
HEADERS
X-Worker-Token: nrv_abc123...
REQUEST BODY
| Parametre | Tip | Zorunlu | Description |
|---|---|---|---|
| gpu_name | string | optional | GPU model adı |
| cpu_cores | int | optional | CPU çekirdek sayısı |
| ram_gb | float | optional | RAM miktarı (GB) |
| cpu_temp | float | optional | CPU sıcaklığı (°C) |
| gpu_temp | float | optional | GPU sıcaklığı (°C) |
| cpu_pct | float | optional | CPU kullanım yüzdesi |
| ram_pct | float | optional | RAM kullanım yüzdesi |
RESPONSE
{"ok": true}
POST
/api/worker/offline
🔑 Worker Token
Mark device offline
HEADERS
X-Worker-Token: nrv_abc123...
RESPONSE
{"ok": true}
GET
/api/worker/devices
🔑 JWT
List connected devices
RESPONSE
{
"ok": true,
"devices": [
{
"id": "uuid-...",
"hostname": "MyPC",
"device_type": "desktop",
"gpu_name": "RTX 3090",
"cpu_cores": 16,
"ram_gb": 32,
"is_online": true,
"earn_today": 0.15
}
]
}
🛒 Marketplace Endpoints
GPU/CPU job creation, listing and management.
GET
/api/marketplace/jobs
No Auth
List all jobs
RESPONSE
{
"ok": true,
"jobs": [
{
"id": "uuid-...",
"title": "Stable Diffusion Training",
"job_type": "training",
"price_nrv": 100,
"duration_hrs": 2,
"status": "waiting",
"buyer_id": "uuid-..."
}
]
}
POST
/api/jobs
🔑 JWT
Create new job
REQUEST BODY
| Parametre | Tip | Zorunlu | Description |
|---|---|---|---|
| title | string | required | İş başlığı |
| job_type | string | required | docker, training, inference, script |
| price_nrv | float | required | Ödeme miktarı (NRV) |
| duration_hrs | int | required | Tahmini süre (saat) |
| description | string | optional | İş açıklaması |
| requirements | string | optional | Gereksinimler (GPU, RAM vb.) |
RESPONSE
{
"ok": true,
"job_id": "uuid-..."
}
POST
/api/jobs/{job_id}/accept
🔑 Worker Token
Accept job
HEADERS
X-Worker-Token: nrv_abc123...
RESPONSE
{
"ok": true,
"job": {
"id": "uuid-...",
"title": "Stable Diffusion Training",
"status": "running"
}
}
🤖 GURU AI Endpoints
GURU AI chat, photo analysis and NRV reward system.
POST
/api/guru/chat
🔑 JWT (optional)
Chat with GURU
REQUEST BODY
| Parametre | Tip | Zorunlu | Description |
|---|---|---|---|
| message | string | required | Kullanıcı mesajı |
| history | array | optional | Sohbet geçmişi [{role, content}] |
| mode | string | optional | chat, goodness, training |
| location | string | optional | Kullanıcı konumu |
| weather | string | optional | Hava durumu bilgisi |
RESPONSE
{
"ok": true,
"reply": "Merhaba! Size nasıl yardımcı olabilirim?",
"model": "groq-llama3.3-70b",
"nrv_reward": 20
}
POST
/api/guru/analyze-image
🔑 JWT (optional)
Photo analysis & goodness detection
REQUEST (multipart/form-data)
| Parametre | Tip | Zorunlu | Description |
|---|---|---|---|
| file | file | required | Fotoğraf (JPEG/PNG) |
| mode | string | optional | goodness |
| location | string | optional | Konum bilgisi |
| weather | string | optional | Hava durumu |
| lang | string | optional | tr, en, ru, ko |
| description | string | optional | Fotoğraf açıklaması |
RESPONSE
{
"ok": true,
"is_real": true,
"goodness_type": "nature",
"description": "Bir parkta ağaç dikimi yapılıyor",
"nrv_reward": 75,
"message": "Harika bir iyilik! 🌱",
"model": "cf-llava-1.5-7b"
}
📡 Bandwidth Endpoints
Residential SOCKS5 proxy purchase and session management.
POST
/api/bandwidth/create
🔑 JWT
Create proxy session
REQUEST BODY
| Parametre | Tip | Zorunlu | Description |
|---|---|---|---|
| gb | float | required | GB miktarı |
| price_per_gb | float | optional | GB başına fiyat (USD), default: 1.0 |
RESPONSE
{
"ok": true,
"session_id": "uuid-...",
"proxy": {
"host": "proxy.nrv.batingroup.com.tr",
"port": 10000,
"username": "nrv_abc123",
"password": "xyz789...",
"protocol": "socks5"
},
"cost_usd": 1.0
}
GET
/api/bandwidth/sessions
🔑 JWT
List active sessions
RESPONSE
{
"ok": true,
"sessions": [
{
"id": "uuid-...",
"port": 10000,
"bytes_used": 1048576,
"gb_used": 0.001,
"status": "active",
"price_per_gb": 1.0
}
]
}
POST
/api/bandwidth/end
🔑 JWT
End session
REQUEST BODY
| Parametre | Tip | Zorunlu | Description |
|---|---|---|---|
| session_id | string | required | Session UUID |
RESPONSE
{"ok": true}
🎁 Referral Endpoints
Referral system — invite, earn NRV.
GET
/api/referral/info
🔑 JWT
Get referral info
RESPONSE
{
"ok": true,
"referral_code": "6216820B",
"referral_link": "https://app.nrv.batingroup.com.tr/register?ref=6216820B",
"total_referrals": 3,
"total_bonus": 150.0,
"reward_per_referral": 50,
"referred_reward": 25
}
POST
/api/referral/apply
🔑 JWT
Apply referral code
REQUEST BODY
| Parametre | Tip | Zorunlu | Description |
|---|---|---|---|
| referral_code | string | required | 8 haneli referans kodu |
RESPONSE
{
"ok": true,
"message": "Referral applied! +25 NRV earned!",
"bonus": 25
}
🚀 Deploy Endpoints
GPU/CPU job deployment and revision management.
POST
/api/deploy/job
🔑 JWT
Create new deploy
REQUEST BODY
| Parametre | Tip | Zorunlu | Description |
|---|---|---|---|
| job_name | string | required | Deploy adı |
| job_type | string | required | Docker, Jupyter, Inference, Training, Script |
| gpu_model | string | required | RTX 3090, A100 vb. |
| gpu_count | int | optional | GPU sayısı, default: 1 |
| duration_hrs | int | optional | Süre (saat), default: 1 |
| replicas | int | optional | Replika sayısı, default: 1 |
| payment_type | string | optional | usd veya nrv |
RESPONSE
{
"ok": true,
"job_id": "uuid-...",
"message": "Deploy queued successfully"
}
⚠️ Error Codes
| HTTP Kodu | Description |
|---|---|
| 200 | Success |
| 400 | Invalid request parameters |
| 401 | Unauthorized — JWT token missing or invalid |
| 404 | Resource not found |
| 500 | Server error |