Documentation API

Référence complète de l'API Le Proxy Français.

Base URL
https://prx.lv
Toutes les routes marquées Auth nécessitent un header Authorization: Bearer <clé_api>.

Prise en main rapide

Essentiels
Proxy

Utilisateur courant

Récupère l'utilisateur connecté, son rôle et ses permissions.

curl https://prx.lv/auth/me \
  -H "Authorization: Bearer VOTRE_CLE_API"
{ "user": { "id": 1, "email": "...", "balance": 150 }, "role": "user" }

Crédits restants

Retourne les crédits disponibles (tient compte des limites globales + par clé).

curl https://prx.lv/usage \
  -H "Authorization: Bearer VOTRE_CLE_API"
{ "remaining": 42.50 }

Proxy Mutualisé — 3 crédits/Go

IP partagées, rotation automatique. Auth par clé API via SOCKS5.

# Installation
pip install requests pysocks    # Python
npm install socks-proxy-agent   # Node.js

# Test rapide
curl -x socks5h://VOTRE_CLE_API@mut.prx.lv:1080 https://ipinfo.io/ip

Proxy Dédié — 8 crédits/Go

IP dédiées, haute performance. Auth par clé API via SOCKS5.

# Installation
pip install requests pysocks    # Python
npm install socks-proxy-agent   # Node.js

# Test rapide
curl -x socks5h://VOTRE_CLE_API@ded.prx.lv:1081 https://ipinfo.io/ip

Navigateur — 10 crédits/Go

Playwright Firefox via WebSocket. Empreinte navigateur réelle.

# Python
pip install playwright && playwright install firefox

# Node.js
npm install playwright
npx playwright install firefox

Authentification

GET/auth/noncePublicObtenir un nonce pour la connexion wallet (SIWE)

Query params

ParamTypeDescription
addressstringAdresse Ethereum (0x...)

Réponse 200

{
  "message": "Connexion a Le Proxy Francais...",
  "nonce": "550e8400-e29b-..."
}
curl -X GET "https://prx.lv/auth/nonce?address=example"
POST/auth/walletPublicConnexion wallet

Body JSON

ChampTypeRequis
addressstringOui
signaturestringOui
messagestringOui

Réponse 200

{
  "token": "eyJhbGci...",
  "user": {
    "id": 1,
    "username": "0x31b6...",
    "wallet_address": "0x31b6740e...",
    "auth_type": "wallet"
  }
}
curl -X POST "https://prx.lv/auth/wallet" \
  -H "Content-Type: application/json" \
  -d '{"address":"example","signature":"example","message":"example"}'
POST/auth/registerPublicInscription email

Body JSON

ChampTypeRequis
usernamestringOui
emailstringOui
passwordstringOui

Réponse 200

{
  "success": true,
  "message": "Email de confirmation envoyé"
}
curl -X POST "https://prx.lv/auth/register" \
  -H "Content-Type: application/json" \
  -d '{"username":"example","email":"example","password":"example"}'
POST/auth/loginPublicConnexion email

Body JSON

ChampTypeRequis
emailstringOui
passwordstringOui

Réponse 200

{
  "token": "eyJhbGci...",
  "user": {
    "id": 1,
    "email": "user@example.com"
  }
}
curl -X POST "https://prx.lv/auth/login" \
  -H "Content-Type: application/json" \
  -d '{"email":"example","password":"example"}'
GET/auth/meAuthUtilisateur courant + permissions

Réponse 200

{
  "user": {
    "id": 1,
    "email": "user@example.com",
    "balance": 150
  },
  "role": "user",
  "permissions": [
    "app.testnet"
  ]
}
curl -X GET "https://prx.lv/auth/me" \
  -H "Authorization: Bearer VOTRE_CLE_API"
GET/auth/verify-emailPublicVérifier email

Query params

ParamTypeDescription
tokenstringToken reçu par email

Réponse 200

{
  "success": true,
  "message": "Email vérifié avec succès"
}
curl -X GET "https://prx.lv/auth/verify-email?token=example"
POST/auth/resend-verificationPublicRenvoyer email de vérification

Body JSON

ChampTypeRequis
emailstringOui

Réponse 200

