---
title: "Count input tokens"
method: POST
path: "/responses/input_tokens"
tags: ["Responses"]
---

# Count input tokens

`POST /responses/input_tokens`

## Request

- Base URL: `https://api.openscale.so/v1`
- URL: `https://api.openscale.so/v1/responses/input_tokens`
- Auth: HTTP bearer

Count the input tokens a Responses request would use, without running the model. Takes the same body as Create a response and counts it with the model tokenizer: exact for text and tools, estimated for images and for models whose tokenizer we do not carry. Free.

## Request body

- object

## Response `200`

The input token count.

- object
  - `object` 'response.input_tokens', required
  - `input_tokens` integer, required

## Other responses

- `400`: The request cannot be served; `param` names the field.
- `401`: Missing or invalid API key.

---

[API](https://skmtc.dev/openscale/apis/openscale-api.md) - [All operations](https://skmtc.dev/openscale/apis/openscale-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openscale/apis/openscale-api/revisions/587e72b44932?raw)
