OpenAI API

AssistantsApiResponseFormatOption

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.

One Of

AssistantsApiToolChoiceOption

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.

One Of

AssistantsNamedToolChoice

object

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

typestringrequired

The type of the tool. If type is function, the function name must be set

Allowed values:functioncode_interpreterfile_search

functionobject
Show Child Parameters
Example

AudioResponseFormat

string

The format of the output, in one of these options: json, text, srt, verbose_json, or vtt.

Allowed values:jsontextsrtverbose_jsonvtt

Default:json

AuditLog

object

A log of a user action or configuration change within this organization.

idstringrequired

The ID of this log.

typestringrequired

The event type.

Allowed values:api_key.createdapi_key.updatedapi_key.deletedinvite.sentinvite.acceptedinvite.deletedlogin.succeededlogin.failedlogout.succeededlogout.failedorganization.updatedproject.createdproject.updatedproject.archivedservice_account.createdservice_account.updatedservice_account.deletedrate_limit.updatedrate_limit.deleteduser.addeduser.updateduser.deleted

effective_atintegerrequired

The Unix timestamp (in seconds) of the event.

projectobject

The project that the action was scoped to. Absent for actions not scoped to projects.

Show Child Parameters
actorobjectrequired

The actor who performed the audit logged action.

Show Child Parameters
api_key.createdobject

The details for events with this type.

Show Child Parameters
api_key.updatedobject

The details for events with this type.

Show Child Parameters
api_key.deletedobject

The details for events with this type.

Show Child Parameters
invite.sentobject

The details for events with this type.

Show Child Parameters
invite.acceptedobject

The details for events with this type.

Show Child Parameters
invite.deletedobject

The details for events with this type.

Show Child Parameters
login.failedobject

The details for events with this type.

Show Child Parameters
logout.failedobject

The details for events with this type.

Show Child Parameters
organization.updatedobject

The details for events with this type.

Show Child Parameters
project.createdobject

The details for events with this type.

Show Child Parameters
project.updatedobject

The details for events with this type.

Show Child Parameters
project.archivedobject

The details for events with this type.

Show Child Parameters
rate_limit.updatedobject

The details for events with this type.

Show Child Parameters
rate_limit.deletedobject

The details for events with this type.

Show Child Parameters
service_account.createdobject

The details for events with this type.

Show Child Parameters
service_account.updatedobject

The details for events with this type.

Show Child Parameters
service_account.deletedobject

The details for events with this type.

Show Child Parameters
user.addedobject

The details for events with this type.

Show Child Parameters
user.updatedobject

The details for events with this type.

Show Child Parameters
user.deletedobject

The details for events with this type.

Show Child Parameters
Example