Docs
00:04 UTC | 00:04 UTCPower your products with real-time GPU compute pricing data. Access the Ornn GPU Price Index through our simple REST API.
curl "https://api.ornnai.com/api/index" \
-H "Authorization: Bearer YOUR_API_KEY"Authentication
All API requests require authentication using a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEYGetting an API Key
- Sign up or log in to your Ornn account
- Navigate to the Data page
- Click "Create New Key" in the API Keys section
- Copy and securely store your API key
Quick Start
Make your first API call in under a minute.
1. Get Your API Key
Create an API key from the data dashboard.
2. Make Your First Request
curl "https://api.ornnai.com/api/index" \
-H "Authorization: Bearer YOUR_API_KEY"3. Parse the Response
{
"success": true,
"data": {
"gpuName": "H100 SXM",
"region": "",
"value": 1.89,
"date": "2024-12-11",
"updatedAt": "2024-12-11T18:04:42.484Z"
}
}API Reference
/healthNo AuthCheck API availability and database connectivity. No authentication required.
Response
{
"status": "healthy",
"timestamp": "2024-12-11T18:04:42.484Z",
"database": "connected"
}/apiRetrieve current index values for all tracked GPUs in a single request.
Response
{
"gpus": [
{
"gpu_name": "H100 SXM",
"region": "",
"index": 1.89,
"last_updated": "2024-12-11T18:04:42.484Z"
},
{
"gpu_name": "H200",
"region": "",
"index": 2.73,
"last_updated": "2024-12-11T18:04:42.484Z"
},
{
"gpu_name": "A100 SXM4",
"region": "",
"index": 1.25,
"last_updated": "2024-12-11T18:04:42.484Z"
}
],
"count": 3
}/api/gpu-typesRetrieve a list of all GPU types currently tracked by Ornn Data.
Response
{
"success": true,
"data": [
{"gpu_name": "H100 SXM", "region": ""},
{"gpu_name": "H200", "region": ""},
{"gpu_name": "A100 SXM4", "region": ""},
{"gpu_name": "RTX 5090", "region": ""}
]
}/api/indexGet the current GPU Price Index value. Defaults to H100 SXM if no GPU type specified.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| gpuType | string | GPU model (e.g., "H100 SXM", "H200"). Default: "H100 SXM" |
| region | string | Region filter. Default: empty string |
Example Request
curl "https://api.ornnai.com/api/index?gpuType=H200" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"success": true,
"data": {
"gpuName": "H200",
"region": "",
"value": 2.55,
"date": "2024-12-11",
"updatedAt": "2024-12-11T18:04:42.484Z"
}
}/api/gpu/:gpuName/history-simpleRetrieve historical GPU price index values.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| gpuName | string | Yes | GPU model name (path parameter, URL encoded) |
| startDate | string | Yes | Start date (YYYY-MM-DD or ISO 8601) |
| endDate | string | Yes | End date (YYYY-MM-DD or ISO 8601) |
| region | string | No | Region name (default: "") |
| granularity | string | No | "hourly", "daily", or "auto" (default: "auto") |
| limit | number | No | Maximum records to return (default: 100, max: 1000) |
Example Request
curl "https://api.ornnai.com/api/gpu/H100%20SXM/history-simple?startDate=2024-11-14&endDate=2024-11-21&granularity=daily" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"success": true,
"query": {
"gpu_name": "H100 SXM",
"start_date": "2024-11-14T00:00:00.000Z",
"end_date": "2024-11-21T00:00:00.000Z",
"records_found": 168,
"limit_applied": 100
},
"data": [
{
"timestamp": "2024-11-20T23:00:00.000Z",
"index_value": 2.85
},
{
"timestamp": "2024-11-20T22:00:00.000Z",
"index_value": 2.83
}
]
}/api/gpu/:gpuName/volatilityRetrieve rolling volatility of log returns for a GPU over a specified date range. Volatility is calculated as the standard deviation of daily log returns over a rolling window, annualized by multiplying by √365.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| gpuName | string | Yes | GPU model name (path parameter, URL encoded) |
| startDate | string | Yes | Start date (YYYY-MM-DD or ISO 8601) |
| endDate | string | Yes | End date (YYYY-MM-DD or ISO 8601) |
| region | string | No | Region name (default: "") |
| windowDays | number | No | Rolling window size in days (default: 30, range: 1-365) |
Example Request
curl "https://api.ornnai.com/api/gpu/H100%20SXM/volatility?startDate=2024-01-01&endDate=2024-12-31&windowDays=30" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"success": true,
"query": {
"gpu_name": "H100 SXM",
"region": "",
"start_date": "2024-01-01T00:00:00.000Z",
"end_date": "2024-12-31T00:00:00.000Z",
"records_found": 365,
"window_days": 30,
"data_granularity": "daily"
},
"data": [
{
"recorded_at": "2024-12-31T20:00:00.000Z",
"exact_timestamp": "2024-12-31T20:00:00.000Z",
"gpu_type": "H100 SXM",
"region": "global",
"index_value": 4.7,
"rolling_volatility": 0.15,
"window_days": 30
},
{
"recorded_at": "2024-12-30T20:00:00.000Z",
"exact_timestamp": "2024-12-30T20:00:00.000Z",
"gpu_type": "H100 SXM",
"region": "global",
"index_value": 4.72,
"rolling_volatility": 0.14,
"window_days": 30
}
]
}/api/gpu/:gpuName/volume-metricsRetrieve historical GPU utilization ratios. Utilization ratio represents the percentage of GPUs that are currently rented (rented_quantity / (rented_quantity + available_quantity)).
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| gpuName | string | Yes | GPU model name (path parameter, URL encoded) |
| startDate | string | Yes | Start date (YYYY-MM-DD or ISO 8601) |
| endDate | string | Yes | End date (YYYY-MM-DD or ISO 8601) |
| region | string | No | Region name (default: "") |
| granularity | string | No | "hourly" or "daily" (default: "hourly") |
| limit | number | No | Maximum records to return (default: 10000) |
Example Request
curl "https://api.ornnai.com/api/gpu/H100%20SXM/volume-metrics?startDate=2024-11-14&endDate=2024-11-21&granularity=hourly" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"success": true,
"query": {
"gpu_name": "H100 SXM",
"region": "",
"start_date": "2024-11-14T00:00:00.000Z",
"end_date": "2024-11-21T00:00:00.000Z",
"records_found": 168,
"limit_applied": 10000,
"data_granularity": "hourly"
},
"data": [
{
"recorded_at": "2024-11-20T23:00:00.000Z",
"exact_timestamp": "2024-11-20T23:00:00.000Z",
"utilization_ratio": 0.75
},
{
"recorded_at": "2024-11-20T22:00:00.000Z",
"exact_timestamp": "2024-11-20T22:00:00.000Z",
"utilization_ratio": 0.73
}
]
}Error Handling
The API uses standard HTTP status codes and returns structured error responses.
| Status | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 404 | Not Found - GPU or data not available |
| 500 | Internal Server Error |
Error Response Format
{
"error": "Unauthorized",
"message": "Invalid API key"
}Rate Limits
API requests are limited to 10,000 requests per hour per API key.
Best Practices
Store API keys securely
Never commit keys to version control or expose in client-side code
Cache responses
The index updates hourly. Cache responses to reduce API calls
Handle errors gracefully
Implement proper error handling and retry logic with exponential backoff
Use appropriate granularity
Use daily data for long-term trends, hourly for recent analysis
Support
Need help? We're here to assist you.