Provider Revenue API BETA

Access your revenue data programmatically through our REST API endpoints. Get detailed breakdowns of earnings, server performance, and transaction history.

Revenue API Overview

The Provider Revenue API gives you programmatic access to all your financial data including earnings, SLYD platform fees, server-specific revenue breakdowns, and historical transaction data. Perfect for integrating with your own dashboards, accounting systems, or analytics tools.

Getting Started

Base URL

BASE URL
https://slyd.com/api/provider/revenue

Authentication

All endpoints require API key authentication. You can provide your API key using one of these methods:

Option 1: Custom Header

X-API-Key: slyd_your_api_key_here

Option 2: Authorization Bearer

Authorization: Bearer slyd_your_api_key_here
To generate an API key, visit your account settings and navigate to the API Keys section.

API Endpoints

1 Get Comprehensive Revenue Data

GET /api/provider/revenue

Returns a complete overview of your revenue including summary statistics, monthly earnings, and server breakdown.

Example Request

curl -X GET "https://slyd.com/api/provider/revenue" \
  -H "X-API-Key: slyd_your_api_key_here"

Example Response

{
  "summary": {
    "totalEarningsYTD": 12450.75,
    "slydFeesYTD": 1383.42,
    "grossRevenueYTD": 13834.17,
    "currentMonthEarnings": 2890.50,
    "availableBalance": 8750.25
  },
  "monthlyEarnings": [
    {
      "month": "December 2024",
      "monthAbbreviation": "Dec",
      "amount": 2890.50
    },
    {
      "month": "November 2024",
      "monthAbbreviation": "Nov",
      "amount": 3120.75
    },
    {
      "month": "October 2024",
      "monthAbbreviation": "Oct",
      "amount": 2785.00
    }
  ],
  "serverRevenue": [
    {
      "serverId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "serverName": "gpu-server-01",
      "pricePerHour": 2.50,
      "totalEarnings": 4500.00,
      "slydFees": 500.00,
      "grossRevenue": 5000.00,
      "totalHours": 2000.0
    },
    {
      "serverId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "serverName": "cpu-compute-02",
      "pricePerHour": 1.25,
      "totalEarnings": 2700.00,
      "slydFees": 300.00,
      "grossRevenue": 3000.00,
      "totalHours": 2400.0
    }
  ],
  "recentPayouts": [
    {
      "payoutId": "payout_1234567890",
      "date": "2024-11-30T00:00:00Z",
      "amount": 3700.50,
      "method": "Stripe",
      "status": "Completed"
    }
  ]
}

2 Get Server-Specific Revenue Breakdown

GET /api/provider/revenue/servers

Returns detailed revenue breakdown by server with optional date filtering.

Query Parameters

Parameter Type Required Description
startDate string (ISO 8601) No Start date for revenue calculation. Default: 30 days ago
endDate string (ISO 8601) No End date for revenue calculation. Default: current date

Example Request

curl -X GET "https://slyd.com/api/provider/revenue/servers?startDate=2024-12-01&endDate=2024-12-31" \
  -H "X-API-Key: slyd_your_api_key_here"

Example Response

{
  "startDate": "2024-12-01T00:00:00Z",
  "endDate": "2024-12-31T00:00:00Z",
  "totalServers": 3,
  "activeServers": 2,
  "totalRevenue": 2890.50,
  "totalRentals": 45,
  "activeRentals": 12,
  "servers": [
    {
      "serverId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "serverName": "gpu-server-01",
      "serverType": "NVIDIA_A100",
      "status": "Active",
      "totalRevenue": 1550.00,
      "totalRentals": 20,
      "activeRentals": 5,
      "instances": [
        {
          "instanceId": "inst-001-abc123",
          "instanceName": "ml-training-01",
          "totalRevenue": 850.00,
          "totalRentals": 12,
          "activeRentals": 3
        },
        {
          "instanceId": "inst-002-def456",
          "instanceName": "ml-inference-02",
          "totalRevenue": 700.00,
          "totalRentals": 8,
          "activeRentals": 2
        }
      ]
    },
    {
      "serverId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "serverName": "cpu-compute-02",
      "serverType": "AMD_EPYC",
      "status": "Active",
      "totalRevenue": 890.50,
      "totalRentals": 15,
      "activeRentals": 7,
      "instances": [
        {
          "instanceId": "inst-003-ghi789",
          "instanceName": "web-server-01",
          "totalRevenue": 890.50,
          "totalRentals": 15,
          "activeRentals": 7
        }
      ]
    },
    {
      "serverId": "c3d4e5f6-a7b8-9012-cdef-234567890123",
      "serverName": "storage-node-03",
      "serverType": "Storage",
      "status": "Maintenance",
      "totalRevenue": 450.00,
      "totalRentals": 10,
      "activeRentals": 0,
      "instances": []
    }
  ]
}

Response Field Descriptions

Summary Object

Field Type Description
totalEarningsYTD decimal Your earnings year-to-date after SLYD's 10% platform fee
slydFeesYTD decimal SLYD's 10% platform fee amount year-to-date
grossRevenueYTD decimal Total revenue before fees (earnings + fees)
currentMonthEarnings decimal Earnings for the current calendar month
availableBalance decimal Current available balance in your wallet

