Class Response
public sealed class Response : IGeneratedOutput, IIdentifiable
- Inheritance
-
objectResponse
- Implements
-
IIdentifiable
- Extension Methods
Properties
Background
Optional. Whether to run the model response in the background.
public bool? Background { get; set; }
Property Value
- bool?
Conversation
Optional. The conversation that this response belongs to. Input items and output items from this response are automatically added to this conversation.
public ConversationReference Conversation { get; set; }
Property Value
Count
public int Count { get; }
Property Value
- int
CreatedAt
Required. Unix timestamp (in seconds) of when this Response was created.
public UnixTime CreatedAt { get; set; }
Property Value
- UnixTime
Error
Optional. An error object returned when the model fails to generate a Response.
public ResponsesApiErrorInfo Error { get; set; }
Property Value
Id
Required. Unique identifier for this Response.
public string Id { get; set; }
Property Value
- string
IncompleteDetails
Optional. Details about why the response is incomplete.
public IncompleteDetails IncompleteDetails { get; set; }
Property Value
Instructions
Optional. A system (or developer) message inserted into the model's context. When using along with previous_response_id, the instructions from a previous response will not be carried over to the next response.
public StringOr<ConversationItem> Instructions { get; set; }
Property Value
- StringOr<ConversationItem>
MaxOutputTokens
Optional. An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.
public int? MaxOutputTokens { get; set; }
Property Value
- int?
MaxToolCalls
Optional. The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored.
public int? MaxToolCalls { get; set; }
Property Value
- int?
Metadata
Optional. Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
public ServerDictionary Metadata { get; set; }
Property Value
Model
Required. Model ID used to generate the response.
public string Model { get; set; }
Property Value
- string
Output
An array of content items generated by the model.
- The length and order of items in the output array is dependent on the model's response.
- Rather than accessing the first item in the output array and assuming it's an assistant message with the content generated by the model, you might consider using the output_text property where supported in SDKs.
public List<ConversationItem> Output { get; set; }
Property Value
- List<ConversationItem>
ParallelToolCalls
Optional. Whether to allow the model to run tool calls in parallel.
public bool? ParallelToolCalls { get; set; }
Property Value
- bool?
PreviousResponseId
Optional. Unique ID of the previous response to use for multi-turn threading.
public string PreviousResponseId { get; set; }
Property Value
- string
Prompt
Optional. Reference to prompt and template used.
public PromptTemplate Prompt { get; set; }
Property Value
PromptCacheKey
Optional. Cache key for prompts to assist with caching optimizations.
public string PromptCacheKey { get; set; }
Property Value
- string
ReasoningOptions
Optional. Configuration options for reasoning models.
public ReasoningOptions ReasoningOptions { get; set; }
Property Value
SafetyIdentifier
Optional. Identifier for monitoring policy or abuse detection.
public SafetyIdentifier SafetyIdentifier { get; set; }
Property Value
ServiceTier
Optional. Processing tier used—auto, default, flex, or priority.
public ServiceTier? ServiceTier { get; set; }
Property Value
Status
Required. Status of the response generation.
public ResponseStatus Status { get; set; }
Property Value
Temperature
Optional. Sampling temperature, between 0 and 2.
public Temperature Temperature { get; set; }
Property Value
TextResponseOptions
Optional. Configuration options for a text response from the model.
public TextResponseOptions TextResponseOptions { get; set; }
Property Value
ToolChoice
Optional. How the model should select which tool (or tools) to use when generating a response.
public ToolChoice ToolChoice { get; set; }
Property Value
Tools
Optional. An array of tools the model may call while generating a response.
public List<Tool> Tools { get; set; }
Property Value
- List<Tool>
TopLogprobs
Optional. An integer between 0 and 20 specifying the number of most likely tokens to return.
public Logprobs TopLogprobs { get; set; }
Property Value
TopP
Optional. Defaults to 1 Nucleus sampling parameter.
public TopP TopP { get; set; }
Property Value
Truncation
Optional. Defaults to disabled The truncation strategy to use for the model response.
public TruncationStrategy Truncation { get; set; }
Property Value
Type
Required. The object type of this resource - always 'response'.
public string Type { get; set; }
Property Value
- string
Usage
Optional. Token usage information including input/output counts.
public UsageMetadata Usage { get; set; }
Property Value
Methods
FirstResponseMessage()
public ResponseMessage FirstResponseMessage()
Returns
GetOutputFiles()
public List<IFile> GetOutputFiles()
Returns
- List<IFile>
GetOutputTexts()
public List<string> GetOutputTexts()
Returns
- List<string>
GetUsage()
public UsageMetadata GetUsage()