Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Beta

BetaAssistants

Build Assistants that can call models and use tools.

Create assistant
Deprecated
client.Beta.Assistants.New(ctx, body) (*Assistant, error)
POST/assistants
Delete assistant
Deprecated
client.Beta.Assistants.Delete(ctx, assistantID) (*AssistantDeleted, error)
DELETE/assistants/{assistant_id}
List assistants
Deprecated
client.Beta.Assistants.List(ctx, query) (*CursorPage[Assistant], error)
GET/assistants
Retrieve assistant
Deprecated
client.Beta.Assistants.Get(ctx, assistantID) (*Assistant, error)
GET/assistants/{assistant_id}
Modify assistant
Deprecated
client.Beta.Assistants.Update(ctx, assistantID, body) (*Assistant, error)
POST/assistants/{assistant_id}
ModelsExpand Collapse
type Assistant struct{…}

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

type AssistantDeleted struct{…}
type AssistantStreamEventUnion interface{…}

Represents an event emitted when streaming a Run.

Each event in a server-sent events stream has an event and data property:

event: thread.created
data: {"id": "thread_123", "object": "thread", ...}

We emit events whenever a new object is created, transitions to a new state, or is being streamed in parts (deltas). For example, we emit thread.run.created when a new run is created, thread.run.completed when a run completes, and so on. When an Assistant chooses to create a message during a run, we emit a thread.message.created event, a thread.message.in_progress event, many thread.message.delta events, and finally a thread.message.completed event.

We may add additional events over time, so we recommend handling unknown events gracefully in your code. See the Assistants API quickstart to learn how to integrate the Assistants API with streaming.

type AssistantToolUnion interface{…}
type CodeInterpreterTool struct{…}
type FileSearchTool struct{…}
type FunctionTool struct{…}
type MessageStreamEventUnion interface{…}

Occurs when a message is created.

type RunStepStreamEventUnion interface{…}

Occurs when a run step is created.

type RunStreamEventUnion interface{…}

Occurs when a new run is created.

type ThreadStreamEvent struct{…}

Occurs when a new thread is created.

BetaChatKit

ModelsExpand Collapse
type ChatKitWorkflow struct{…}

Workflow metadata and state returned for the session.

BetaChatKitSessions

Cancel chat session
client.Beta.ChatKit.Sessions.Cancel(ctx, sessionID) (*ChatSession, error)
POST/chatkit/sessions/{session_id}/cancel
Create ChatKit session
client.Beta.ChatKit.Sessions.New(ctx, body) (*ChatSession, error)
POST/chatkit/sessions

BetaChatKitThreads

Delete ChatKit thread
client.Beta.ChatKit.Threads.Delete(ctx, threadID) (*BetaChatKitThreadDeleteResponse, error)
DELETE/chatkit/threads/{thread_id}
List ChatKit threads
client.Beta.ChatKit.Threads.List(ctx, query) (*ConversationCursorPage[ChatKitThread], error)
GET/chatkit/threads
List ChatKit thread items
client.Beta.ChatKit.Threads.ListItems(ctx, threadID, query) (*ConversationCursorPage[ChatKitThreadItemListDataUnion], error)
GET/chatkit/threads/{thread_id}/items
Retrieve ChatKit thread
client.Beta.ChatKit.Threads.Get(ctx, threadID) (*ChatKitThread, error)
GET/chatkit/threads/{thread_id}
ModelsExpand Collapse
type ChatSession struct{…}

Represents a ChatKit session and its resolved configuration.

type ChatSessionAutomaticThreadTitling struct{…}

Automatic thread title preferences for the session.

type ChatSessionChatKitConfiguration struct{…}

ChatKit configuration for the session.

type ChatSessionChatKitConfigurationParamResp struct{…}

Optional per-session configuration settings for ChatKit behavior.

type ChatSessionExpiresAfterParamResp struct{…}

Controls when the session expires relative to an anchor timestamp.

type ChatSessionFileUpload struct{…}

Upload permissions and limits applied to the session.

type ChatSessionHistory struct{…}

History retention preferences returned for the session.

type ChatSessionRateLimits struct{…}

Active per-minute request limit for the session.

type ChatSessionRateLimitsParamResp struct{…}

Controls request rate limits for the session.

type ChatSessionStatus string
type ChatSessionWorkflowParamResp struct{…}

Workflow reference and overrides applied to the chat session.

