{
  "x402Version": 2,
  "id": 52636,
  "slug": "52636",
  "resource": "https://tokens.openverbs.com/v1/count",
  "description": "Count the LLM tokens in text for a given model or encoding — exact for OpenAI and open models (Llama, Mistral, Qwen, Gemma, DeepSeek, Command-R); labelled-approximate for Claude & Gemini.",
  "type": "http",
  "serviceName": "Count tokens",
  "resourceType": "AI Inference",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0xb3f4de103F34b99f0Da19B4F16D6B53a14C2194A",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "4000",
      "amountUsd": 0.004,
      "maxTimeoutSeconds": 300
    }
  ],
  "extensions": {
    "bazaar": {
      "info": {
        "input": {
          "body": {
            "encoding": "o200k_base",
            "model": "example",
            "text": "example"
          },
          "bodyType": "json",
          "method": "POST",
          "type": "http"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "additionalProperties": false,
                "properties": {
                  "encoding": {
                    "description": "Explicit OpenAI BPE encoding. Overrides \"model\" and is always exact. Defaults to o200k_base.",
                    "enum": [
                      "o200k_base",
                      "cl100k_base",
                      "p50k_base",
                      "r50k_base"
                    ],
                    "type": "string"
                  },
                  "model": {
                    "description": "LLM model name, e.g. \"gpt-4o\", \"llama-3.1-70b\", \"claude-3-5-sonnet\". Resolved to its tokenizer. Defaults to gpt-4o. Supported families: o200k_base, cl100k_base, p50k_base, r50k_base, llama3, llama2, mistral, qwen, gemma, deepseek, command-r, claude, gemini.",
                    "maxLength": 100,
                    "minLength": 1,
                    "type": "string"
                  },
                  "text": {
                    "description": "The text to tokenize. Empty string counts as 0 tokens.",
                    "maxLength": 100000,
                    "type": "string"
                  }
                },
                "required": [
                  "text"
                ],
                "type": "object"
              },
              "bodyType": {
                "enum": [
                  "json",
                  "form-data",
                  "text"
                ],
                "type": "string"
              },
              "method": {
                "enum": [
                  "POST"
                ],
                "type": "string"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method",
              "bodyType",
              "body"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "count llm tokens",
    "token count api",
    "count text tokens",
    "estimate prompt tokens",
    "model tokenizer count",
    "bazaar"
  ],
  "sourceHost": "tokens.openverbs.com",
  "lastUpdated": "2026-10-05T12:41:59.062Z",
  "quality": {
    "calls30d": 2,
    "uniquePayers30d": 2,
    "lastCalledAt": "2026-10-05T12:41:58.789Z"
  },
  "metadata": {
    "serviceName": "Count tokens",
    "extensions": {
      "bazaar": {
        "info": {
          "input": {
            "body": {
              "encoding": "o200k_base",
              "model": "example",
              "text": "example"
            },
            "bodyType": "json",
            "method": "POST",
            "type": "http"
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "input": {
              "additionalProperties": false,
              "properties": {
                "body": {
                  "additionalProperties": false,
                  "properties": {
                    "encoding": {
                      "description": "Explicit OpenAI BPE encoding. Overrides \"model\" and is always exact. Defaults to o200k_base.",
                      "enum": [
                        "o200k_base",
                        "cl100k_base",
                        "p50k_base",
                        "r50k_base"
                      ],
                      "type": "string"
                    },
                    "model": {
                      "description": "LLM model name, e.g. \"gpt-4o\", \"llama-3.1-70b\", \"claude-3-5-sonnet\". Resolved to its tokenizer. Defaults to gpt-4o. Supported families: o200k_base, cl100k_base, p50k_base, r50k_base, llama3, llama2, mistral, qwen, gemma, deepseek, command-r, claude, gemini.",
                      "maxLength": 100,
                      "minLength": 1,
                      "type": "string"
                    },
                    "text": {
                      "description": "The text to tokenize. Empty string counts as 0 tokens.",
                      "maxLength": 100000,
                      "type": "string"
                    }
                  },
                  "required": [
                    "text"
                  ],
                  "type": "object"
                },
                "bodyType": {
                  "enum": [
                    "json",
                    "form-data",
                    "text"
                  ],
                  "type": "string"
                },
                "method": {
                  "enum": [
                    "POST"
                  ],
                  "type": "string"
                },
                "type": {
                  "const": "http",
                  "type": "string"
                }
              },
              "required": [
                "type",
                "method",
                "bodyType",
                "body"
              ],
              "type": "object"
            }
          },
          "required": [
            "input"
          ],
          "type": "object"
        }
      }
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": false,
  "featured": false,
  "provider": {
    "host": "tokens.openverbs.com",
    "manifest_name": "tokens.openverbs.com",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-10-14T01:15:01.050Z"
  }
}