Docs

00:04 UTC

Power your products with real-time GPU compute pricing data. Access the Ornn GPU Price Index through our simple REST API.

Quick Start

Get started in minutes with our simple API

View Guide →

API Reference

Complete reference for all endpoints

Explore APIs →
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_KEY

Getting an API Key

  1. Sign up or log in to your Ornn account
  2. Navigate to the Data page
  3. Click "Create New Key" in the API Keys section
  4. 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

GET/healthNo Auth

Check API availability and database connectivity. No authentication required.

Response

{
  "status": "healthy",
  "timestamp": "2024-12-11T18:04:42.484Z",
  "database": "connected"
}
GET/api

Retrieve 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
}
GET/api/gpu-types

Retrieve 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": ""}
  ]
}
GET/api/index

Get the current GPU Price Index value. Defaults to H100 SXM if no GPU type specified.

Query Parameters

ParameterTypeDescription
gpuTypestringGPU model (e.g., "H100 SXM", "H200"). Default: "H100 SXM"
regionstringRegion 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"
  }
}
GET/api/gpu/:gpuName/history-simple

Retrieve historical GPU price index values.

Query Parameters

ParameterTypeRequiredDescription
gpuNamestringYesGPU model name (path parameter, URL encoded)
startDatestringYesStart date (YYYY-MM-DD or ISO 8601)
endDatestringYesEnd date (YYYY-MM-DD or ISO 8601)
regionstringNoRegion name (default: "")
granularitystringNo"hourly", "daily", or "auto" (default: "auto")
limitnumberNoMaximum 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
    }
  ]
}
GET/api/gpu/:gpuName/volatility

Retrieve 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

ParameterTypeRequiredDescription
gpuNamestringYesGPU model name (path parameter, URL encoded)
startDatestringYesStart date (YYYY-MM-DD or ISO 8601)
endDatestringYesEnd date (YYYY-MM-DD or ISO 8601)
regionstringNoRegion name (default: "")
windowDaysnumberNoRolling 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
    }
  ]
}
GET/api/gpu/:gpuName/volume-metrics

Retrieve historical GPU utilization ratios. Utilization ratio represents the percentage of GPUs that are currently rented (rented_quantity / (rented_quantity + available_quantity)).

Query Parameters

ParameterTypeRequiredDescription
gpuNamestringYesGPU model name (path parameter, URL encoded)
startDatestringYesStart date (YYYY-MM-DD or ISO 8601)
endDatestringYesEnd date (YYYY-MM-DD or ISO 8601)
regionstringNoRegion name (default: "")
granularitystringNo"hourly" or "daily" (default: "hourly")
limitnumberNoMaximum 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.

StatusMeaning
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
404Not Found - GPU or data not available
500Internal 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.

Ornn Assistant

Ask about GPU prices

Hi! I'm Ornn Assistant.

Ask me about GPU prices, trends, or comparisons.