type ChatKitAttachment struct{…}

Attachment metadata included on thread items.

type ChatKitResponseOutputText struct{…}

Assistant response text accompanied by optional annotations.

type ChatKitThread struct{…}

Represents a ChatKit thread and its current status.

type ChatKitThreadAssistantMessageItem struct{…}

Assistant-authored message within a thread.

type ChatKitThreadItemList struct{…}

A paginated list of thread items rendered for the ChatKit API.

type ChatKitThreadUserMessageItem struct{…}

User-authored messages within a thread.

type ChatKitWidgetItem struct{…}

Thread item that renders a widget payload.

BetaResponses

Cancel a response
client.Beta.Responses.Cancel(ctx, responseID, body) (*BetaResponse, error)
POST/responses/{response_id}/cancel
Compact a response
client.Beta.Responses.Compact(ctx, params) (*BetaCompactedResponse, error)
POST/responses/compact
Create a model response
client.Beta.Responses.New(ctx, params) (*BetaResponse, error)
POST/responses
Delete a model response
client.Beta.Responses.Delete(ctx, responseID, body) error
DELETE/responses/{response_id}
Get a model response
client.Beta.Responses.Get(ctx, responseID, params) (*BetaResponse, error)
GET/responses/{response_id}
ModelsExpand Collapse
type BetaApplyPatchTool struct{…}

Allows the assistant to create, delete, or update files using unified diffs.

type BetaCompactedResponse struct{…}
type BetaComputerActionUnion interface{…}

A click action.

type BetaComputerActionList []BetaComputerActionUnion

Flattened batched actions for computer_use. Each action includes an type discriminator and action-specific fields.

type BetaComputerTool struct{…}

A tool that controls a virtual computer. Learn more about the computer tool.

type BetaComputerUsePreviewTool struct{…}

A tool that controls a virtual computer. Learn more about the computer tool.

type BetaContainerAuto struct{…}
type BetaContainerNetworkPolicyAllowlist struct{…}
type BetaContainerNetworkPolicyDisabled struct{…}
type BetaContainerNetworkPolicyDomainSecret struct{…}
type BetaContainerReference struct{…}
type BetaCustomTool struct{…}

A custom tool that processes input using a specified format. Learn more about custom tools

type BetaEasyInputMessage struct{…}

A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions.

type BetaFileSearchTool struct{…}

A tool that searches for relevant content from uploaded files. Learn more about the file search tool.

type BetaFunctionShellTool struct{…}

A tool that allows the model to execute shell commands.

type BetaFunctionTool struct{…}

Defines a function in your own code the model can choose to call. Learn more about function calling.

type BetaInlineSkill struct{…}
type BetaInlineSkillSource struct{…}

Inline skill payload

type BetaLocalEnvironment struct{…}
type BetaLocalSkill struct{…}
type BetaMcpToolCallErrorUnion interface{…}
type BetaNamespaceTool struct{…}

Groups function/custom tools under a shared namespace.

type BetaResponse struct{…}
type BetaResponseApplyPatchToolCall struct{…}

A tool call that applies file diffs by creating, deleting, or updating files.

type BetaResponseApplyPatchToolCallOutput struct{…}

The output emitted by an apply patch tool call.

type BetaResponseAudioDeltaEvent struct{…}

Emitted when there is a partial audio response.

type BetaResponseAudioDoneEvent struct{…}

Emitted when the audio response is complete.

type BetaResponseAudioTranscriptDeltaEvent struct{…}

Emitted when there is a partial transcript of audio.

type BetaResponseAudioTranscriptDoneEvent struct{…}

Emitted when the full audio transcript is completed.

type BetaResponseCodeInterpreterCallCodeDeltaEvent struct{…}

Emitted when a partial code snippet is streamed by the code interpreter.

type BetaResponseCodeInterpreterCallCodeDoneEvent struct{…}

Emitted when the code snippet is finalized by the code interpreter.

type BetaResponseCodeInterpreterCallCompletedEvent struct{…}

Emitted when the code interpreter call is completed.

type BetaResponseCodeInterpreterCallInProgressEvent struct{…}

Emitted when a code interpreter call is in progress.

type BetaResponseCodeInterpreterCallInterpretingEvent struct{…}

Emitted when the code interpreter is actively interpreting the code snippet.

type BetaResponseCodeInterpreterToolCall struct{…}

