Class InputTokenCountParams
- 
                    
                    - All Implemented Interfaces:
- 
                            
                            com.openai.core.Params
 
 public final class InputTokenCountParams implements Params Get input token counts 
- 
                
                    
                    - 
                                
                            
                                Nested Class SummaryNested Classes Modifier and Type Class Description public final classInputTokenCountParams.BuilderA builder for InputTokenCountParams. public final classInputTokenCountParams.Bodypublic final classInputTokenCountParams.ConversationThe conversation that this response belongs to. Items from this conversation are prepended to input_itemsfor this response request. Input items and output items from this response are automatically added to this conversation after this response completes.public final classInputTokenCountParams.InputText, image, or file inputs to the model, used to generate a response public final classInputTokenCountParams.TextConfiguration options for a text response from the model. Can be plain text or structured JSON data. Learn more: public final classInputTokenCountParams.ToolChoiceHow the model should select which tool (or tools) to use when generating a response. See the toolsparameter to see how to specify which tools the model can call.public final classInputTokenCountParams.TruncationThe 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.
 - 
                                
                            
                                Method SummaryModifier and Type Method Description final Optional<InputTokenCountParams.Conversation>conversation()The conversation that this response belongs to. final Optional<InputTokenCountParams.Input>input()Text, image, or file inputs to the model, used to generate a response final Optional<String>instructions()A system (or developer) message inserted into the model's context. final Optional<String>model()Model ID used to generate the response, like gpt-4ooro3.final Optional<Boolean>parallelToolCalls()Whether to allow the model to run tool calls in parallel. final Optional<String>previousResponseId()The unique ID of the previous response to the model. final Optional<Reasoning>reasoning()gpt-5 and o-series models only Configuration options for reasoning models. final Optional<InputTokenCountParams.Text>text()Configuration options for a text response from the model. final Optional<InputTokenCountParams.ToolChoice>toolChoice()How the model should select which tool (or tools) to use when generating a response. final Optional<List<Tool>>tools()An array of tools the model may call while generating a response. final Optional<InputTokenCountParams.Truncation>truncation()The truncation strategy to use for the model response. final JsonField<InputTokenCountParams.Conversation>_conversation()Returns the raw JSON value of conversation. final JsonField<InputTokenCountParams.Input>_input()Returns the raw JSON value of input. final JsonField<String>_instructions()Returns the raw JSON value of instructions. final JsonField<String>_model()Returns the raw JSON value of model. final JsonField<Boolean>_parallelToolCalls()Returns the raw JSON value of parallelToolCalls. final JsonField<String>_previousResponseId()Returns the raw JSON value of previousResponseId. final JsonField<Reasoning>_reasoning()Returns the raw JSON value of reasoning. final JsonField<InputTokenCountParams.Text>_text()Returns the raw JSON value of text. final JsonField<InputTokenCountParams.ToolChoice>_toolChoice()Returns the raw JSON value of toolChoice. final JsonField<List<Tool>>_tools()Returns the raw JSON value of tools. final JsonField<InputTokenCountParams.Truncation>_truncation()Returns the raw JSON value of truncation. final Map<String, JsonValue>_additionalBodyProperties()final Headers_additionalHeaders()Additional headers to send with the request. final QueryParams_additionalQueryParams()Additional query param to send with the request. final InputTokenCountParams.BuildertoBuilder()final InputTokenCountParams.Body_body()Headers_headers()The full set of headers in the parameters, including both fixed and additional headers. QueryParams_queryParams()The full set of query params in the parameters, including both fixed and additional query params. Booleanequals(Object other)IntegerhashCode()StringtoString()final static InputTokenCountParamsnone()final static InputTokenCountParams.Builderbuilder()Returns a mutable builder for constructing an instance of InputTokenCountParams. - 
                    
                    
                    - 
                                
                            
                                Method Detail- 
                                        conversationfinal Optional<InputTokenCountParams.Conversation> conversation() The conversation that this response belongs to. Items from this conversation are prepended to input_itemsfor this response request. Input items and output items from this response are automatically added to this conversation after this response completes.
 - 
                                        inputfinal Optional<InputTokenCountParams.Input> input() Text, image, or file inputs to the model, used to generate a response 
 - 
                                        instructionsfinal Optional<String> instructions() 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.
 - 
                                        modelfinal Optional<String> model() Model ID used to generate the response, like gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.
 - 
                                        parallelToolCallsfinal Optional<Boolean> parallelToolCalls() Whether to allow the model to run tool calls in parallel. 
 - 
                                        previousResponseIdfinal Optional<String> previousResponseId() The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with conversation.
 - 
                                        reasoningfinal Optional<Reasoning> reasoning() gpt-5 and o-series models only Configuration options for reasoning models. 
 - 
                                        textfinal Optional<InputTokenCountParams.Text> text() Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more: 
 - 
                                        toolChoicefinal Optional<InputTokenCountParams.ToolChoice> toolChoice() How the model should select which tool (or tools) to use when generating a response. See the toolsparameter to see how to specify which tools the model can call.
 - 
                                        toolsfinal Optional<List<Tool>> tools() An array of tools the model may call while generating a response. You can specify which tool to use by setting the tool_choiceparameter.
 - 
                                        truncationfinal Optional<InputTokenCountParams.Truncation> truncation() 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.
 - 
                                        _conversationfinal JsonField<InputTokenCountParams.Conversation> _conversation() Returns the raw JSON value of conversation. Unlike conversation, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _inputfinal JsonField<InputTokenCountParams.Input> _input() Returns the raw JSON value of input. Unlike input, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _instructionsfinal JsonField<String> _instructions() Returns the raw JSON value of instructions. Unlike instructions, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _modelfinal JsonField<String> _model() Returns the raw JSON value of model. Unlike model, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _parallelToolCallsfinal JsonField<Boolean> _parallelToolCalls() Returns the raw JSON value of parallelToolCalls. Unlike parallelToolCalls, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _previousResponseIdfinal JsonField<String> _previousResponseId() Returns the raw JSON value of previousResponseId. Unlike previousResponseId, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _reasoningfinal JsonField<Reasoning> _reasoning() Returns the raw JSON value of reasoning. Unlike reasoning, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _textfinal JsonField<InputTokenCountParams.Text> _text() Returns the raw JSON value of text. Unlike text, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _toolChoicefinal JsonField<InputTokenCountParams.ToolChoice> _toolChoice() Returns the raw JSON value of toolChoice. Unlike toolChoice, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _toolsfinal JsonField<List<Tool>> _tools() Returns the raw JSON value of tools. Unlike tools, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _truncationfinal JsonField<InputTokenCountParams.Truncation> _truncation() Returns the raw JSON value of truncation. Unlike truncation, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _additionalBodyPropertiesfinal Map<String, JsonValue> _additionalBodyProperties() 
 - 
                                        _additionalHeadersfinal Headers _additionalHeaders() Additional headers to send with the request. 
 - 
                                        _additionalQueryParamsfinal QueryParams _additionalQueryParams() Additional query param to send with the request. 
 - 
                                        toBuilderfinal InputTokenCountParams.Builder toBuilder() 
 - 
                                        _bodyfinal InputTokenCountParams.Body _body() 
 - 
                                        _headersHeaders _headers() The full set of headers in the parameters, including both fixed and additional headers. 
 - 
                                        _queryParamsQueryParams _queryParams() The full set of query params in the parameters, including both fixed and additional query params. 
 - 
                                        nonefinal static InputTokenCountParams none() 
 - 
                                        builderfinal static InputTokenCountParams.Builder builder() Returns a mutable builder for constructing an instance of InputTokenCountParams. 
 
- 
                                        
 
- 
                                
                            
                                
 
- 
                    
                    
                    
 
-