apicheats.dev openai/llms.txt Raw .md
POST

POST /responses/input_tokens — OpenAI API

OpenAI API key (required); https://api.openai.com/v1

OpenAI API

Get input token counts

Base URL
https://api.openai.com/v1
Auth
Authorization: Bearer <OPENAI_API_KEY>
Last verified
2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 384 tokens · Vary: Accept

Critical gotchas

The Responses API is the primary interface for new text and tool workflows; Chat Completions remains a separate compatibility API.

Audio transcription uploads use multipart form data rather than a JSON request body.

cURL

curl -X POST 'https://api.openai.com/v1/responses/input_tokens' \  -H "Authorization: Bearer $OPENAI_API_KEY" \  -H 'Content-Type: application/json' \  -d '{}'

Parameters

Name In Type Required Description
model body string No Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](https://developers.openai.com/api/docs/models) to browse and compare available models.
input body string No Text, image, or file inputs to the model, used to generate a response
previous_response_id body string No The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about [conversation state](https://developers.openai.com/api/docs/guides/conversation-state). Cannot be used in conjunction with `conversation`.
tools body object[] No An array of tools the model may call while generating a response. You can specify which tool to use by setting the `tool_choice` parameter.
text body object No Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more: - [Text inputs and outputs](https://developers.openai.com/api/docs/guides/text) - [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs)
reasoning body object No Configuration options for [reasoning models](https://developers.openai.com/api/docs/guides/reasoning).
truncation body string No Request body field truncation.
instructions body string No A system (or developer) message inserted into the model's context. When used along with `previous_response_id`, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.
personality body string No Request body field personality.
conversation body string No The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. Input items and output items from this response are automatically added to this conversation after this response completes.
tool_choice body string No How the model should select which tool (or tools) to use when generating a response. See the `tools` parameter to see how to specify which tools the model can call.
parallel_tool_calls body boolean No Whether to allow the model to run tool calls in parallel.

Response 200 OK

{
  "object": "response.input_tokens",
  "input_tokens": 123
}
Get a free OpenAI API key → sponsored

Affiliate link - we may earn a commission, at no extra cost to you.