A tool call to run code.

type BetaResponseCompactionItem struct{…}

A compaction item generated by the v1/responses/compact API.

type BetaResponseCompactionItemParamResp struct{…}

A compaction item generated by the v1/responses/compact API.

type BetaResponseCompletedEvent struct{…}

Emitted when the model response is complete.

type BetaResponseComputerToolCall struct{…}

A tool call to a computer use tool. See the computer use guide for more information.

type BetaResponseComputerToolCallOutputItem struct{…}
type BetaResponseComputerToolCallOutputScreenshot struct{…}

A computer screenshot image used with the computer use tool.

type BetaResponseContainerReference struct{…}

Represents a container created with /v1/containers.

type BetaResponseContentUnion interface{…}

Multi-modal input and output contents.

type BetaResponseContentPartAddedEvent struct{…}

Emitted when a new content part is added.

type BetaResponseContentPartDoneEvent struct{…}

Emitted when a content part is done.

type BetaResponseConversationParamResp struct{…}

The conversation that this response belongs to.

type BetaResponseCreatedEvent struct{…}

An event that is emitted when a response is created.

type BetaResponseCustomToolCall struct{…}

A call to a custom tool created by the model.

type BetaResponseCustomToolCallInputDeltaEvent struct{…}

Event representing a delta (partial update) to the input of a custom tool call.

type BetaResponseCustomToolCallInputDoneEvent struct{…}

Event indicating that input for a custom tool call is complete.

type BetaResponseCustomToolCallItem struct{…}

A call to a custom tool created by the model.

type BetaResponseCustomToolCallOutput struct{…}

The output of a custom tool call from your code, being sent back to the model.

type BetaResponseCustomToolCallOutputItem struct{…}

The output of a custom tool call from your code, being sent back to the model.

type BetaResponseError struct{…}

An error object returned when the model fails to generate a Response.

type BetaResponseErrorEvent struct{…}

Emitted when an error occurs.

type BetaResponseFailedEvent struct{…}

An event that is emitted when a response fails.

type BetaResponseFileSearchCallCompletedEvent struct{…}

Emitted when a file search call is completed (results found).

type BetaResponseFileSearchCallInProgressEvent struct{…}

Emitted when a file search call is initiated.

type BetaResponseFileSearchCallSearchingEvent struct{…}

Emitted when a file search is currently searching.

type BetaResponseFileSearchToolCall struct{…}

The results of a file search tool call. See the file search guide for more information.

type BetaResponseFormatTextConfigUnion interface{…}

An object specifying the format that the model must output.

Configuring { "type": "json_schema" } enables Structured Outputs, which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.

The default format is { "type": "text" } with no additional options.

Not recommended for gpt-4o and newer models:

Setting to { "type": "json_object" } enables the older JSON mode, which ensures the message the model generates is valid JSON. Using json_schema is preferred for models that support it.

type BetaResponseFormatTextJSONSchemaConfig struct{…}

JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.

type BetaResponseFunctionCallArgumentsDeltaEvent struct{…}

Emitted when there is a partial function-call arguments delta.

type BetaResponseFunctionCallArgumentsDoneEvent struct{…}

Emitted when function-call arguments are finalized.

type BetaResponseFunctionCallOutputItemUnion interface{…}

A piece of message content, such as text, an image, or a file.

type BetaResponseFunctionCallOutputItemList []BetaResponseFunctionCallOutputItemUnion

An array of content outputs (text, image, file) for the function tool call.

type BetaResponseFunctionShellCallOutputContent struct{…}

Captured stdout and stderr for a portion of a shell tool call output.

type BetaResponseFunctionShellToolCall struct{…}

A tool call that executes one or more shell commands in a managed environment.

type BetaResponseFunctionShellToolCallOutput struct{…}

The output of a shell tool call that was emitted.

type BetaResponseFunctionToolCall struct{…}

A tool call to run a function. See the function calling guide for more information.

type BetaResponseFunctionToolCallItem struct{…}

A tool call to run a function. See the function calling guide for more information.

type BetaResponseFunctionToolCallOutputItem struct{…}
type BetaResponseImageGenCallCompletedEvent struct{…}

Emitted when an image generation tool call has completed and the final image is available.

type BetaResponseImageGenCallGeneratingEvent struct{…}

Emitted when an image generation tool call is actively generating an image (intermediate state).

