Docs

API Reference

https://stats.targon.com/api

Global AVG

POST https://stats.targon.com/api/stats/avg
Fetches the average statistics across a specified block range. You can filter by verification status, a specific validator's hotkey, and paginate the results.
Query Parameters
  • verified (required, boolean): Filters the results based on whether the responses are verified or not.
  • startblock (optional, number): The starting block number to fetch statistics from. Defaults to the latest block minus 360.
  • endblock (optional, number): The ending block number to fetch statistics until. Defaults to the latest block.
  • validator_hotkeys (optional, string[]): The validator hotkeys to filter the results. If not provided, results from all validators are included.
  • limit (optional, number): The number of records to return in the response. Defaults to 100. Maximum limit is 300.
  • offset (optional, number): The number of records to skip before starting to return results. Defaults to 0.

Example Request

POST https://stats.targon.com/api/stats/avg
Ensure the request includes a Bearer Token in the Authorization header:
Authorization: Bearer [your-api-key]
{
  "verified": true,
  "startblock": 3612400,
  "endblock": 3612488,
  "validator_hotkeys": ["validator_hotkey1". "validator_hotkey2"],
  "limit": 200,
  "offset": 4
}
Example Response
{
  "stats": [
    {
      "minute": 1683726000000,
      "avg_tps": 2.5,
      "avg_time_for_all_tokens": 0.003,
      "avg_total_time": 0.01,
      "avg_time_to_first_token": 0.002,
      "validator": "ValidatorName",
      "validator_hotkey": "validator_hotkey",
      "id": 1
    }
  ],
  "totalRecords": 500,
  "limit": 200,
  "offset": 4
}
This response contains the fetched statistics and pagination metadata:
  • stats: An array of objects, each representing statistics for a particular block or minute.
  • pagination: Metadata about the returned results, including limit, offset, and count of totalRecords.

Miner Responses

POST https://stats.targon.com/api/stats/responses
Retrieves miner responses and statistics based on a given hotkey/coldkey/UID, block range, validator hotkey, and pagination parameters.
Query Parameters
  • query (required, string): The miner identifier to search for, which could be a hotkey, coldkey, or UID.
  • verified (required, boolean): Filters the results based on whether the responses are verified or not.
  • startblock (optional, number): The starting block number to fetch statistics from. Defaults to the latest block minus 360.
  • endblock (optional, number): The ending block number to fetch statistics until. Defaults to the latest block.
  • validator_hotkeys (optional, string[]): The validator hotkeys to filter the results. If not provided, results from all validators are included.
  • extras (optional, object): An object containing additional fields to include in the response. Currently supports:
    • tokens (boolean): When true, includes the token-level details in the response. Defaults to false.
    • organics (boolean): When true, returns organic responses instead of synthetic responses. Defaults to false.
  • limit (optional, number): The number of records to return in the response. Defaults to 100. Maximum limit is 300.
  • offset (optional, number): The number of records to skip before starting to return results. Defaults to 0.

Example Request

POST https://stats.targon.com/api/stats/responses
Ensure the request includes a Bearer Token in the Authorization header:
Authorization: Bearer [your-api-key]
{
  "query": "0",
  "verified": true,
  "startblock": 3612400,
  "endblock": 3612488,
  "validator_hotkeys": ["validator_hotkey", "validator_hotkey2"],
  "extras": {
    "tokens": true,
    "organics": false
  },
  "limit": 200,
  "offset": 4
}
Example Synthetic Response
{
    "responses": [
        {
            "tps": 50.7754,
            "totalTime": 3.60411,
            "timeToFirstToken": 1.85199,
            "timeForAllTokens": 1.75212,
            "verified": true,
            "error": null,
            "cause": null,
            "messages": [
                {
                    "role": "system",
                    "content": "\n### Current Date: 2024-12-19\n### Instruction:\nYou are to take on the role of Con..."
                },
                {
                    "role": "user",
                    "content": "Search query: What theory brings together continental drift and seafloor spreading?"
                }
            ],
            "model": "NousResearch/Meta-Llama-3.1-8B-Instruct",
            "seed": 5402214,
            "maxTokens": 802,
            "temperature": 0.326203,
            "requestEndpoint": "CHAT",
            "block": 4517585,
            "timestamp": "2024-12-19T19:11:14.000Z",
            "version": 403010,
            "validator": "Foundry",
            "validatorHotkey": "5HEo565WAy4Dbq3Sv271SAi7syBSofyfhhwRNjFNSM2gP9M2",
            "id": 46767535
        }
    ],
    "totalRecords": "207",
    "offset": 0,
    "limit": 2,
    "hasMoreRecords": true
}
Example Organic Response
{
    "responses": [
        {
            "tps": 246.988,
            "totalTime": 166,
            "timeToFirstToken": 158,
            "timeForAllTokens": 8,
            "verified": true,
            "tokens": [],
            "error": null,
            "cause": null,
            "messages": [],
            "model": "EnvyIrys/EnvyIrys_sn111_14",
            "seed": 1734554855,
            "maxTokens": 500,
            "temperature": 0.2,
            "requestEndpoint": "COMPLETION",
            "block": 0,
            "timestamp": "2024-12-18T20:48:47.000Z",
            "version": 0,
            "validator": "",
            "validatorHotkey": "",
            "id": 1
        }
    ],
    "totalRecords": "2",
    "offset": 0,
    "limit": 2,
    "hasMoreRecords": false
}
Note the differences in organic responses:
  • tokens and messages are empty arrays
  • block and version are 0
  • validator and validator_hotkey are empty strings
  • All other fields maintain their actual values from the organic request