{
  "success": true
}
curl -X POST "https://prx.lv/auth/resend-verification" \
  -H "Content-Type: application/json" \
  -d '{"email":"example"}'
POST/auth/forgot-passwordPublicDemander reset mot de passe

Body JSON

ChampTypeRequis
emailstringOui

Réponse 200

{
  "success": true,
  "message": "Si un compte existe, un email a été envoyé"
}
curl -X POST "https://prx.lv/auth/forgot-password" \
  -H "Content-Type: application/json" \
  -d '{"email":"example"}'
POST/auth/reset-passwordPublicRéinitialiser mot de passe

Body JSON

ChampTypeRequis
tokenstringOui
passwordstringOui

Réponse 200

{
  "success": true,
  "message": "Mot de passe réinitialisé"
}
curl -X POST "https://prx.lv/auth/reset-password" \
  -H "Content-Type: application/json" \
  -d '{"token":"example","password":"example"}'
POST/auth/change-passwordAuthChanger mot de passe

Body JSON

ChampTypeRequis
currentPasswordstringOui
newPasswordstringOui

Réponse 200

{
  "success": true,
  "message": "Mot de passe modifié"
}
curl -X POST "https://prx.lv/auth/change-password" \
  -H "Authorization: Bearer VOTRE_CLE_API" \
  -H "Content-Type: application/json" \
  -d '{"currentPassword":"example","newPassword":"example"}'
POST/auth/link-walletAuthLier un wallet au compte

Body JSON

ChampTypeRequis
addressstringOui
signaturestringOui

Réponse 200

{
  "success": true,
  "merged": false,
  "user": {}
}
curl -X POST "https://prx.lv/auth/link-wallet" \
  -H "Authorization: Bearer VOTRE_CLE_API" \
  -H "Content-Type: application/json" \
  -d '{"address":"example","signature":"example"}'
DELETE/auth/unlink-walletAuthDélier wallet du compte

Réponse 200

{
  "success": true,
  "user": {}
}
curl -X DELETE "https://prx.lv/auth/unlink-wallet" \
  -H "Authorization: Bearer VOTRE_CLE_API"

Clés API

GET/keysAuthLister vos clés API

Réponse 200

{
  "keys": [
    {
      "id": 1,
      "name": "Prod",
      "key_preview": "lpf_1f05...",
      "active": 1,
      "daily_limit": null,
      "weekly_limit": null,
      "monthly_limit": null
    }
  ]
}
curl -X GET "https://prx.lv/keys" \
  -H "Authorization: Bearer VOTRE_CLE_API"
POST/keysAuthCréer une clé API

Body JSON

ChampTypeRequis
namestringOui
daily_limitnumberNon
weekly_limitnumberNon
monthly_limitnumberNon

Max 10 clés actives par utilisateur.

Réponse 200

{
  "key": {
    "id": 2,
    "name": "Production",
    "key_preview": "lpf_abc1...",
    "key": "lpf_abc123...",
    "active": 1,
    "daily_limit": null,
    "weekly_limit": null,
    "monthly_limit": null,
    "created_at": "2026-03-28T12:00:00Z",
    "last_used_at": null
  }
}
curl -X POST "https://prx.lv/keys" \
  -H "Authorization: Bearer VOTRE_CLE_API" \
  -H "Content-Type: application/json" \
  -d '{"name":"example","daily_limit":1,"weekly_limit":1,"monthly_limit":1}'
GET/keys/:idAuthDétail d'une clé

Réponse 200

{
  "key": {
    "id": 1,
    "name": "Prod",
    "key_preview": "lpf_1f05...",
    "active": 1,
    "daily_limit": null,
    "weekly_limit": null,
    "monthly_limit": null,
    "created_at": "2026-03-28T12:00:00Z",
    "last_used_at": null
  }
}
curl -X GET "https://prx.lv/keys/:id" \
  -H "Authorization: Bearer VOTRE_CLE_API"
PUT/keys/:idAuthModifier une clé

Body JSON

ChampTypeRequis
namestringNon
daily_limitnumberNon
weekly_limitnumberNon
monthly_limitnumberNon

Réponse 200