type BetaResponseImageGenCallInProgressEvent struct{…}

Emitted when an image generation tool call is in progress.

type BetaResponseImageGenCallPartialImageEvent struct{…}

Emitted when a partial image is available during image generation streaming.

type BetaResponseInProgressEvent struct{…}

Emitted when the response is in progress.

type BetaResponseIncludable string

Specify additional output data to include in the model response. Currently supported values are:

  • web_search_call.results: Include the search results of the web search tool call.
  • web_search_call.action.sources: Include the sources of the web search tool call.
  • code_interpreter_call.outputs: Includes the outputs of python code execution in code interpreter tool call items.
  • computer_call_output.output.image_url: Include image urls from the computer call output.
  • file_search_call.results: Include the search results of the file search tool call.
  • message.input_image.image_url: Include image urls from the input message.
  • message.output_text.logprobs: Include logprobs with assistant messages.
  • reasoning.encrypted_content: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the store parameter is set to false, or when an organization is enrolled in the zero data retention program).
type BetaResponseIncompleteEvent struct{…}

An event that is emitted when a response finishes as incomplete.

type BetaResponseInjectCreatedEvent struct{…}

Emitted when all injected input items were validated and committed to the active response.

type BetaResponseInjectEvent struct{…}

Injects input items into an active response over a WebSocket connection. The items are validated and committed atomically. Currently, the server accepts client-owned tool outputs that resume a waiting agent.

type BetaResponseInjectFailedEvent struct{…}

Emitted when injected input could not be committed to a response. The event returns the uncommitted raw input so the client can retry it in another response when appropriate.

type BetaResponseInput []BetaResponseInputItemUnion

A list of one or many input items to the model, containing different content types.

type BetaResponseInputAudio struct{…}

An audio input to the model.

type BetaResponseInputContentUnion interface{…}

A text input to the model.

type BetaResponseInputFile struct{…}

A file input to the model.

type BetaResponseInputFileContent struct{…}

A file input to the model.

type BetaResponseInputImage struct{…}

An image input to the model. Learn about image inputs.

type BetaResponseInputImageContent struct{…}

An image input to the model. Learn about image inputs

type BetaResponseInputItemUnion interface{…}

A message input to the model with a role indicating instruction following hierarchy. Instructions given with the developer or system role take precedence over instructions given with the user role. Messages with the assistant role are presumed to have been generated by the model in previous interactions.

type BetaResponseInputMessageContentList []BetaResponseInputContentUnion

A list of one or many input items to the model, containing different content types.

type BetaResponseInputMessageItem struct{…}
type BetaResponseInputText struct{…}

A text input to the model.

type BetaResponseInputTextContent struct{…}

A text input to the model.

type BetaResponseItemUnion interface{…}

Content item used to generate a response.

type BetaResponseLocalEnvironment struct{…}

Represents the use of a local environment to perform shell actions.

type BetaResponseMcpCallArgumentsDeltaEvent struct{…}

Emitted when there is a delta (partial update) to the arguments of an MCP tool call.

type BetaResponseMcpCallArgumentsDoneEvent struct{…}

Emitted when the arguments for an MCP tool call are finalized.

type BetaResponseMcpCallCompletedEvent struct{…}

Emitted when an MCP tool call has completed successfully.

type BetaResponseMcpCallFailedEvent struct{…}

Emitted when an MCP tool call has failed.

type BetaResponseMcpCallInProgressEvent struct{…}

Emitted when an MCP tool call is in progress.

type BetaResponseMcpListToolsCompletedEvent struct{…}

Emitted when the list of available MCP tools has been successfully retrieved.

type BetaResponseMcpListToolsFailedEvent struct{…}

Emitted when the attempt to list available MCP tools has failed.

type BetaResponseMcpListToolsInProgressEvent struct{…}

Emitted when the system is in the process of retrieving the list of available MCP tools.

type BetaResponseOutputAudio struct{…}

An audio output from the model.

type BetaResponseOutputItemUnion interface{…}

An output message from the model.

type BetaResponseOutputItemAddedEvent struct{…}

Emitted when a new output item is added.

type BetaResponseOutputItemDoneEvent struct{…}

Emitted when an output item is marked done.

type BetaResponseOutputMessage struct{…}

An output message from the model.

type BetaResponseOutputRefusal struct{…}

A refusal from the model.

type BetaResponseOutputText struct{…}

A text output from the model.

