{
  "x402Version": 2,
  "id": 35425,
  "slug": "35425",
  "resource": "https://agentstoolshub.com/api/v1/dev/token-estimator",
  "description": "Estimate how many tokens a text consumes for each major model family (GPT, Claude, Gemini, Llama, DeepSeek) using a character/word heuristic that is within ~10% of real BPE tokenizers — enough for context budgeting and cost math, with zero dependencies. Use this when an agent needs to approximate token counts per LLM family, ±10%.",
  "type": "http",
  "serviceName": "AgentTools",
  "resourceType": "AI Inference",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0x8a0F2b0a6C82D1c54B16E2e4DEcd18fF0802b0f6",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "2000",
      "amountUsd": 0.002,
      "maxTimeoutSeconds": 300
    }
  ],
  "outputSchema": {
    "properties": {
      "example": {
        "type": "object"
      },
      "type": {
        "type": "string"
      }
    },
    "required": [
      "type"
    ],
    "type": "object"
  },
  "extensions": {
    "analytics": {},
    "bazaar": {
      "info": {
        "input": {
          "method": "GET",
          "queryParams": {
            "text": "The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs."
          },
          "type": "http"
        },
        "output": {
          "example": {
            "result": {
              "answer": "23 tokens (GPT family)",
              "answerLabel": "85 chars · ±10% estimate",
              "details": [
                {
                  "label": "Characters",
                  "value": "85"
                },
                {
                  "label": "Words",
                  "value": "17"
                },
                {
                  "label": "CJK characters",
                  "value": "0"
                },
                {
                  "label": "Method",
                  "value": "heuristic (chars/word mix, CJK-aware)"
                }
              ],
              "steps": [
                "CJK characters count ≈ 1.1 tokens each",
                "Other scripts ≈ 3.7 chars/token, blended with words × 1.32",
                "Model multipliers applied: 1, 1.06, 1.12, 1.18, 1.1"
              ],
              "table": {
                "columns": [
                  "Model family",
                  "Est. tokens"
                ],
                "rows": [
                  [
                    "gpt-4o / gpt-4.1 / gpt-5 (o200k)",
                    23
                  ],
                  [
                    "claude (Opus / Sonnet / Haiku)",
                    25
                  ],
                  [
                    "gemini 2.5 / 3",
                    26
                  ],
                  [
                    "llama 4 / mistral",
                    28
                  ],
                  [
                    "deepseek v3",
                    26
                  ]
                ]
              },
              "value": 23
            },
            "tool": "token-estimator"
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "method": {
                "enum": [
                  "GET"
                ],
                "type": "string"
              },
              "queryParams": {
                "properties": {
                  "text": {
                    "description": "Text",
                    "type": "string"
                  }
                },
                "required": [
                  "text"
                ],
                "type": "object"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "dev",
    "crypto-dev",
    "analytics",
    "bazaar"
  ],
  "sourceHost": "agentstoolshub.com",
  "lastUpdated": "2026-10-11T22:54:15.592Z",
  "quality": {
    "calls30d": 2,
    "uniquePayers30d": 2,
    "lastCalledAt": "2026-10-11T22:54:15.464Z"
  },
  "metadata": {
    "serviceName": "AgentTools",
    "extensions": {
      "analytics": {},
      "bazaar": {
        "info": {
          "input": {
            "method": "GET",
            "queryParams": {
              "text": "The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs."
            },
            "type": "http"
          },
          "output": {
            "example": {
              "result": {
                "answer": "23 tokens (GPT family)",
                "answerLabel": "85 chars · ±10% estimate",
                "details": [
                  {
                    "label": "Characters",
                    "value": "85"
                  },
                  {
                    "label": "Words",
                    "value": "17"
                  },
                  {
                    "label": "CJK characters",
                    "value": "0"
                  },
                  {
                    "label": "Method",
                    "value": "heuristic (chars/word mix, CJK-aware)"
                  }
                ],
                "steps": [
                  "CJK characters count ≈ 1.1 tokens each",
                  "Other scripts ≈ 3.7 chars/token, blended with words × 1.32",
                  "Model multipliers applied: 1, 1.06, 1.12, 1.18, 1.1"
                ],
                "table": {
                  "columns": [
                    "Model family",
                    "Est. tokens"
                  ],
                  "rows": [
                    [
                      "gpt-4o / gpt-4.1 / gpt-5 (o200k)",
                      23
                    ],
                    [
                      "claude (Opus / Sonnet / Haiku)",
                      25
                    ],
                    [
                      "gemini 2.5 / 3",
                      26
                    ],
                    [
                      "llama 4 / mistral",
                      28
                    ],
                    [
                      "deepseek v3",
                      26
                    ]
                  ]
                },
                "value": 23
              },
              "tool": "token-estimator"
            },
            "type": "json"
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "input": {
              "additionalProperties": false,
              "properties": {
                "method": {
                  "enum": [
                    "GET"
                  ],
                  "type": "string"
                },
                "queryParams": {
                  "properties": {
                    "text": {
                      "description": "Text",
                      "type": "string"
                    }
                  },
                  "required": [
                    "text"
                  ],
                  "type": "object"
                },
                "type": {
                  "const": "http",
                  "type": "string"
                }
              },
              "required": [
                "type",
                "method"
              ],
              "type": "object"
            },
            "output": {
              "properties": {
                "example": {
                  "type": "object"
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "type": "object"
            }
          },
          "required": [
            "input"
          ],
          "type": "object"
        }
      }
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": false,
  "featured": false,
  "provider": {
    "host": "agentstoolshub.com",
    "manifest_name": "agentstoolshub.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"
  },
  "exampleResponse": {
    "example": {},
    "type": "string"
  }
}