{
  "success": true,
  "key": {}
}
curl -X PUT "https://prx.lv/keys/:id" \
  -H "Authorization: Bearer VOTRE_CLE_API" \
  -H "Content-Type: application/json" \
  -d '{"name":"example","daily_limit":1,"weekly_limit":1,"monthly_limit":1}'
GET/keys/:id/revealAuthRévéler la clé complète

Réponse 200

{
  "key": "lpf_1f0553c89d4138e8cc59bd46965f22d0"
}
curl -X GET "https://prx.lv/keys/:id/reveal" \
  -H "Authorization: Bearer VOTRE_CLE_API"
PUT/keys/:id/regenerateAuthRegénérer une clé

Réponse 200

{
  "success": true,
  "key": "lpf_new_key_here..."
}
curl -X PUT "https://prx.lv/keys/:id/regenerate" \
  -H "Authorization: Bearer VOTRE_CLE_API"
DELETE/keys/:idAuthRévoquer une clé

La clé est immédiatement désactivée et ne peut plus être utilisée.

Réponse 200

{
  "success": true
}
curl -X DELETE "https://prx.lv/keys/:id" \
  -H "Authorization: Bearer VOTRE_CLE_API"

Usage & Solde

GET/usageAuthCrédits restants (tient compte de toutes les limites)

Réponse 200

{
  "remaining": 42.5
}
curl -X GET "https://prx.lv/usage" \
  -H "Authorization: Bearer VOTRE_CLE_API"
GET/keys/usageAuthUsage détaillé par clé

Réponse 200

{
  "global": {
    "limits": {
      "daily": 100,
      "weekly": null,
      "monthly": null
    },
    "used": {
      "daily": 12.5,
      "weekly": 45,
      "monthly": 120
    },
    "remaining": {
      "daily": 87.5,
      "weekly": null,
      "monthly": null
    }
  },
  "keys": [
    {
      "id": 1,
      "name": "Prod",
      "limits": {},
      "used": {},
      "remaining": {}
    }
  ]
}
curl -X GET "https://prx.lv/keys/usage" \
  -H "Authorization: Bearer VOTRE_CLE_API"
GET/keys/usage/dailyAuthConsommation journalière par type

Query params

ParamTypeDescription
daysintegerNombre de jours (1-90, défaut 7)

Réponse 200

{
  "daily": {
    "2026-03-28": {
      "mutualise": 5.2,
      "dedie": 1,
      "navigateur": 0,
      "total": 6.2,
      "deposits": 50
    }
  },
  "hourly": [
    {
      "mutualise": 0,
      "dedie": 0,
      "navigateur": 0,
      "total": 0,
      "deposits": 0
    }
  ]
}
curl -X GET "https://prx.lv/keys/usage/daily?days=1" \
  -H "Authorization: Bearer VOTRE_CLE_API"
GET/keys/balanceAuthSolde et résumé des transactions

Réponse 200

{
  "balance": 150,
  "summary": {
    "deposit": {
      "total": 200,
      "count": 3,
      "by_subtype": {
        "USDT": {
          "total": 200,
          "count": 3
        }
      }
    },
    "consumption": {
      "total": -50,
      "count": 12,
      "by_subtype": {
        "Mutualisé": {
          "total": -45,
          "count": 10
        },
        "Dédié": {
          "total": -5,
          "count": 2
        }
      }
    }
  }
}
curl -X GET "https://prx.lv/keys/balance" \
  -H "Authorization: Bearer VOTRE_CLE_API"
GET/keys/pricingAuthGrille tarifaire

Réponse 200

{
  "rate": 0.8,
  "grid": "Premium",
  "tiers": [
    {
      "min_credits": 100,
      "rate": 0.9
    },
    {
      "min_credits": 500,
      "rate": 0.8
    }
  ]
}
curl -X GET "https://prx.lv/keys/pricing" \
  -H "Authorization: Bearer VOTRE_CLE_API"
GET/keys/transactionsAuthHistorique des transactions

Query params

ParamTypeDescription
pageintegerPage (défaut 1)
limitintegerLimite (défaut 20, max 100)
typestringdeposit | consumption | adjustment
subtypeintegerSous-type
api_key_idintegerFiltrer par clé