type BetaResponseOutputTextAnnotationAddedEvent struct{…}

Emitted when an annotation is added to output text content.

type BetaResponsePrompt struct{…}

Reference to a prompt template and its variables. Learn more.

type BetaResponseQueuedEvent struct{…}

Emitted when a response is queued and waiting to be processed.

type BetaResponseReasoningItem struct{…}

A description of the chain of thought used by a reasoning model while generating a response. Be sure to include these items in your input to the Responses API for subsequent turns of a conversation if you are manually managing context.

type BetaResponseReasoningSummaryPartAddedEvent struct{…}

Emitted when a new reasoning summary part is added.

type BetaResponseReasoningSummaryPartDoneEvent struct{…}

Emitted when a reasoning summary part is completed.

type BetaResponseReasoningSummaryTextDeltaEvent struct{…}

Emitted when a delta is added to a reasoning summary text.

type BetaResponseReasoningSummaryTextDoneEvent struct{…}

Emitted when a reasoning summary text is completed.

type BetaResponseReasoningTextDeltaEvent struct{…}

Emitted when a delta is added to a reasoning text.

type BetaResponseReasoningTextDoneEvent struct{…}

Emitted when a reasoning text is completed.

type BetaResponseRefusalDeltaEvent struct{…}

Emitted when there is a partial refusal text.

type BetaResponseRefusalDoneEvent struct{…}

Emitted when refusal text is finalized.

type BetaResponseShellCallCommandAddedEvent struct{…}

A streaming event that indicated a shell command was added to a tool call.

type BetaResponseShellCallCommandDeltaEvent struct{…}

A streaming event that indicated a shell command was incrementally updated.

type BetaResponseShellCallCommandDoneEvent struct{…}

A streaming event that indicated a shell command was completed.

type BetaResponseShellCallOutputContentDeltaEvent struct{…}

A streaming event that indicated shell call output was incrementally added.

type BetaResponseShellCallOutputContentDoneEvent struct{…}

A streaming event that indicated shell call output was completed.

type BetaResponseStatus string

The status of the response generation. One of completed, failed, in_progress, cancelled, queued, or incomplete.

type BetaResponseStreamEventUnion interface{…}

Event emitted while a response is streamed.

type BetaResponseTextConfig struct{…}

Configuration options for a text response from the model. Can be plain text or structured JSON data. Learn more:

type BetaResponseTextDeltaEvent struct{…}

Emitted when there is an additional text delta.

type BetaResponseTextDoneEvent struct{…}

Emitted when text content is finalized.

type BetaResponseToolSearchCall struct{…}
type BetaResponseToolSearchOutputItem struct{…}
type BetaResponseToolSearchOutputItemParamResp struct{…}
type BetaResponseUsage struct{…}

Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used.

type BetaResponseWebSearchCallCompletedEvent struct{…}

Emitted when a web search call is completed.

type BetaResponseWebSearchCallInProgressEvent struct{…}

Emitted when a web search call is initiated.

type BetaResponseWebSearchCallSearchingEvent struct{…}

Emitted when a web search call is executing.

type BetaResponsesClientEventUnion interface{…}

Client events accepted by the Responses WebSocket server.

type BetaResponsesServerEventUnion interface{…}

Server events emitted by the Responses WebSocket server.

type BetaSkillReference struct{…}
type BetaToolUnion interface{…}

A tool that can be used to generate a response.

type BetaToolChoiceAllowed struct{…}

Constrains the tools available to the model to a pre-defined set.

type BetaToolChoiceApplyPatch struct{…}

Forces the model to call the apply_patch tool when executing a tool call.

type BetaToolChoiceCustom struct{…}

Use this option to force the model to call a specific custom tool.

type BetaToolChoiceFunction struct{…}

Use this option to force the model to call a specific function.

type BetaToolChoiceMcp struct{…}

Use this option to force the model to call a specific tool on a remote MCP server.

type BetaToolChoiceOptions string

Controls which (if any) tool is called by the model.

none means the model will not call any tool and instead generates a message.

auto means the model can pick between generating a message or calling one or more tools.

required means the model must call one or more tools.

type BetaToolChoiceShell struct{…}

Forces the model to call the shell tool when a tool call is required.

type BetaToolChoiceTypes struct{…}

Indicates that the model should use a built-in tool to generate a response. Learn more about built-in tools.

type BetaToolSearchTool struct{…}

