Home / Servers / OpenAI API / beta_getinputtokencounts

Get input token counts

An MCP tool from the OpenAI API server, hosted on mcp.hjlabs.in.

Get input token counts Returns input token counts of the request. Returns an object with object set to response.input_tokens and an input_tokens count. [POST /responses/input_tokens?beta=true]

Name on the gateway: openai_api__beta_getinputtokencounts · may change things.

Parameters

NameTypeDescription
modelstringModel ID used to generate the response, like gpt-4o or o3. OpenAI offers a…
inputstringText, image, or file inputs to the model, used to generate a response
previous_response_idstringThe unique ID of the previous response to the model. Use this to create…
toolsarrayAn array of tools the model may call while generating a response. You can…
textobjectConfiguration options for a text response from the model. Can be plain text or…
reasoningobject**gpt-5 and o-series models only** Configuration options for reasoning models.
truncationauto | disabledThe truncation strategy to use for the model response. - auto: If the input to…
instructionsstringA system (or developer) message inserted into the model's context. When used…
personalitystringA model-owned style preset to apply to this request. Omit this parameter to…
conversationobjectThe conversation that this response belongs to. Items from this conversation…
tool_choiceobjectControls which tool the model should use, if any.
parallel_tool_callsbooleanWhether to allow the model to run tool calls in parallel.

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "openai_api__beta_getinputtokencounts",
  "arguments": {}
}

Or connect the OpenAI API server directly, which lists 371 tools including this one:

Run in your terminal
claude mcp add --transport http hj-openai-api https://mcp.hjlabs.in/mcp/openai-api \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the get input token counts tool with model set to ….

More from OpenAI API