> ## Documentation Index
> Fetch the complete documentation index at: https://data.ornn.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the closed and open-source token price indexes

> The Closed Source and Open Source Token Indexes: per weight class, the labs' settled OTPI, each weighted by the tokens it priced that day, in USD per million tokens. Closed is `anthropic`, `openai`, `google`; open is `deepseek`, `minimax`, `xiaomi`, `qwen`, `moonshotai`, `z-ai`, `mistralai`, `meta-llama`.
With no dates, returns each class's latest settled day. Without a key, the trailing 3 months: an earlier `startDate` is clamped to the window, and a range that ends before it returns `401`. A Premium or Full key returns the complete history. A day on which a class could not be priced (a lab in it reported no volume on a day it normally does), and a closed day priced from fewer than all three closed labs, is omitted for that class, not returned as null or zero.


## Overview

The Closed Source and Open Source Token Indexes: per weight class, the labs' settled OTPI, each weighted by the tokens it priced that day, in USD per million tokens. Returns each class's latest settled day by default, or a `startDate`/`endDate` range; `class` limits the response to `closed` or `open`. Without a key, the trailing 3 months; a Premium or Full key returns the complete history. A day on which a class could not be priced is omitted for that class, not returned as null or zero. The response includes `access: "public-3mo" | "premium" | "full"`.


## OpenAPI

````yaml openapi.yaml GET /api/otpi/weight-class
openapi: 3.1.0
info:
  title: Ornn Data API
  version: 1.0.0
  description: >
    Read-only REST API for GPU and memory market data. The price index is the
    going rate of compute in USD per GPU-hour, a weighted average of all
    verified compute transactions across the market.
servers:
  - url: https://api.ornnai.com
security:
  - bearerAuth: []
tags:
  - name: Current Prices
  - name: Historical Prices
  - name: Analytics
  - name: Memory
  - name: Token Prices
  - name: Workload Cost
  - name: LLM Coding
  - name: Forward Curves
  - name: Token Volume
  - name: Model Frontier
  - name: Compute Buyers
  - name: Power Markets
  - name: Neo-Cloud Sites
  - name: Reference
paths:
  /api/otpi/weight-class:
    get:
      tags:
        - Token Prices
      summary: Get the closed and open-source token price indexes
      description: >
        The Closed Source and Open Source Token Indexes: per weight class, the
        labs' settled OTPI, each weighted by the tokens it priced that day, in
        USD per million tokens. Closed is `anthropic`, `openai`, `google`; open
        is `deepseek`, `minimax`, `xiaomi`, `qwen`, `moonshotai`, `z-ai`,
        `mistralai`, `meta-llama`.

        With no dates, returns each class's latest settled day. Without a key,
        the trailing 3 months: an earlier `startDate` is clamped to the window,
        and a range that ends before it returns `401`. A Premium or Full key
        returns the complete history. A day on which a class could not be priced
        (a lab in it reported no volume on a day it normally does), and a closed
        day priced from fewer than all three closed labs, is omitted for that
        class, not returned as null or zero.
      parameters:
        - name: class
          in: query
          description: closed or open. Omit for both. Any other value returns 400.
          schema:
            type: string
            enum:
              - closed
              - open
        - name: startDate
          in: query
          description: >-
            Inclusive start of a settlement-date range in YYYY-MM-DD. Use with
            `endDate`. Without a key, compute a date within the trailing 3
            months at request time.
          schema:
            type: string
            format: date
        - name: endDate
          in: query
          description: >-
            Inclusive end of a settlement-date range in YYYY-MM-DD. Use with
            `startDate`.
          schema:
            type: string
            format: date
      responses:
        '200':
          description: >
            One row per class per settled day, oldest first. `labsPriced` is how
            many labs in the class carried that day's value.
          content:
            application/json:
              example:
                success: true
                access: public-3mo
                startDate: '2026-01-01'
                endDate: '2026-01-01'
                count: 2
                data:
                  - date: '2026-01-01'
                    class: closed
                    indexPerMtok: 1
                    labsPriced: 3
                  - date: '2026-01-01'
                    class: open
                    indexPerMtok: 1
                    labsPriced: 8
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |
            curl "https://api.ornnai.com/api/otpi/weight-class"
        - lang: python
          label: Python
          source: |
            from datetime import date, timedelta
            import requests

            end_date = date.today()
            start_date = end_date - timedelta(days=30)
            rows = requests.get(
                "https://api.ornnai.com/api/otpi/weight-class",
                params={"startDate": start_date.isoformat(), "endDate": end_date.isoformat()},
            ).json()["data"]
            for r in rows:
                print(r["date"], r["class"], r["indexPerMtok"])
        - lang: javascript
          label: JavaScript
          source: >
            const res = await
            fetch("https://api.ornnai.com/api/otpi/weight-class?class=open");

            const { data } = await res.json();
components:
  responses:
    BadRequest:
      description: A required parameter is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing, invalid, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized
            message: 'API key required. Use Authorization: Bearer YOUR_API_KEY'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          example: Bad request
        message:
          type: string
          example: >-
            Invalid GPU type. Allowed: H100 SXM, H200, A100 SXM4, B200, RTX PRO
            6000 WS
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key passed as a Bearer token. Create one in the dashboard.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.