Server Revenue Object

Field Type Description
serverId string (UUID) Unique identifier for the server
serverName string Display name of the server
pricePerHour decimal Hourly rate for the server in USD
totalEarnings decimal Provider's earnings from this server (after 10% fee)
slydFees decimal SLYD's 10% platform fee from this server
grossRevenue decimal Total gross revenue from this server
totalHours decimal Estimated total hours of usage

Error Responses

401 Unauthorized

Returned when the API key is missing or invalid.

{
  "error": "Unauthorized",
  "message": "API key authentication required"
}

500 Internal Server Error

Returned when an unexpected error occurs on the server.

{
  "error": "An error occurred while retrieving revenue data"
}

Code Examples

import requests
from datetime import datetime, timedelta

API_KEY = "slyd_your_api_key_here"
BASE_URL = "https://slyd.com/api/provider/revenue"

# Get comprehensive revenue data
response = requests.get(
    BASE_URL,
    headers={"X-API-Key": API_KEY}
)

if response.status_code == 200:
    data = response.json()
    print(f"Total earnings YTD: ${data['summary']['totalEarningsYTD']:.2f}")
    print(f"Current month: ${data['summary']['currentMonthEarnings']:.2f}")
    print(f"Available balance: ${data['summary']['availableBalance']:.2f}")

    # Show server breakdown
    for server in data['serverRevenue']:
        print(f"\nServer: {server['serverName']}")
        print(f"  Earnings: ${server['totalEarnings']:.2f}")
        print(f"  SLYD Fees: ${server['slydFees']:.2f}")
        print(f"  Total Hours: {server['totalHours']}")
else:
    print(f"Error: {response.status_code}")
    print(response.json())

# Get server revenue for specific date range
start_date = (datetime.now() - timedelta(days=30)).isoformat()
end_date = datetime.now().isoformat()

response = requests.get(
    f"{BASE_URL}/servers",
    params={
        "startDate": start_date,
        "endDate": end_date
    },
    headers={"X-API-Key": API_KEY}
)

if response.status_code == 200:
    data = response.json()
    print(f"\nRevenue from {data['startDate']} to {data['endDate']}")
    print(f"Total servers: {data['totalServers']}")
    print(f"Total revenue: ${data['totalRevenue']:.2f}")
const axios = require('axios');

const API_KEY = 'slyd_your_api_key_here';
const BASE_URL = 'https://slyd.com/api/provider/revenue';

async function getRevenueData() {
  try {
    // Get comprehensive revenue data
    const response = await axios.get(BASE_URL, {
      headers: {
        'X-API-Key': API_KEY
      }
    });

    const data = response.data;
    console.log(`Total earnings YTD: $${data.summary.totalEarningsYTD.toFixed(2)}`);
    console.log(`Current month: $${data.summary.currentMonthEarnings.toFixed(2)}`);
    console.log(`Available balance: $${data.summary.availableBalance.toFixed(2)}`);

    // Show server breakdown
    data.serverRevenue.forEach(server => {
      console.log(`\nServer: ${server.serverName}`);
      console.log(`  Earnings: $${server.totalEarnings.toFixed(2)}`);
      console.log(`  SLYD Fees: $${server.slydFees.toFixed(2)}`);
      console.log(`  Total Hours: ${server.totalHours}`);
    });

  } catch (error) {
    console.error('Error:', error.response?.status || error.message);
    console.error(error.response?.data);
  }
}

async function getServerRevenue(startDate, endDate) {
  try {
    const response = await axios.get(`${BASE_URL}/servers`, {
      params: {
        startDate: startDate,
        endDate: endDate
      },
      headers: {
        'X-API-Key': API_KEY
      }
    });

    const data = response.data;
    console.log(`\nRevenue from ${data.startDate} to ${data.endDate}`);
    console.log(`Total servers: ${data.totalServers}`);
    console.log(`Total revenue: $${data.totalRevenue.toFixed(2)}`);

  } catch (error) {
    console.error('Error:', error.response?.status || error.message);
  }
}

// Execute
getRevenueData();
# Get comprehensive revenue data
curl -X GET "https://slyd.com/api/provider/revenue" \
  -H "X-API-Key: slyd_your_api_key_here" \
  | jq '.'

# Get server revenue for last 30 days
curl -X GET "https://slyd.com/api/provider/revenue/servers?startDate=2024-12-01&endDate=2024-12-31" \
  -H "X-API-Key: slyd_your_api_key_here" \
  | jq '.'

# Using Bearer token format
curl -X GET "https://slyd.com/api/provider/revenue" \
  -H "Authorization: Bearer slyd_your_api_key_here" \
  | jq '.'

Important Notes

  • All monetary values are in USD
  • Earnings shown are after SLYD's 10% platform fee
  • Soft-deleted servers are included in historical revenue data
  • All date/time values are in UTC
  • API keys can be managed in your account settings
An unhandled error has occurred. Reload 🗙

Attempt 1 / 10