This response contains the fetched miner responses and pagination metadata:
  • responses: An array of objects, each representing the miner response and associated statistics for a particular block.
  • pagination: Metadata about the returned results, including limit, offset, and totalRecords.

Validator Models

POST https://stats.targon.com/api/validator/model
Retrieves information about validator models, including their hotkeys, names, and their challenge models.
Query Parameters
  • validator_hotkeys (optional, string[]): An array of validator hotkeys to filter the results. If not provided, results from all validators are included.

Example Request

POST https://stats.targon.com/api/validator/model
Ensure the request includes a Bearer Token in the Authorization header:
Authorization: Bearer [your-api-key]
{
  "validator_hotkeys": ["validator_hotkey1", "validator_hotkey2"]
}
Example Response
[
  {
    "hotkey": "validator_hotkey1",
    "valiName": "Validator 1",
    "models": ["model1", "model2"]
  },
  {
    "hotkey": "validator_hotkey2",
    "valiName": "Validator 2",
    "models": ["model3", "model4"]
  }
]
This response contains information about the validators and their associated models:
  • validatorModels: An array of objects, each representing a validator with their hotkey, name, and list of models.

Validator Live Stats

POST https://stats.targon.com/api/validator/live
Retrieves live statistics for validators, including their hotkeys, names, models, and the number of requests they have received in the last 24 hours.

Example Request

POST https://stats.targon.com/api/validator/live
Ensure the request includes a Bearer Token in the Authorization header:
Authorization: Bearer [your-api-key]
Example Response
[
    {
        "hotkey": "5DQ2Geab6G25wiZ4jGH6wJM8fekrm1QhV9hrRuntjBVxxKZm",
        "valiName": "Miner's Union Validator",
        "models": [
            "NousResearch/Meta-Llama-3.1-8B-Instruct"
        ],
        "requestCount": "5078"
    },
    {
        "hotkey": "5F2CsUDVbRbVMXTh9fAzF9GacjVX7UapvRxidrxe7z8BYckQ",
        "valiName": "Rizzo",
        "models": [
            "NousResearch/Meta-Llama-3.1-8B-Instruct"
        ],
        "requestCount": "4125"
    },
    {
        "hotkey": "5FFApaS75bv5pJHfAp2FVLBj9ZaXuFDjEypsaBNc1wCfe52v",
        "valiName": "RoundTable21",
        "models": [
            "NousResearch/Meta-Llama-3.1-8B-Instruct",
            "NousResearch/Hermes-3-Llama-3.1-8B",
            "EnvyIrys/EnvyIrys_sn111_14",
            "gryphe/mythomax-l2-13b",
            "deepseek-ai/deepseek-coder-33b-instruct",
            "Qwen/Qwen2.5-Coder-7B-Instruct"
        ],
        "requestCount": "5433"
    }
]
This response contains information about the validators and their associated live stats:
  • validatorLiveStats: An array of objects, each representing a validator with their hotkey, name, list of models, and the number of requests they have received in the last 24 hours.