Hosted or BYOT tool search configuration for deferred tools.

type BetaWebSearchPreviewTool struct{…}

This tool searches the web for relevant results to use in a response. Learn more about the web search tool.

type BetaWebSearchTool struct{…}

Search the Internet for sources related to the prompt. Learn more about the web search tool.

BetaResponsesInput Items

List input items
client.Beta.Responses.InputItems.List(ctx, responseID, params) (*CursorPage[BetaResponseItemUnion], error)
GET/responses/{response_id}/input_items
ModelsExpand Collapse
type BetaResponseItemList struct{…}

A list of Response items.

BetaResponsesInput Tokens

Get input token counts
client.Beta.Responses.InputTokens.Count(ctx, params) (*BetaResponseInputTokenCountResponse, error)
POST/responses/input_tokens

BetaThreads

Build Assistants that can call models and use tools.

Create thread
Deprecated
client.Beta.Threads.New(ctx, body) (*Thread, error)
POST/threads
Create thread and run
Deprecated
client.Beta.Threads.NewAndRun(ctx, body) (*Run, error)
POST/threads/runs
Delete thread
Deprecated
client.Beta.Threads.Delete(ctx, threadID) (*ThreadDeleted, error)
DELETE/threads/{thread_id}
Retrieve thread
Deprecated
client.Beta.Threads.Get(ctx, threadID) (*Thread, error)
GET/threads/{thread_id}
Modify thread
Deprecated
client.Beta.Threads.Update(ctx, threadID, body) (*Thread, error)
POST/threads/{thread_id}
ModelsExpand Collapse
type AssistantResponseFormatOptionUnion interface{…}

Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 Turbo, and all GPT-3.5 Turbo models since gpt-3.5-turbo-1106.

Setting to { "type": "json_schema", "json_schema": {...} } enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.

Setting to { "type": "json_object" } enables JSON mode, which ensures the message the model generates is valid JSON.

Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly “stuck” request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.

type AssistantToolChoice struct{…}

Specifies a tool the model should use. Use to force the model to call a specific tool.

type AssistantToolChoiceFunction struct{…}
type AssistantToolChoiceOptionUnion interface{…}

