{
  "info": {
    "_postman_id": "621cfd0d-39e3-4822-a2d4-df2c9f136e27",
    "name": "Anthropic Token Counting API",
    "description": "Count the number of tokens in a Message, including tools, images, and documents, without creating it. The Token Count API accepts the same structured list of inputs for creating a message, including support for system prompts, tools, images, and PDFs. Token counting is free to use but subject to requests-per-minute rate limits.\n\n\nContact Support:\n Name: Anthropic Support",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "createdAt": "2026-06-05T15:05:32.000Z",
    "updatedAt": "2026-06-05T15:05:33.000Z",
    "lastUpdatedBy": "35240",
    "uid": "35240-621cfd0d-39e3-4822-a2d4-df2c9f136e27"
  },
  "item": [
    {
      "name": "v1",
      "item": [
        {
          "name": "messages",
          "item": [
            {
              "name": "count_tokens",
              "item": [
                {
                  "name": "Anthropic Count Message Tokens",
                  "id": "9f151cfb-bd2e-47e4-b454-bcfe177f1a9c",
                  "protocolProfileBehavior": {
                    "disableBodyPruning": true
                  },
                  "request": {
                    "method": "POST",
                    "header": [
                      {
                        "description": "(Required) API version date.",
                        "key": "anthropic-version",
                        "value": "2023-06-01"
                      },
                      {
                        "description": "Comma-separated beta feature headers.",
                        "key": "anthropic-beta",
                        "value": "<string>"
                      },
                      {
                        "description": "(Required) Anthropic API key.",
                        "key": "x-api-key",
                        "value": "<string>"
                      },
                      {
                        "key": "Content-Type",
                        "value": "application/json"
                      },
                      {
                        "key": "Accept",
                        "value": "application/json"
                      }
                    ],
                    "body": {
                      "mode": "raw",
                      "raw": "{\n  \"model\": \"<string>\",\n  \"messages\": [\n    {\n      \"role\": \"assistant\",\n      \"content\": \"<string>\"\n    },\n    {\n      \"role\": \"assistant\",\n      \"content\": \"<string>\"\n    }\n  ],\n  \"system\": \"<string>\"\n}",
                      "options": {
                        "raw": {
                          "headerFamily": "json",
                          "language": "json"
                        }
                      }
                    },
                    "url": {
                      "raw": "{{baseUrl}}/v1/messages/count_tokens",
                      "host": [
                        "{{baseUrl}}"
                      ],
                      "path": [
                        "v1",
                        "messages",
                        "count_tokens"
                      ]
                    },
                    "description": "Count tokens for a prospective Message request, including any tools, images, and documents. Returns the input token total without creating the message or charging output tokens.\n"
                  },
                  "response": [
                    {
                      "id": "cf659484-d967-434b-94ea-b9b12e4c0c47",
                      "name": "Token count returned successfully.",
                      "originalRequest": {
                        "method": "POST",
                        "header": [
                          {
                            "description": "(Required) API version date.",
                            "key": "anthropic-version",
                            "value": "2023-06-01"
                          },
                          {
                            "description": "Comma-separated beta feature headers.",
                            "key": "anthropic-beta",
                            "value": "<string>"
                          },
                          {
                            "description": "(Required) Anthropic API key.",
                            "key": "x-api-key",
                            "value": "<string>"
                          },
                          {
                            "key": "Content-Type",
                            "value": "application/json"
                          },
                          {
                            "key": "Accept",
                            "value": "application/json"
                          },
                          {
                            "description": "Added as a part of security scheme: apikey",
                            "key": "x-api-key",
                            "value": "<API Key>"
                          }
                        ],
                        "body": {
                          "mode": "raw",
                          "raw": "{\n  \"model\": \"<string>\",\n  \"messages\": [\n    {\n      \"role\": \"assistant\",\n      \"content\": \"<string>\"\n    },\n    {\n      \"role\": \"assistant\",\n      \"content\": \"<string>\"\n    }\n  ],\n  \"system\": \"<string>\"\n}",
                          "options": {
                            "raw": {
                              "headerFamily": "json",
                              "language": "json"
                            }
                          }
                        },
                        "url": {
                          "raw": "{{baseUrl}}/v1/messages/count_tokens",
                          "host": [
                            "{{baseUrl}}"
                          ],
                          "path": [
                            "v1",
                            "messages",
                            "count_tokens"
                          ]
                        }
                      },
                      "status": "OK",
                      "code": 200,
                      "_postman_previewlanguage": "json",
                      "header": [
                        {
                          "key": "Content-Type",
                          "value": "application/json"
                        }
                      ],
                      "cookie": [],
                      "responseTime": null,
                      "body": "{\n  \"input_tokens\": \"<integer>\"\n}",
                      "createdAt": "2026-06-05T15:05:33.000Z",
                      "updatedAt": "2026-06-05T15:05:33.000Z",
                      "uid": "35240-cf659484-d967-434b-94ea-b9b12e4c0c47"
                    },
                    {
                      "id": "95964291-4988-43e1-81b8-98a2323b7139",
                      "name": "Error response.",
                      "originalRequest": {
                        "method": "POST",
                        "header": [
                          {
                            "description": "(Required) API version date.",
                            "key": "anthropic-version",
                            "value": "2023-06-01"
                          },
                          {
                            "description": "Comma-separated beta feature headers.",
                            "key": "anthropic-beta",
                            "value": "<string>"
                          },
                          {
                            "description": "(Required) Anthropic API key.",
                            "key": "x-api-key",
                            "value": "<string>"
                          },
                          {
                            "key": "Content-Type",
                            "value": "application/json"
                          },
                          {
                            "key": "Accept",
                            "value": "application/json"
                          },
                          {
                            "description": "Added as a part of security scheme: apikey",
                            "key": "x-api-key",
                            "value": "<API Key>"
                          }
                        ],
                        "body": {
                          "mode": "raw",
                          "raw": "{\n  \"model\": \"<string>\",\n  \"messages\": [\n    {\n      \"role\": \"assistant\",\n      \"content\": \"<string>\"\n    },\n    {\n      \"role\": \"assistant\",\n      \"content\": \"<string>\"\n    }\n  ],\n  \"system\": \"<string>\"\n}",
                          "options": {
                            "raw": {
                              "headerFamily": "json",
                              "language": "json"
                            }
                          }
                        },
                        "url": {
                          "raw": "{{baseUrl}}/v1/messages/count_tokens",
                          "host": [
                            "{{baseUrl}}"
                          ],
                          "path": [
                            "v1",
                            "messages",
                            "count_tokens"
                          ]
                        }
                      },
                      "status": "Bad Request",
                      "code": 400,
                      "_postman_previewlanguage": "json",
                      "header": [
                        {
                          "key": "Content-Type",
                          "value": "application/json"
                        }
                      ],
                      "cookie": [],
                      "responseTime": null,
                      "body": "{\n  \"type\": \"<string>\",\n  \"error\": {\n    \"type\": \"<string>\",\n    \"message\": \"<string>\"\n  }\n}",
                      "createdAt": "2026-06-05T15:05:33.000Z",
                      "updatedAt": "2026-06-05T15:05:33.000Z",
                      "uid": "35240-95964291-4988-43e1-81b8-98a2323b7139"
                    }
                  ],
                  "createdAt": "2026-06-05T15:05:33.000Z",
                  "updatedAt": "2026-06-05T15:05:33.000Z",
                  "uid": "35240-9f151cfb-bd2e-47e4-b454-bcfe177f1a9c"
                }
              ],
              "id": "cfd9eda9-9130-4adc-973b-c1d4094a4045",
              "createdAt": "2026-06-05T15:05:33.000Z",
              "updatedAt": "2026-06-05T15:05:33.000Z",
              "uid": "35240-cfd9eda9-9130-4adc-973b-c1d4094a4045"
            }
          ],
          "id": "e278d8f6-24b1-4ee9-8cfc-c5f605cc367a",
          "createdAt": "2026-06-05T15:05:33.000Z",
          "updatedAt": "2026-06-05T15:05:33.000Z",
          "uid": "35240-e278d8f6-24b1-4ee9-8cfc-c5f605cc367a"
        }
      ],
      "id": "4b89fe9a-f105-4f35-be90-b3e5631d8b39",
      "createdAt": "2026-06-05T15:05:33.000Z",
      "updatedAt": "2026-06-05T15:05:33.000Z",
      "uid": "35240-4b89fe9a-f105-4f35-be90-b3e5631d8b39"
    }
  ],
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "x-api-key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{apiKey}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.anthropic.com"
    }
  ]
}