DocsAccount Endpoints

Account Endpoints

Manage your account, API keys, balance, and subscription.

Authentication

POST/v1/auth/register

Create a new account with 3-day free trial.

Request Body

{
  "email": "user@example.com",
  "password": "securepassword123"
}

Response

{
  "access_token": "eyJhbGciOiJIUzI1NiIs...",
  "user_id": "uuid-here",
  "email": "user@example.com"
}
Notes: Password must be at least 8 characters. New accounts start with $10,000 virtual balance (Basic) or $100,000 (Pro).
POST/v1/auth/login

Login and get JWT token.

Request Body

{
  "email": "user@example.com",
  "password": "securepassword123"
}

Response

{
  "access_token": "eyJhbGciOiJIUzI1NiIs...",
  "user_id": "uuid-here",
  "email": "user@example.com"
}
POST/v1/auth/forgot-password

Request a password reset email.

Request Body

{
  "email": "user@example.com"
}

Response

{
  "message": "If an account exists with this email, a password reset link has been sent."
}
POST/v1/auth/reset-password

Reset password using the token from email.

Request Body

{
  "token": "reset-token-from-email",
  "new_password": "newSecurePassword123"
}

Response

{
  "message": "Password has been reset successfully. You can now log in with your new password."
}
GET/v1/auth/me

Get current user profile and subscription status.

Headers

Authorization: Bearer your_jwt_token

Response

{
  "id": "uuid-here",
  "email": "user@example.com",
  "plan": "basic",
  "subscription_status": "active",
  "trial_expires_at": "2024-01-15T00:00:00Z",
  "subscription_expires_at": "2024-02-15T00:00:00Z",
  "payment_required": false,
  "created_at": "2024-01-01T00:00:00Z"
}

API Key Management

GET/v1/auth/api-keys

List all API keys for the current user.

Response

{
  "api_keys": [
    {
      "id": "key-uuid",
      "name": "Trading Bot",
      "key_prefix": "pe_abc123",
      "status": "active",
      "created_at": "2024-01-01T00:00:00Z",
      "last_used_at": "2024-01-10T12:00:00Z"
    }
  ]
}
POST/v1/auth/api-keys

Create a new API key. The full key is only shown once.

Request Body

{
  "name": "My Trading Bot"
}

Response

{
  "api_key": "pe_abc123xxxxxxxxxxxxxxxxxxxxxxxx",
  "id": "key-uuid",
  "name": "My Trading Bot",
  "message": "Save this key - it won't be shown again"
}
⚠️ The full API key is only returned once. Store it securely.
DELETE/v1/auth/api-keys/:id

Revoke an API key.

Response

{
  "message": "API key revoked successfully"
}

Account Management

GET/v1/exchanges/hyperliquid/account/overview

Get account overview with trading statistics.

Response

{
  "account_value": 10500.00,
  "initial_balance": 10000.00,
  "total_pnl": 500.00,
  "total_pnl_percent": 5.0,
  "withdrawable": 9800.00,
  "margin_used": 700.00,
  "positions_count": 2,
  "open_orders_count": 3,
  "positions": [...],
  "stats": {
    "total_trades": 45,
    "winning_trades": 28,
    "losing_trades": 17,
    "win_rate": 62.2,
    "total_volume": 125000.00,
    "total_fees_paid": 62.50,
    "best_trade": 234.50,
    "worst_trade": -156.20,
    "realized_pnl": 450.00,
    "unrealized_pnl": 50.00
  }
}
POST/v1/exchanges/hyperliquid/account/reset

Add funds to your account when balance is low. Adds $10,000 (Basic) or $100,000 (Pro) to your current balance without affecting positions or orders.

Requirements

  • Account balance must be below $100
  • Active subscription required (trial or paid)

Response

{
  "message": "Account topped up successfully",
  "previous_balance": 45.50,
  "added_amount": 10000.00,
  "new_balance": 10045.50
}
✓ Positions and orders are preserved. Only balance is increased.

Funding & Liquidation

PaperExchange accurately simulates Hyperliquid's funding rate payments and liquidation mechanics.

GET/v1/exchanges/hyperliquid/account/funding

Get funding payment history. Funding is applied hourly based on real Hyperliquid rates.

Query Parameters

  • coin - Filter by coin (optional)
  • limit - Max results (default: 100, max: 500)

Response

{
  "funding_payments": [
    {
      "coin": "BTC",
      "position_size": 0.5,
      "funding_rate": 0.0001,
      "oracle_price": 42500.00,
      "payment_amount": -2.125,
      "timestamp": "2024-01-15T12:00:00Z"
    }
  ],
  "summary": {
    "total_paid": -15.50,
    "total_received": 8.25,
    "net": -7.25,
    "count": 48
  }
}
💡 Positive funding rate = longs pay shorts. Negative = shorts pay longs.
GET/v1/exchanges/hyperliquid/account/funding/summary

Get funding summary grouped by coin.

Response

{
  "by_coin": {
    "BTC": { "total_funding": -12.50, "payment_count": 24 },
    "ETH": { "total_funding": 5.25, "payment_count": 24 }
  },
  "total": -7.25
}
GET/v1/exchanges/hyperliquid/account/liquidations

Get liquidation event history. Liquidations occur when account equity falls below maintenance margin.

Response

{
  "liquidations": [
    {
      "coin": "ETH",
      "position_size": 2.5,
      "entry_price": 2400.00,
      "liquidation_price": 2280.00,
      "mark_price": 2275.00,
      "account_value_before": 450.00,
      "maintenance_margin": 480.00,
      "realized_loss": -300.00,
      "timestamp": "2024-01-15T14:30:00Z"
    }
  ],
  "summary": {
    "total_liquidations": 1,
    "total_loss": -300.00
  }
}
⚠️ Liquidations close your position at market price when equity < maintenance margin.

Subscription

GET/v1/billing/subscription

Get current subscription status.

Response

{
  "status": "active",
  "plan": "pro",
  "current_period_start": "2024-01-01T00:00:00Z",
  "current_period_end": "2024-02-01T00:00:00Z",
  "days_remaining": 22,
  "features": {
    "balance": 100000,
    "api_keys": 10,
    "rate_limit": 500,
    "history_days": 90
  }
}
POST/v1/billing/subscribe

Create a checkout session for subscription payment.

Request Body

{
  "plan": "pro"  // "basic" or "pro"
}

Response

{
  "checkout_url": "https://checkout.atlos.io/...",
  "session_id": "session-uuid",
  "plan": "pro",
  "amount": 30.00,
  "original_amount": 50.00,
  "discount": 20.00,
  "currency": "USD"
}

Next: Error Codes

Learn about API error codes and how to handle them.

Error Codes Reference