Agent interface

Represents an agent that can call the model and use tools.

Properties

createdAt

The Unix timestamp, in seconds, representing when this object was created.

description

The description of the agent.

id

The identifier, which can be referenced in API endpoints.

instructions

The system instructions for the agent to use.

metadata

A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.

model

The ID of the model to use.

name

The name of the agent.

object

The object type, which is always assistant.

responseFormat

The response format of the tool calls used by this agent.

temperature

What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

toolResources

A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.

tools

The collection of tools enabled for the agent.

topP

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

We generally recommend altering this or temperature but not both.

Property Details

createdAt

The Unix timestamp, in seconds, representing when this object was created.

createdAt: Date

Property Value

Date

description

The description of the agent.

description: string | null

Property Value

string | null

id

The identifier, which can be referenced in API endpoints.

id: string

Property Value

string

instructions

The system instructions for the agent to use.

instructions: string | null

Property Value

string | null

metadata

A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.

metadata: Record<string, string> | null

Property Value

Record<string, string> | null

model

The ID of the model to use.

model: string

Property Value

string

name

The name of the agent.

name: string | null

Property Value

string | null

object

The object type, which is always assistant.

object: "assistant"

Property Value

"assistant"

responseFormat

The response format of the tool calls used by this agent.

responseFormat?: AgentsResponseFormatOption | null

Property Value

temperature

What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

temperature: number | null

Property Value

number | null

toolResources

A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.

toolResources: ToolResources | null

Property Value

ToolResources | null

tools

The collection of tools enabled for the agent.

tools: ToolDefinitionUnion[]

Property Value

topP

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

We generally recommend altering this or temperature but not both.

topP: number | null

Property Value

number | null