NAME
OpenAPI::Client::OpenAI::Path::responses-input_tokens - Documentation for the /responses/input_tokens path.
OPERATIONS
POST /responses/input_tokens
Getinputtokencounts
$client->getinputtokencounts({
body => { ... },
});
Returns input token counts of the request.
Returns an object with object set to response.input_tokens and an input_tokens count.
Responses
200 - Success
Content-Type: application/json
Example:
{
"input_tokens" : 123,
"object" : "response.input_tokens"
}
SCHEMAS
TokenCountsBody
Properties:
conversation(anyOf)input(anyOf)instructions(anyOf)model(anyOf)parallel_tool_calls(anyOf)previous_response_id(anyOf)reasoning(anyOf)text(anyOf)tool_choice(anyOf)tools(anyOf)truncation(TruncationEnum) - The truncation strategy to use for the model response. -auto: If the input to this Response exceeds the model's context window size, the model will truncate the response to fit the context window by dropping items from the beginning of the conversation. -disabled(default): If the input size will exceed the context window size for a model, the request will fail with a 400 error.See "TruncationEnum" below for shape.
TokenCountsResource
Properties:
input_tokens(integer, required)object(string, required)Allowed values: response.input_tokens
Default: response.input_tokens
TruncationEnum
See https://platform.openai.com/docs/api-reference for details.
SEE ALSO
COPYRIGHT AND LICENSE
Copyright (C) 2023-2026 by Nelson Ferraz
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.0 or, at your option, any later version of Perl 5 you may have available.