Provider Revenue API
Access your revenue data programmatically through our REST API endpoints. Get detailed breakdowns of earnings, server performance, and transaction history.
Revenue Data
Access earnings, fees, and balance information programmatically.
Server Breakdown
Get per-server revenue data with instance-level details.
Easy Integration
Simple REST endpoints with Python, JavaScript, and cURL examples.
Getting Started
Base URL and authentication setup
Base URL
https://slyd.com/api/provider/revenueAuthentication
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_hereOption 2: Authorization Bearer
Authorization: Bearer slyd_your_api_key_hereTo generate an API key, visit your account settings and navigate to the API Keys section.
Get Comprehensive Revenue Data
GET /api/provider/revenue
/api/provider/revenueReturns 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
}
],
"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
}
],
"recentPayouts": [
{
"payoutId": "payout_1234567890",
"date": "2024-11-30T00:00:00Z",
"amount": 3700.50,
"method": "Stripe",
"status": "Completed"
}
]
}Get Server-Specific Revenue Breakdown
GET /api/provider/revenue/servers
/api/provider/revenue/serversReturns detailed revenue breakdown by server with optional date filtering.
Query Parameters
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
}
]
}
]
}Response Field Descriptions
Detailed field documentation
Summary Object
Server Revenue Object
Error Responses
HTTP error codes and messages
Unauthorized
API key is missing or invalid
{
"error": "Unauthorized",
"message": "API key authentication required"
}Internal Server Error
Unexpected server error
{
"error": "An error occurred while retrieving revenue data"
}Code Examples
Python, JavaScript, and cURL 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}")
# 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}
)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 {
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)}`);
});
} catch (error) {
console.error('Error:', error.response?.status || error.message);
}
}
async function getServerRevenue(startDate, endDate) {
const response = await axios.get(`${BASE_URL}/servers`, {
params: { startDate, endDate },
headers: { 'X-API-Key': API_KEY }
});
return response.data;
}
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
Key information about the API