Controls which (if any) tool is called by the model. none means the model will not call any tools and instead generates a message. auto is the default value and means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools before responding to the user. Specifying a particular tool like {"type": "file_search"} or {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.

type Thread struct{…}

Represents a thread that contains messages.

type ThreadDeleted struct{…}

BetaThreadsMessages

Build Assistants that can call models and use tools.

Create message
Deprecated
client.Beta.Threads.Messages.New(ctx, threadID, body) (*Message, error)
POST/threads/{thread_id}/messages
Delete message
Deprecated
client.Beta.Threads.Messages.Delete(ctx, threadID, messageID) (*MessageDeleted, error)
DELETE/threads/{thread_id}/messages/{message_id}
List messages
Deprecated
client.Beta.Threads.Messages.List(ctx, threadID, query) (*CursorPage[Message], error)
GET/threads/{thread_id}/messages
Retrieve message
Deprecated
client.Beta.Threads.Messages.Get(ctx, threadID, messageID) (*Message, error)
GET/threads/{thread_id}/messages/{message_id}
Modify message
Deprecated
client.Beta.Threads.Messages.Update(ctx, threadID, messageID, body) (*Message, error)
POST/threads/{thread_id}/messages/{message_id}
ModelsExpand Collapse
type AnnotationUnion interface{…}

A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the “file_search” tool to search files.

type AnnotationDeltaUnion interface{…}

A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the “file_search” tool to search files.

type FileCitationAnnotation struct{…}

A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the “file_search” tool to search files.

type FileCitationDeltaAnnotation struct{…}

A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the “file_search” tool to search files.

type FilePathAnnotation struct{…}

A URL for the file that’s generated when the assistant used the code_interpreter tool to generate a file.

type FilePathDeltaAnnotation struct{…}

A URL for the file that’s generated when the assistant used the code_interpreter tool to generate a file.

type ImageFile struct{…}
type ImageFileContentBlock struct{…}

References an image File in the content of a message.

type ImageFileDelta struct{…}
type ImageFileDeltaBlock struct{…}

References an image File in the content of a message.

type ImageURL struct{…}
type ImageURLContentBlock struct{…}

References an image URL in the content of a message.

type ImageURLDelta struct{…}
type ImageURLDeltaBlock struct{…}

References an image URL in the content of a message.

type Message struct{…}

Represents a message within a thread.

type MessageContentUnion interface{…}

References an image File in the content of a message.

type MessageContentDeltaUnion interface{…}

References an image File in the content of a message.

type MessageContentPartParamUnionResp interface{…}

References an image File in the content of a message.

type MessageDeleted struct{…}
type MessageDelta struct{…}

The delta containing the fields that have changed on the Message.

type MessageDeltaEvent struct{…}

Represents a message delta i.e. any changed fields on a message during streaming.

type RefusalContentBlock struct{…}

The refusal content generated by the assistant.

type RefusalDeltaBlock struct{…}

The refusal content that is part of a message.

type Text struct{…}
type TextContentBlock struct{…}

The text content that is part of a message.

type TextContentBlockParam struct{…}

The text content that is part of a message.

type TextDelta struct{…}
type TextDeltaBlock struct{…}

The text content that is part of a message.

BetaThreadsRuns

Build Assistants that can call models and use tools.

Cancel a run
Deprecated
client.Beta.Threads.Runs.Cancel(ctx, threadID, runID) (*Run, error)
POST/threads/{thread_id}/runs/{run_id}/cancel
Create run
Deprecated
client.Beta.Threads.Runs.New(ctx, threadID, params) (*Run, error)
POST/threads/{thread_id}/runs
List runs
Deprecated
client.Beta.Threads.Runs.List(ctx, threadID, query) (*CursorPage[Run], error)
GET/threads/{thread_id}/runs
Retrieve run
Deprecated
client.Beta.Threads.Runs.Get(ctx, threadID, runID) (*Run, error)
GET/threads/{thread_id}/runs/{run_id}
Submit tool outputs to run
Deprecated
client.Beta.Threads.Runs.SubmitToolOutputs(ctx, threadID, runID, body) (*Run, error)
POST/threads/{thread_id}/runs/{run_id}/submit_tool_outputs
Modify run
Deprecated
client.Beta.Threads.Runs.Update(ctx, threadID, runID, body) (*Run, error)
POST/threads/{thread_id}/runs/{run_id}
ModelsExpand Collapse
type RequiredActionFunctionToolCall struct{…}

Tool call objects

type Run struct{…}

Represents an execution run on a thread.

type RunStatus string

The status of the run, which can be either queued, in_progress, requires_action, cancelling, cancelled, failed, completed, incomplete, or expired.

BetaThreadsRunsSteps

Build Assistants that can call models and use tools.

List run steps
Deprecated
client.Beta.Threads.Runs.Steps.List(ctx, threadID, runID, query) (*CursorPage[RunStep], error)
GET/threads/{thread_id}/runs/{run_id}/steps
Retrieve run step
Deprecated
client.Beta.Threads.Runs.Steps.Get(ctx, threadID, runID, stepID, query) (*RunStep, error)
GET/threads/{thread_id}/runs/{run_id}/steps/{step_id}
ModelsExpand Collapse
type CodeInterpreterLogs struct{…}

Text output from the Code Interpreter tool call as part of a run step.

type CodeInterpreterOutputImage struct{…}
type CodeInterpreterToolCall struct{…}

Details of the Code Interpreter tool call the run step was involved in.

type CodeInterpreterToolCallDelta struct{…}

Details of the Code Interpreter tool call the run step was involved in.

type FileSearchToolCall struct{…}
type FileSearchToolCallDelta struct{…}
type FunctionToolCall struct{…}
type FunctionToolCallDelta struct{…}
type MessageCreationStepDetails struct{…}

Details of the message creation by the run step.

type RunStep struct{…}

Represents a step in execution of a run.

type RunStepDelta struct{…}

The delta containing the fields that have changed on the run step.

type RunStepDeltaEvent struct{…}

Represents a run step delta i.e. any changed fields on a run step during streaming.

type RunStepDeltaMessageDelta struct{…}

Details of the message creation by the run step.

type RunStepInclude string
type ToolCallUnion interface{…}

Details of the Code Interpreter tool call the run step was involved in.

type ToolCallDeltaUnion interface{…}

Details of the Code Interpreter tool call the run step was involved in.

type ToolCallDeltaObject struct{…}

Details of the tool call.

type ToolCallsStepDetails struct{…}

Details of the tool call.