> ## 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 latest token price index by lab

> The Ornn Token Price Index (OTPI): a daily, volume-weighted blended price per million tokens for each major model lab. Returns the latest settled day by default, a specific `date`, or a `startDate`/`endDate` range. Use `lab` to filter to a single lab. Without a key, the free tier covers 4 labs — `anthropic`, `openai`, `google`, `deepseek` — for the trailing 1 month (the same free window on index.ornn.com); other labs and older history require an API key. The response includes `access: "public-1mo" | "full"`.


## Overview

The Ornn Token Price Index (OTPI): a daily, volume-weighted blended price per million tokens for each major model lab. Returns the latest settled day by default, a specific `date`, or a `startDate`/`endDate` range. Use `lab` to filter to a single lab. Without a key, the free tier covers 4 labs - `anthropic`, `openai`, `google`, `deepseek` - for the trailing 1 month (the same free window on index.ornn.com); other labs and older history require an API key. The response includes `access: "public-1mo" | "full"`.


## OpenAPI

````yaml openapi.yaml GET /api/otpi
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: Neo-Cloud Sites
  - name: Reference
paths:
  /api/otpi:
    get:
      tags:
        - Token Prices
      summary: Get the latest token price index by lab
      description: >
        The Ornn Token Price Index (OTPI): a daily, volume-weighted blended
        price per million tokens for each major model lab. Returns the latest
        settled day by default, a specific `date`, or a `startDate`/`endDate`
        range. Use `lab` to filter to a single lab. Without a key, the free tier
        covers 4 labs — `anthropic`, `openai`, `google`, `deepseek` — for the
        trailing 1 month (the same free window on index.ornn.com); other labs
        and older history require an API key. The response includes `access:
        "public-1mo" | "full"`.
      parameters:
        - name: date
          in: query
          description: >-
            Settlement date in YYYY-MM-DD. Returns that single day. Omit it for
            the latest settled day, as shown in the runnable examples above.
            Anonymous callers must compute a recent date at request time because
            dates older than the trailing 1 month require a key.
          schema:
            type: string
            format: date
        - name: startDate
          in: query
          description: >-
            Inclusive start of a settlement-date range in YYYY-MM-DD. Use with
            `endDate`. For a no-key request, compute a date within the trailing
            1 month at request time (for example, 7 days ago); older history
            requires a key.
          schema:
            type: string
            format: date
        - name: endDate
          in: query
          description: >-
            Inclusive end of a settlement-date range in YYYY-MM-DD. Use with
            `startDate`; compute a current or recent settled date at request
            time so anonymous examples remain inside the rolling public window.
          schema:
            type: string
            format: date
        - name: lab
          in: query
          description: >-
            Filter to a single lab. Without a key, only anthropic, openai,
            google, deepseek are available; other labs require an API key.
          schema:
            type: string
            enum:
              - anthropic
              - openai
              - google
              - deepseek
              - minimax
              - xiaomi
              - qwen
              - moonshotai
              - z-ai
              - mistralai
              - meta-llama
      responses:
        '200':
          description: >
            OTPI values per lab. Single-day responses (the default, or with
            `date`) carry a top-level `date`; range responses
            (`startDate`/`endDate`) carry top-level `startDate` and `endDate`
            and no `date`.
          content:
            application/json:
              examples:
                single:
                  summary: Single settled day
                  value:
                    success: true
                    access: public-1mo
                    date: '2026-01-01'
                    count: 4
                    data:
                      - date: '2026-01-01'
                        lab: anthropic
                        indexPerMtok: 1
                        computedAt: '2026-01-01T00:00:00.000Z'
                      - date: '2026-01-01'
                        lab: openai
                        indexPerMtok: 1
                        computedAt: '2026-01-01T00:00:00.000Z'
                      - date: '2026-01-01'
                        lab: google
                        indexPerMtok: 1
                        computedAt: '2026-01-01T00:00:00.000Z'
                      - date: '2026-01-01'
                        lab: deepseek
                        indexPerMtok: 1
                        computedAt: '2026-01-01T00:00:00.000Z'
                range:
                  summary: Date range with lab filter
                  value:
                    success: true
                    access: public-1mo
                    startDate: '2026-01-01'
                    endDate: '2026-01-02'
                    count: 2
                    data:
                      - date: '2026-01-01'
                        lab: anthropic
                        indexPerMtok: 1
                        computedAt: '2026-01-01T00:00:00.000Z'
                      - date: '2026-01-02'
                        lab: anthropic
                        indexPerMtok: 1
                        computedAt: '2026-01-02T00:00:00.000Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
      security: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |
            curl "https://api.ornnai.com/api/otpi"
        - lang: python
          label: Python
          source: >
            import requests


            rows =
            requests.get("https://api.ornnai.com/api/otpi").json()["data"]

            for r in rows:
                print(r["lab"], r["indexPerMtok"])
        - lang: javascript
          label: JavaScript
          source: |
            const res = await fetch("https://api.ornnai.com/api/otpi");
            const { data } = await res.json();
        - lang: php
          label: PHP
          source: |
            <?php
            $ch = curl_init("https://api.ornnai.com/api/otpi");
            curl_setopt_array($ch, [
                CURLOPT_RETURNTRANSFER => true,
            ]);
            $data = json_decode(curl_exec($ch), true);
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tendpoint := \"https://api.ornnai.com/api/otpi\"\n\treq, _ := http.NewRequest(\"GET\", endpoint, nil)\n\tresp, _ := http.DefaultClient.Do(req)\n\tdefer resp.Body.Close()\n\tbody, _ := io.ReadAll(resp.Body)\n\t_ = body\n}\n"
        - lang: java
          label: Java
          source: >
            import java.net.URI;

            import java.net.http.HttpClient;

            import java.net.http.HttpRequest;

            import java.net.http.HttpResponse;


            HttpClient client = HttpClient.newHttpClient();

            HttpRequest request = HttpRequest.newBuilder(
                    URI.create("https://api.ornnai.com/api/otpi"))
                .build();
            HttpResponse<String> response = client.send(request,
            HttpResponse.BodyHandlers.ofString());
        - lang: ruby
          label: Ruby
          source: >
            require "net/http"

            require "json"


            uri = URI("https://api.ornnai.com/api/otpi")

            req = Net::HTTP::Get.new(uri)

            res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http|
            http.request(req) }

            data = JSON.parse(res.body)
components:
  responses:
    BadRequest:
      description: A required parameter is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: No data found for the given parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: No data available
            message: No daily index data found for H100 SXM
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          example: Bad request
        message:
          type: string
          example: >-
            Invalid GPU type. Allowed: H100 SXM, H200, A100 SXM4, RTX 5090,
            B200, RTX PRO 6000 WS
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key passed as a Bearer token. Create one in the dashboard.

````