Réponse 200

{
  "transactions": [
    {
      "id": 1,
      "type": "deposit",
      "subtype": 2,
      "subtype_label": "Paiement en ligne",
      "amount": 50,
      "api_key_id": null,
      "api_key_name": null,
      "tx_hash": "pi_abc123",
      "status": "confirmed",
      "confirmations": 0,
      "currency": "stripe",
      "chain_id": 0,
      "created_at": "2026-03-28T12:00:00Z"
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 20
}
curl -X GET "https://prx.lv/keys/transactions?page=1&limit=1&type=example&subtype=1&api_key_id=1" \
  -H "Authorization: Bearer VOTRE_CLE_API"

Dépôts

POST/keys/depositAuthSoumettre un dépôt crypto (montant vérifié on-chain)

Body JSON

ChampTypeRequis
tx_hashstringOui
currencystringNon
chain_idintegerNon

currency: usdt | eth. chain_id: 1=Ethereum, 137=Polygon, 56=BSC, 8453=Base, 43114=Avalanche, 560048=Hoodi

Réponse 200

{
  "success": true,
  "status": "pending"
}
curl -X POST "https://prx.lv/keys/deposit" \
  -H "Authorization: Bearer VOTRE_CLE_API" \
  -H "Content-Type: application/json" \
  -d '{"tx_hash":"example","currency":"example","chain_id":1}'

Paramètres

GET/keys/settingsAuthRécupérer les paramètres

Réponse 200

{
  "settings": {
    "daily_limit": null,
    "weekly_limit": null,
    "monthly_limit": null,
    "webhook_url": null,
    "webhook_events": {},
    "alert_low_balance": true,
    "alert_threshold": 50,
    "webhook_secret": "a1b2c3...",
    "auto_reload_enabled": false,
    "auto_reload_threshold": 10,
    "auto_reload_amount": 50,
    "save_card_consent": false
  }
}
curl -X GET "https://prx.lv/keys/settings" \
  -H "Authorization: Bearer VOTRE_CLE_API"
PUT/keys/settingsAuthModifier les limites globales

Body JSON

ChampTypeRequis
daily_limitnumberNon
weekly_limitnumberNon
monthly_limitnumberNon

Réponse 200

{
  "success": true,
  "settings": {}
}
curl -X PUT "https://prx.lv/keys/settings" \
  -H "Authorization: Bearer VOTRE_CLE_API" \
  -H "Content-Type: application/json" \
  -d '{"daily_limit":1,"weekly_limit":1,"monthly_limit":1}'
PUT/keys/settings/alertsAuthConfigurer alertes et rechargement auto

Body JSON

ChampTypeRequis
alert_low_balancebooleanNon
alert_thresholdnumberNon
auto_reload_enabledbooleanNon
auto_reload_thresholdnumberNon
auto_reload_amountnumberNon
save_card_consentbooleanNon

Réponse 200

{
  "success": true
}
curl -X PUT "https://prx.lv/keys/settings/alerts" \
  -H "Authorization: Bearer VOTRE_CLE_API" \
  -H "Content-Type: application/json" \
  -d '{"alert_low_balance":true,"alert_threshold":1,"auto_reload_enabled":true,"auto_reload_threshold":1,"auto_reload_amount":1,"save_card_consent":true}'

Proxy

SOCKS5mut.prx.lv:10803 crédits/GoMutualisé — IP partagées, rotation automatique
# Installation
pip install requests pysocks    # Python
npm install socks-proxy-agent   # Node.js

# Test rapide
curl -x socks5h://VOTRE_CLE_API@mut.prx.lv:1080 https://ipinfo.io/ip
SOCKS5ded.prx.lv:10818 crédits/GoDédié — IP dédiées, haute performance
# Installation
pip install requests pysocks    # Python
npm install socks-proxy-agent   # Node.js

# Test rapide
curl -x socks5h://VOTRE_CLE_API@ded.prx.lv:1081 https://ipinfo.io/ip
WSnav.prx.lv:8010 crédits/GoNavigateur — Playwright via WebSocket, empreinte réelle
# Python
pip install playwright && playwright install firefox

# Node.js
npm install playwright
npx playwright install firefox

Webhooks

PUT/keys/settings/webhooksAuthConfigurer le webhook

Body JSON

ChampTypeRequis
webhook_urlstringOui
webhook_eventsobjectOui

Events: { balanceLow: bool, deposit: bool, dailyUsage: bool }

Réponse 200

{
  "success": true,
  "webhook_secret": "abc123..."
}
curl -X PUT "https://prx.lv/keys/settings/webhooks" \
  -H "Authorization: Bearer VOTRE_CLE_API" \
  -H "Content-Type: application/json" \
  -d '{"webhook_url":"example","webhook_events":{}}'
POST/keys/settings/webhooks/testAuthTester le webhook

Réponse 200

{
  "success": true,
  "status": 200
}
curl -X POST "https://prx.lv/keys/settings/webhooks/test" \
  -H "Authorization: Bearer VOTRE_CLE_API"
POST/keys/settings/webhooks/rotate-secretAuthRenouveler la clé HMAC

Réponse 200

{
  "success": true,
  "webhook_secret": "new_secret..."
}
curl -X POST "https://prx.lv/keys/settings/webhooks/rotate-secret" \
  -H "Authorization: Bearer VOTRE_CLE_API"

Swagger / OpenAPI

Spécification OpenAPI 3.0 complète de l'API publique. Cliquez pour copier.

openapi.json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Le Proxy Français — API",
    "version": "1.0.0",
    "description": "API publique. Authentification par clé API (lpf_xxx) via Authorization: Bearer."
  },
  "servers": [
    {
      "url": "https://prx.lv"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Clé API (lpf_xxx)"
      }
    }
  },
  "paths": {
    "/auth/nonce": {
      "get": {
        "summary": "Obtenir un nonce pour la connexion wallet (SIWE)",
        "tags": [
          "Authentification"
        ],
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Adresse Ethereum (0x...)"
          }
        ],
        "responses": {
          "200": {
            "description": "{\"message\":\"Connexion a Le Proxy Francais...\",\"nonce\":\"550e8400-e29b-...\"}..."
          }
        }
      }
    },
    "/auth/wallet": {
      "post": {
        "summary": "Connexion wallet",
        "tags": [
          "Authentification"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string"
                  },
                  "signature": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "address",
                  "signature",
                  "message"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"token\":\"eyJhbGci...\",\"user\":{\"id\":1,\"username\":\"0x31b6...\",\"wallet_address\":\"0x31b6740e...\",\"auth_..."
          }
        }
      }
    },
    "/auth/register": {
      "post": {
        "summary": "Inscription email",
        "tags": [
          "Authentification"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "username",
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"success\":true,\"message\":\"Email de confirmation envoyé\"}..."
          }
        }
      }
    },
    "/auth/login": {
      "post": {
        "summary": "Connexion email",
        "tags": [
          "Authentification"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"token\":\"eyJhbGci...\",\"user\":{\"id\":1,\"email\":\"user@example.com\"}}..."
          }
        }
      }
    },
    "/auth/me": {
      "get": {
        "summary": "Utilisateur courant + permissions",
        "tags": [
          "Authentification"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "{\"user\":{\"id\":1,\"email\":\"user@example.com\",\"balance\":150},\"role\":\"user\",\"permissions\":[\"app.testnet\"..."
          }
        }
      }
    },
    "/auth/verify-email": {
      "get": {
        "summary": "Vérifier email",
        "tags": [
          "Authentification"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Token reçu par email"
          }
        ],
        "responses": {
          "200": {
            "description": "{\"success\":true,\"message\":\"Email vérifié avec succès\"}..."
          }
        }
      }
    },
    "/auth/resend-verification": {
      "post": {
        "summary": "Renvoyer email de vérification",
        "tags": [
          "Authentification"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"success\":true}..."
          }
        }
      }
    },
    "/auth/forgot-password": {
      "post": {
        "summary": "Demander reset mot de passe",
        "tags": [
          "Authentification"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"success\":true,\"message\":\"Si un compte existe, un email a été envoyé\"}..."
          }
        }
      }
    },
    "/auth/reset-password": {
      "post": {
        "summary": "Réinitialiser mot de passe",
        "tags": [
          "Authentification"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "token",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"success\":true,\"message\":\"Mot de passe réinitialisé\"}..."
          }
        }
      }
    },
    "/auth/change-password": {
      "post": {
        "summary": "Changer mot de passe",
        "tags": [
          "Authentification"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "currentPassword": {
                    "type": "string"
                  },
                  "newPassword": {
                    "type": "string"
                  }
                },
                "required": [
                  "currentPassword",
                  "newPassword"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"success\":true,\"message\":\"Mot de passe modifié\"}..."
          }
        }
      }
    },
    "/auth/link-wallet": {
      "post": {
        "summary": "Lier un wallet au compte",
        "tags": [
          "Authentification"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string"
                  },
                  "signature": {
                    "type": "string"
                  }
                },
                "required": [
                  "address",
                  "signature"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"success\":true,\"merged\":false,\"user\":{}}..."
          }
        }
      }
    },
    "/auth/unlink-wallet": {
      "delete": {
        "summary": "Délier wallet du compte",
        "tags": [
          "Authentification"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "{\"success\":true,\"user\":{}}..."
          }
        }
      }
    },
    "/keys": {
      "get": {
        "summary": "Lister vos clés API",
        "tags": [
          "Clés API"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "{\"keys\":[{\"id\":1,\"name\":\"Prod\",\"key_preview\":\"lpf_1f05...\",\"active\":1,\"daily_limit\":null,\"weekly_lim..."
          }
        }
      },
      "post": {
        "summary": "Créer une clé API",
        "tags": [
          "Clés API"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Max 10 clés actives par utilisateur.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "daily_limit": {
                    "type": "number"
                  },
                  "weekly_limit": {
                    "type": "number"
                  },
                  "monthly_limit": {
                    "type": "number"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"key\":{\"id\":2,\"name\":\"Production\",\"key_preview\":\"lpf_abc1...\",\"key\":\"lpf_abc123...\",\"active\":1,\"dai..."
          }
        }
      }
    },
    "/keys/{id}": {
      "get": {
        "summary": "Détail d'une clé",
        "tags": [
          "Clés API"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{\"key\":{\"id\":1,\"name\":\"Prod\",\"key_preview\":\"lpf_1f05...\",\"active\":1,\"daily_limit\":null,\"weekly_limit..."
          }
        }
      },
      "put": {
        "summary": "Modifier une clé",
        "tags": [
          "Clés API"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "daily_limit": {
                    "type": "number"
                  },
                  "weekly_limit": {
                    "type": "number"
                  },
                  "monthly_limit": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"success\":true,\"key\":{}}..."
          }
        }
      },
      "delete": {
        "summary": "Révoquer une clé",
        "tags": [
          "Clés API"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "La clé est immédiatement désactivée et ne peut plus être utilisée.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{\"success\":true}..."
          }
        }
      }
    },
    "/keys/{id}/reveal": {
      "get": {
        "summary": "Révéler la clé complète",
        "tags": [
          "Clés API"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{\"key\":\"lpf_1f0553c89d4138e8cc59bd46965f22d0\"}..."
          }
        }
      }
    },
    "/keys/{id}/regenerate": {
      "put": {
        "summary": "Regénérer une clé",
        "tags": [
          "Clés API"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{\"success\":true,\"key\":\"lpf_new_key_here...\"}..."
          }
        }
      }
    },
    "/usage": {
      "get": {
        "summary": "Crédits restants (tient compte de toutes les limites)",
        "tags": [
          "Usage & Solde"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "{\"remaining\":42.5}..."
          }
        }
      }
    },
    "/keys/usage": {
      "get": {
        "summary": "Usage détaillé par clé",
        "tags": [
          "Usage & Solde"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "{\"global\":{\"limits\":{\"daily\":100,\"weekly\":null,\"monthly\":null},\"used\":{\"daily\":12.5,\"weekly\":45,\"mon..."
          }
        }
      }
    },
    "/keys/usage/daily": {
      "get": {
        "summary": "Consommation journalière par type",
        "tags": [
          "Usage & Solde"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Nombre de jours (1-90, défaut 7)"
          }
        ],
        "responses": {
          "200": {
            "description": "{\"daily\":{\"2026-03-28\":{\"mutualise\":5.2,\"dedie\":1,\"navigateur\":0,\"total\":6.2,\"deposits\":50}},\"hourly..."
          }
        }
      }
    },
    "/keys/balance": {
      "get": {
        "summary": "Solde et résumé des transactions",
        "tags": [
          "Usage & Solde"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "{\"balance\":150,\"summary\":{\"deposit\":{\"total\":200,\"count\":3,\"by_subtype\":{\"USDT\":{\"total\":200,\"count\"..."
          }
        }
      }
    },
    "/keys/pricing": {
      "get": {
        "summary": "Grille tarifaire",
        "tags": [
          "Usage & Solde"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "{\"rate\":0.8,\"grid\":\"Premium\",\"tiers\":[{\"min_credits\":100,\"rate\":0.9},{\"min_credits\":500,\"rate\":0.8}]..."
          }
        }
      }
    },
    "/keys/transactions": {
      "get": {
        "summary": "Historique des transactions",
        "tags": [
          "Usage & Solde"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Page (défaut 1)"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Limite (défaut 20, max 100)"
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "deposit | consumption | adjustment"
          },
          {
            "name": "subtype",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Sous-type"
          },
          {
            "name": "api_key_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Filtrer par clé"
          }
        ],
        "responses": {
          "200": {
            "description": "{\"transactions\":[{\"id\":1,\"type\":\"deposit\",\"subtype\":2,\"subtype_label\":\"Paiement en ligne\",\"amount\":5..."
          }
        }
      }
    },
    "/keys/deposit": {
      "post": {
        "summary": "Soumettre un dépôt crypto (montant vérifié on-chain)",
        "tags": [
          "Dépôts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "currency: usdt | eth. chain_id: 1=Ethereum, 137=Polygon, 56=BSC, 8453=Base, 43114=Avalanche, 560048=Hoodi",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tx_hash": {
                    "type": "string"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "chain_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "tx_hash"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"success\":true,\"status\":\"pending\"}..."
          }
        }
      }
    },
    "/keys/settings": {
      "get": {
        "summary": "Récupérer les paramètres",
        "tags": [
          "Paramètres"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "{\"settings\":{\"daily_limit\":null,\"weekly_limit\":null,\"monthly_limit\":null,\"webhook_url\":null,\"webhook..."
          }
        }
      },
      "put": {
        "summary": "Modifier les limites globales",
        "tags": [
          "Paramètres"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "daily_limit": {
                    "type": "number"
                  },
                  "weekly_limit": {
                    "type": "number"
                  },
                  "monthly_limit": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"success\":true,\"settings\":{}}..."
          }
        }
      }
    },
    "/keys/settings/alerts": {
      "put": {
        "summary": "Configurer alertes et rechargement auto",
        "tags": [
          "Paramètres"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "alert_low_balance": {
                    "type": "boolean"
                  },
                  "alert_threshold": {
                    "type": "number"
                  },
                  "auto_reload_enabled": {
                    "type": "boolean"
                  },
                  "auto_reload_threshold": {
                    "type": "number"
                  },
                  "auto_reload_amount": {
                    "type": "number"
                  },
                  "save_card_consent": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"success\":true}..."
          }
        }
      }
    },
    "/keys/settings/webhooks": {
      "put": {
        "summary": "Configurer le webhook",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Events: { balanceLow: bool, deposit: bool, dailyUsage: bool }",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "webhook_url": {
                    "type": "string"
                  },
                  "webhook_events": {
                    "type": "object"
                  }
                },
                "required": [
                  "webhook_url",
                  "webhook_events"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "{\"success\":true,\"webhook_secret\":\"abc123...\"}..."
          }
        }
      }
    },
    "/keys/settings/webhooks/test": {
      "post": {
        "summary": "Tester le webhook",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "{\"success\":true,\"status\":200}..."
          }
        }
      }
    },
    "/keys/settings/webhooks/rotate-secret": {
      "post": {
        "summary": "Renouveler la clé HMAC",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "{\"success\":true,\"webhook_secret\":\"new_secret...\"}..."
          }
        }
      }
    }
  }
}
Sommaire