Openaiconnector v1.0

Version 1.0

Connector Overview: This page documents all 110 actions for the Openaiconnector v1.0.

Assistants (23)

POST Cancels a run that is `in_progress`.

/threads/{thread_id}/runs/{run_id}/cancel

Cancels a run that is currently in progress.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread to which this run belongs.

Run Id

The ID of the run to cancel.

Response Type

The response format expected from the API (e.g. application/json).

POST Create a message.

/threads/{thread_id}/messages

Creates a new message within a specified thread.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread to create a message for.

Response Type

The response format expected from the API (e.g. application/json).

Options (2)

Option Name

Description

Role

The role of the entity that is creating the message. Allowed values include:

  • user: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.

  • assistant: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.

Metadata

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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

POST Create a run.

/threads/{thread_id}/runs

Creates a new run for a specified thread, starting the assistant's response process.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread to run.

Include[]

A list of additional fields to include in the response. Currently the only supported value is step_details.tool_calls[].file_search.results[].content to fetch the file search result content.

See the file search tool documentation for more information.

Response Type

The response format expected from the API (e.g. application/json).

Options (11)

Option Name

Description

Assistant Id

The ID of the assistant to use to execute this run.

Instructions

Overrides the instructions of the assistant. This is useful for modifying the behavior on a per-run basis.

Additional Instructions

Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions.

Tools

Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.

Metadata

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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

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.

Top P

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.

Stream

If true, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a data: [DONE] message.

Max Prompt Tokens

The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status incomplete. See incomplete_details for more info.

Max Completion Tokens

The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status incomplete. See incomplete_details for more info.

Parallel Tool Calls

Whether to enable parallel function calling during tool use.

POST Create a thread and run it in one request.

/threads/runs

Creates a new thread and immediately starts a run on it, combining two steps into one request.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (10)

Option Name

Description

Assistant Id

The ID of the assistant to use to execute this run.

Instructions

Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis.

Tools

Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.

Metadata

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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

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.

Top P

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.

Stream

If true, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a data: [DONE] message.

Max Prompt Tokens

The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status incomplete. See incomplete_details for more info.

Max Completion Tokens

The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status incomplete. See incomplete_details for more info.

Parallel Tool Calls

Whether to enable parallel function calling during tool use.

POST Create a thread.

/threads

Creates a new conversation thread.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (1)

Option Name

Description

Metadata

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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

POST Create an assistant with a model and instructions.

/assistants

Creates a new assistant with the specified model and system instructions.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (7)

Option Name

Description

Name

The name of the assistant. The maximum length is 256 characters.

Description

The description of the assistant. The maximum length is 512 characters.

Instructions

The system instructions that the assistant uses. The maximum length is 256,000 characters.

Tools

A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types code_interpreter, file_search, or function.

Metadata

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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

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.

Top P

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.

DELETE Delete a thread.

/threads/{thread_id}

Permanently deletes a specified thread and all its messages.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread to delete.

Response Type

The response format expected from the API (e.g. application/json).

DELETE Delete an assistant.

/assistants/{assistant_id}

Permanently deletes a specified assistant.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Assistant Id

The ID of the assistant to delete.

Response Type

The response format expected from the API (e.g. application/json).

DELETE Deletes a message.

/threads/{thread_id}/messages/{message_id}

Permanently deletes a specific message within a thread.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread to which this message belongs.

Message Id

The ID of the message to delete.

Response Type

The response format expected from the API (e.g. application/json).

POST Modifies a message.

/threads/{thread_id}/messages/{message_id}

Updates the content or metadata of an existing message.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread to which this message belongs.

Message Id

The ID of the message to modify.

Response Type

The response format expected from the API (e.g. application/json).

Options (1)

Option Name

Description

Metadata

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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

POST Modifies a run.

/threads/{thread_id}/runs/{run_id}

Updates the metadata or status of an existing run.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread that was run.

Run Id

The ID of the run to modify.

Response Type

The response format expected from the API (e.g. application/json).

Options (1)

Option Name

Description

Metadata

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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

POST Modifies a thread.

/threads/{thread_id}

Updates the metadata of an existing thread.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread to modify. Only the metadata can be modified.

Response Type

The response format expected from the API (e.g. application/json).

Options (1)

Option Name

Description

Metadata

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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

POST Modifies an assistant.

/assistants/{assistant_id}

Updates the model, instructions, or other properties of an existing assistant.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Assistant Id

The ID of the assistant to modify.

Response Type

The response format expected from the API (e.g. application/json).

Options (7)

Option Name

Description

Name

The name of the assistant. The maximum length is 256 characters.

Description

The description of the assistant. The maximum length is 512 characters.

Instructions

The system instructions that the assistant uses. The maximum length is 256,000 characters.

Tools

A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types code_interpreter, file_search, or function.

Metadata

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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

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.

Top P

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.

GET Retrieve a message.

/threads/{thread_id}/messages/{message_id}

Retrieves the details of a specific message within a thread.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread to which this message belongs.

Message Id

The ID of the message to retrieve.

Response Type

The response format expected from the API (e.g. application/json).

GET Retrieves a run step.

/threads/{thread_id}/runs/{run_id}/steps/{step_id}

Retrieves the details of a specific step within a run.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread to which the run and run step belongs.

Run Id

The ID of the run to which the run step belongs.

Step Id

The ID of the run step to retrieve.

Include[]

A list of additional fields to include in the response. Currently the only supported value is step_details.tool_calls[].file_search.results[].content to fetch the file search result content.

See the file search tool documentation for more information.

Response Type

The response format expected from the API (e.g. application/json).

GET Retrieves a run.

/threads/{thread_id}/runs/{run_id}

Retrieves the details of a specific run.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread that was run.

Run Id

The ID of the run to retrieve.

Response Type

The response format expected from the API (e.g. application/json).

GET Retrieves a thread.

/threads/{thread_id}

Retrieves the details of a specific thread.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread to retrieve.

Response Type

The response format expected from the API (e.g. application/json).

GET Retrieves an assistant.

/assistants/{assistant_id}

Retrieves the details of a specific assistant.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Assistant Id

The ID of the assistant to retrieve.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns a list of assistants.

/assistants

Returns a paginated list of all assistants.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Order

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Before

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns a list of messages for a given thread.

/threads/{thread_id}/messages

Returns a paginated list of messages belonging to a specific thread.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread the messages belong to.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Order

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Before

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

Run Id

Filter messages by the run ID that generated them.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns a list of run steps belonging to a run.

/threads/{thread_id}/runs/{run_id}/steps

Returns a paginated list of steps for a specific run.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread the run and run steps belong to.

Run Id

The ID of the run the run steps belong to.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Order

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Before

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

Include[]

A list of additional fields to include in the response. Currently the only supported value is step_details.tool_calls[].file_search.results[].content to fetch the file search result content.

See the file search tool documentation for more information.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns a list of runs belonging to a thread.

/threads/{thread_id}/runs

Returns a paginated list of runs for a specific thread.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread the run belongs to.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Order

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Before

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

Response Type

The response format expected from the API (e.g. application/json).

POST When a run has the `status: "requires_action"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request.

/threads/{thread_id}/runs/{run_id}/submit_tool_outputs

Submits the outputs from tool calls when a run requires action, completing the pending tool outputs in a single request.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Thread Id

The ID of the thread to which this run belongs.

Run Id

The ID of the run that requires the tool output submission.

Response Type

The response format expected from the API (e.g. application/json).

Options (1)

Option Name

Description

Stream

If true, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a data: [DONE] message.

Audio (3)

POST Generates audio from the input text.

/audio/speech

Generates spoken audio from provided text using a specified voice.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (4)

Option Name

Description

Input

The text to generate audio for. The maximum length is 4096 characters.

Voice

The voice to use when generating the audio. Supported voices are alloy, echo, fable, onyx, nova, and shimmer. Previews of the voices are available in the Text to speech guide.

Response Format

The format to audio in. Supported formats are mp3, opus, aac, flac, wav, and pcm.

Speed

The speed of the generated audio. Select a value from 0.25 to 4.0. 1.0 is the default.

POST Transcribes audio into the input language.

/audio/transcriptions

Transcribes spoken audio into text in the original language.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (6)

Option Name

Description

File

The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.

Language

The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.

Prompt

An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.

Response Format

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

Temperature

The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.

Timestamp Granularities[]

The timestamp granularities to populate for this transcription. response_format must be set verbose_json to use timestamp granularities. Either or both of these options are supported: word, or segment. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.

POST Translates audio into English.

/audio/translations

Translates audio into English, converting speech from any language to English text or subtitles.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (4)

Option Name

Description

File

The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.

Prompt

An optional text to guide the model's style or continue a previous audio segment. The prompt should be in English.

Response Format

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

Temperature

The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.

Audit Logs

GET List user actions and configuration changes within this organization.

/organization/audit_logs

Retrieve a list of user actions and configuration changes within your organization for auditing purposes.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Effective At

Return only events whose effective_at (Unix seconds) is in this range.

Project Ids[]

Return only events for these projects.

Event Types[]

Return only events with a type in one of these values. For example, project.created. For all options, see the documentation for the audit log object.

Actor Ids[]

Return only events performed by these actors. Can be a user ID, a service account ID, or an api key tracking ID.

Actor Emails[]

Return only events performed by users with these emails.

Resource Ids[]

Return only events performed on these targets. For example, a project ID updated.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Before

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

Response Type

The response format expected from the API (e.g. application/json).

Batch (4)

POST Cancels an in-progress batch. The batch will be in status `cancelling` for up to 10 minutes, before changing to `cancelled`, where it will have partial results (if any) available in the output file.

/batches/{batch_id}/cancel

Cancel an in-progress batch. The batch will transition to 'cancelling' status for up to 10 minutes before becoming 'cancelled', with partial results available in the output file if any.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Batch Id

The ID of the batch to cancel.

Response Type

The response format expected from the API (e.g. application/json).

POST Creates and executes a batch from an uploaded file of requests

/batches

Create and execute a new batch job from an uploaded file containing multiple API requests.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (3)

Option Name

Description

Input File Id

The ID of an uploaded file that contains requests for the new batch.

See upload file (/docs/api-reference/files/create) for how to upload a file.

Your input file must be formatted as a JSONL file (/docs/api-reference/batch/request-input), and must be uploaded with the purpose batch. The file can contain up to 50,000 requests, and can be up to 200 MB in size.

Endpoint

The endpoint to be used for all requests in the batch. Currently /v1/chat/completions, /v1/embeddings, and /v1/completions are supported. Note that /v1/embeddings batches are also restricted to a maximum of 50,000 embedding inputs across all requests in the batch.

Completion Window

The time frame within which the batch should be processed. Currently only 24h is supported.

GET List your organization's batches.

/batches

List all batches in your organization, providing an overview of their status and details.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Response Type

The response format expected from the API (e.g. application/json).

GET Retrieves a batch.

/batches/{batch_id}

Retrieve detailed information about a specific batch using its unique identifier.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Batch Id

The ID of the batch to retrieve.

Response Type

The response format expected from the API (e.g. application/json).

Chat

POST Creates a model response for the given chat conversation. Learn more in the [text generation](/docs/guides/text-generation), [vision](/docs/guides/vision), and [audio](/docs/guides/audio) guides. Parameter support can differ depending on the model used to generate the response, particularly for newer reasoning models. Parameters that are only supported for reasoning models are noted below. For the current state of unsupported parameters in reasoning models, [refer to the reasoning guide](/docs/guides/reasoning).

/chat/completions

Generate a model response for a chat conversation, supporting text, vision, and audio inputs. Parameter support varies by model, especially for reasoning models.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (18)

Option Name

Description

Messages

A list of messages comprising the conversation so far. Depending on the
model (/docs/models) you use, different message types (modalities) are
supported, like text (/docs/guides/text-generation),
images (/docs/guides/vision), and audio (/docs/guides/audio).

Store

Whether or not to store the output of this chat completion request for
use in our model distillation (/docs/guides/distillation) or
evals (/docs/guides/evals) products.

Reasoning Effort

o1 models only

Constrains effort on reasoning for
reasoning models.
Currently supported values are low, medium, and high. Reducing
reasoning effort can result in faster responses and fewer tokens used
on reasoning in a response.

Frequency Penalty

Number between -2.0 and 2.0. Positive values penalize new tokens based on
their existing frequency in the text so far, decreasing the model's
likelihood to repeat the same line verbatim.

Logprobs

Whether to return log probabilities of the output tokens or not. If true,
returns the log probabilities of each output token returned in the
content of message.

Top Logprobs

An integer between 0 and 20 specifying the number of most likely tokens to
return at each token position, each with an associated log probability.
logprobs must be set to true if this parameter is used.

Max Tokens

The maximum number of tokens (/tokenizer) that can be generated in the
chat completion. This value can be used to control
costs (https://openai.com/api/pricing/) for text generated via API.

This value is now deprecated in favor of max_completion_tokens, and is
not compatible with o1 series models (/docs/guides/reasoning).

Max Completion Tokens

An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.

N

How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs.

Modalities

Output types that you would like the model to generate for this request.
Most models are capable of generating text, which is the default:

["text"]

The gpt-4o-audio-preview model can also be used to generate audio. To
request that this model generate both text and audio responses, you can
use:

["text", "audio"]

Presence Penalty

Number between -2.0 and 2.0. Positive values penalize new tokens based on
whether they appear in the text so far, increasing the model's likelihood
to talk about new topics.

Seed

This feature is in Beta.
If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
Determinism is not guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend.

Service Tier

Specifies the latency tier to use for processing the request. This parameter is relevant for customers subscribed to the scale tier service:

  • If set to 'auto', and the Project is Scale tier enabled, the system will utilize scale tier credits until they are exhausted.

  • If set to 'auto', and the Project is not Scale tier enabled, the request will be processed using the default service tier with a lower uptime SLA and no latency guarentee.

  • If set to 'default', the request will be processed using the default service tier with a lower uptime SLA and no latency guarentee.

  • When not set, the default behavior is 'auto'.

When this parameter is set, the response body will include the service_tier utilized.

Stream

If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events (https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a data: [DONE] message. Example Python code (https://cookbook.openai.com/examples/how_to_stream_completions).

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.
We generally recommend altering this or top_p but not both.

Top P

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.

Parallel Tool Calls

Whether to enable parallel function calling during tool use.

User

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

Completions

POST Creates a completion for the provided prompt and parameters.

/completions

Generate a completion for a given prompt using the specified model and parameters.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (13)

Option Name

Description

Best Of

Generates best_of completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed.

When used with n, best_of controls the number of candidate completions and n specifies how many to return – best_of must be greater than n.

Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for max_tokens and stop.

Echo

Echo back the prompt in addition to the completion

Frequency Penalty

Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

See more information about frequency and presence penalties.

Logprobs

Include the log probabilities on the logprobs most likely output tokens, as well the chosen tokens. For example, if logprobs is 5, the API will return a list of the 5 most likely tokens. The API will always return the logprob of the sampled token, so there may be up to logprobs+1 elements in the response.

The maximum value for logprobs is 5.

Max Tokens

The maximum number of tokens (/tokenizer) that can be generated in the completion.

The token count of your prompt plus max_tokens cannot exceed the model's context length. Example Python code (https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.

N

How many completions to generate for each prompt.

Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for max_tokens and stop.

Presence Penalty

Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.

See more information about frequency and presence penalties.

Seed

If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.

Determinism is not guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend.

Stream

Whether to stream back partial progress. If set, tokens will be sent as data-only server-sent events (https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a data: [DONE] message. Example Python code (https://cookbook.openai.com/examples/how_to_stream_completions).

Suffix

The suffix that comes after a completion of inserted text.

This parameter is only supported for gpt-3.5-turbo-instruct.

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.

We generally recommend altering this or top_p but not both.

Top P

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.

User

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

General (4)

POST Create an organization admin API key

/organization/admin_api_keys

Create a new admin-level API key for the organization.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (1)

Option Name

Description

Name

An optional name to assign to the new API key for easy identification.

DELETE Delete an organization admin API key

/organization/admin_api_keys/{key_id}

Delete the specified admin API key.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Key Id

The ID of the API key to be deleted.

Response Type

The response format expected from the API (e.g. application/json).

GET List organization API keys

/organization/admin_api_keys

Retrieve a paginated list of organization admin API keys.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

After

Return keys with IDs that come after this ID in the pagination order.

Order

Order results by creation time, ascending or descending.

Limit

Maximum number of keys to return.

Response Type

The response format expected from the API (e.g. application/json).

GET Retrieve a single organization API key

/organization/admin_api_keys/{key_id}

Get details for a specific organization API key by its ID.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Key Id

The ID of the API key.

Response Type

The response format expected from the API (e.g. application/json).

Embeddings

POST Creates an embedding vector representing the input text.

/embeddings

Create an embedding vector that represents the semantic meaning of the input text.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (3)

Option Name

Description

Encoding Format

The format to return the embeddings in. Can be either float or base64.

Dimensions

The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.

User

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

Files (5)

DELETE Delete a file.

/files/{file_id}

Permanently delete a specific file from your organization's storage.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

File Id

The ID of the file to use for this request.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns a list of files.

/files

Retrieve a list of all files uploaded to your organization, including metadata such as size and purpose.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Purpose

Only return files with the given purpose.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000.

Order

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns information about a specific file.

/files/{file_id}

Retrieve detailed information about a specific file using its file identifier.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

File Id

The ID of the file to use for this request.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns the contents of the specified file.

/files/{file_id}/content

Download the raw contents of a specific file for inspection or processing.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

File Id

The ID of the file to use for this request.

Response Type

The response format expected from the API (e.g. application/json).

POST Upload a file that can be used across various endpoints. Individual files can be up to 512 MB, and the size of all files uploaded by one organization can be up to 100 GB. The Assistants API supports files up to 2 million tokens and of specific file types. See the [Assistants Tools guide](/docs/assistants/tools) for details. The Fine-tuning API only supports `.jsonl` files. The input also has certain required formats for fine-tuning [chat](/docs/api-reference/fine-tuning/chat-input) or [completions](/docs/api-reference/fine-tuning/completions-input) models. The Batch API only supports `.jsonl` files up to 200 MB in size. The input also has a specific required [format](/docs/api-reference/batch/request-input). Please [contact us](https://help.openai.com/) if you need to increase these storage limits.

/files

Upload a file for use with various OpenAI endpoints. File size limits vary by purpose: up to 512 MB for general use, 2 million tokens for Assistants, and 200 MB for Batch API.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (2)

Option Name

Description

File

The File object (not file name) to be uploaded.

Purpose

The intended purpose of the uploaded file.

Use "assistants" for Assistants (/docs/api-reference/assistants) and Message (/docs/api-reference/messages) files, "vision" for Assistants image file inputs, "batch" for Batch API (/docs/guides/batch), and "fine-tune" for Fine-tuning (/docs/api-reference/fine-tuning).

Fine-tuning (6)

POST Creates a fine-tuning job which begins the process of creating a new model from a given dataset. Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. [Learn more about fine-tuning](/docs/guides/fine-tuning)

/fine_tuning/jobs

Create a new fine-tuning job that trains a model on your dataset. Returns job details including status and the name of the fine-tuned model once complete.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (4)

Option Name

Description

Training File

The ID of an uploaded file that contains training data.

See upload file (/docs/api-reference/files/create) for how to upload a file.

Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose fine-tune.

The contents of the file should differ depending on if the model uses the chat (/docs/api-reference/fine-tuning/chat-input), completions (/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the preference (/docs/api-reference/fine-tuning/preference-input) format.

See the fine-tuning guide (/docs/guides/fine-tuning) for more details.

Suffix

A string of up to 64 characters that will be added to your fine-tuned model name.

For example, a suffix of "custom-model-name" would produce a model name like ft:gpt-4o-mini:openai:custom-model-name:7p4lURel.

Validation File

The ID of an uploaded file that contains validation data.

If you provide this file, the data is used to generate validation
metrics periodically during fine-tuning. These metrics can be viewed in
the fine-tuning results file.
The same data should not be present in both train and validation files.

Your dataset must be formatted as a JSONL file. You must upload your file with the purpose fine-tune.

See the fine-tuning guide for more details.

Seed

The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases.
If a seed is not specified, one will be generated for you.

GET Get info about a fine-tuning job. [Learn more about fine-tuning](/docs/guides/fine-tuning)

/fine_tuning/jobs/{fine_tuning_job_id}

Retrieve detailed information about a specific fine-tuning job using its job identifier.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Fine Tuning Job Id

The ID of the fine-tuning job.

Response Type

The response format expected from the API (e.g. application/json).

GET Get status updates for a fine-tuning job.

/fine_tuning/jobs/{fine_tuning_job_id}/events

Retrieve a list of status update events for a specific fine-tuning job to track its progress.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Fine Tuning Job Id

The ID of the fine-tuning job to get events for.

After

Identifier for the last event from the previous pagination request.

Limit

Number of events to retrieve.

Response Type

The response format expected from the API (e.g. application/json).

POST Immediately cancel a fine-tune job.

/fine_tuning/jobs/{fine_tuning_job_id}/cancel

Immediately cancel a running fine-tuning job, stopping further processing.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Fine Tuning Job Id

The ID of the fine-tuning job to cancel.

Response Type

The response format expected from the API (e.g. application/json).

GET List checkpoints for a fine-tuning job.

/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints

List all checkpoints created during a fine-tuning job, which represent saved states of the model at various training steps.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Fine Tuning Job Id

The ID of the fine-tuning job to get checkpoints for.

After

Identifier for the last checkpoint ID from the previous pagination request.

Limit

Number of checkpoints to retrieve.

Response Type

The response format expected from the API (e.g. application/json).

GET List your organization's fine-tuning jobs

/fine_tuning/jobs

List all fine-tuning jobs in your organization, providing an overview of their status and configuration.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

After

Identifier for the last job from the previous pagination request.

Limit

Number of fine-tuning jobs to retrieve.

Response Type

The response format expected from the API (e.g. application/json).

Images (3)

POST Creates a variation of a given image.

/images/variations

Generate a variation of an existing image using AI, creating a new image with similar style and content.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (5)

Option Name

Description

Image

The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.

N

The number of images to generate. Must be between 1 and 10. For dall-e-3, only n=1 is supported.

Response Format

The format in which the generated images are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated.

Size

The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.

User

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

POST Creates an edited or extended image given an original image and a prompt.

/images/edits

Edit or extend an existing image based on a text prompt, modifying regions or adding content.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (7)

Option Name

Description

Image

The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.

Prompt

A text description of the desired image(s). The maximum length is 1000 characters.

Mask

An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as image.

N

The number of images to generate. Must be between 1 and 10.

Size

The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.

Response Format

The format in which the generated images are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated.

User

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

POST Creates an image given a prompt.

/images/generations

Generate an original image from a textual description using DALL·E or similar image generation models.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (7)

Option Name

Description

Prompt

A text description of the desired image(s). The maximum length is 1000 characters for dall-e-2 and 4000 characters for dall-e-3.

N

The number of images to generate. Must be between 1 and 10. For dall-e-3, only n=1 is supported.

Quality

The quality of the image that will be generated. hd creates images with finer details and greater consistency across the image. This param is only supported for dall-e-3.

Response Format

The format in which the generated images are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated.

Size

The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024 for dall-e-2. Must be one of 1024x1024, 1792x1024, or 1024x1792 for dall-e-3 models.

Style

The style of the generated images. Must be one of vivid or natural. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. This param is only supported for dall-e-3.

User

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

Invites (4)

POST Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization.

/organization/invites

Send an invitation to a user to join your organization. The invite must be accepted before the user gains access.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (2)

Option Name

Description

Email

Send an email to this address

Role

owner or reader

DELETE Delete an invite. If the invite has already been accepted, it cannot be deleted.

/organization/invites/{invite_id}

Delete an invite that has not yet been accepted.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Invite Id

The ID of the invite to delete.

Response Type

The response format expected from the API (e.g. application/json).

GET Retrieves an invite.

/organization/invites/{invite_id}

Retrieve details of a specific invite by its ID.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Invite Id

The ID of the invite to retrieve.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns a list of invites in the organization.

/organization/invites

Retrieve a list of all invites in the organization.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Response Type

The response format expected from the API (e.g. application/json).

Models (3)

DELETE Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.

/models/{model}

Permanently delete a fine-tuned model; requires Owner role.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Model

The model to delete

Response Type

The response format expected from the API (e.g. application/json).

GET Lists the currently available models, and provides basic information about each one such as the owner and availability.

/models

List all currently available models with basic information.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

GET Retrieves a model instance, providing basic information about the model such as the owner and permissioning.

/models/{model}

Retrieve basic information about a specific model instance.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Model

The ID of the model to use for this request

Response Type

The response format expected from the API (e.g. application/json).

Moderations

POST Classifies if text and/or image inputs are potentially harmful. Learn more in the [moderation guide](/docs/guides/moderation).

/moderations

Classify text and/or image inputs for potentially harmful content.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Projects (19)

POST Adds a user to the project. Users must already be members of the organization to be added to a project.

/organization/projects/{project_id}/users

Add an existing organization member as a user to a project.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

Response Type

The response format expected from the API (e.g. application/json).

Options (2)

Option Name

Description

User Id

The ID of the user.

Role

owner or member

POST Archives a project in the organization. Archived projects cannot be used or updated.

/organization/projects/{project_id}/archive

Archive a project, making it unusable and unmodifiable.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

Response Type

The response format expected from the API (e.g. application/json).

POST Create a new project in the organization. Projects can be created and archived, but cannot be deleted.

/organization/projects

Create a new project in the organization.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (1)

Option Name

Description

Name

The friendly name of the project, this name appears in reports.

POST Creates a new service account in the project. This also returns an unredacted API key for the service account.

/organization/projects/{project_id}/service_accounts

Create a new service account in a project and return its API key.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

Response Type

The response format expected from the API (e.g. application/json).

Options (1)

Option Name

Description

Name

The name of the service account being created.

DELETE Deletes a service account from the project.

/organization/projects/{project_id}/service_accounts/{service_account_id}

Delete a service account from a project.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

Service Account Id

The ID of the service account.

Response Type

The response format expected from the API (e.g. application/json).

DELETE Deletes a user from the project.

/organization/projects/{project_id}/users/{user_id}

Remove a user from a project.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

User Id

The ID of the user.

Response Type

The response format expected from the API (e.g. application/json).

DELETE Deletes an API key from the project.

/organization/projects/{project_id}/api_keys/{key_id}

Delete an API key from a project.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

Key Id

The ID of the API key.

Response Type

The response format expected from the API (e.g. application/json).

POST Modifies a project in the organization.

/organization/projects/{project_id}

Update the properties of a project.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

Response Type

The response format expected from the API (e.g. application/json).

Options (1)

Option Name

Description

Name

The updated name of the project, this name appears in reports.

POST Modifies a user's role in the project.

/organization/projects/{project_id}/users/{user_id}

Change the role of a user within a project.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

User Id

The ID of the user.

Response Type

The response format expected from the API (e.g. application/json).

Options (1)

Option Name

Description

Role

owner or member

GET Retrieves a project.

/organization/projects/{project_id}

Retrieve details of a specific project.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

Response Type

The response format expected from the API (e.g. application/json).

GET Retrieves a service account in the project.

/organization/projects/{project_id}/service_accounts/{service_account_id}

Retrieve details of a specific service account in a project.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

Service Account Id

The ID of the service account.

Response Type

The response format expected from the API (e.g. application/json).

GET Retrieves a user in the project.

/organization/projects/{project_id}/users/{user_id}

Retrieve details of a specific user in a project.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

User Id

The ID of the user.

Response Type

The response format expected from the API (e.g. application/json).

GET Retrieves an API key in the project.

/organization/projects/{project_id}/api_keys/{key_id}

Retrieve details of a specific API key in a project.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

Key Id

The ID of the API key.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns a list of API keys in the project.

/organization/projects/{project_id}/api_keys

List all API keys in a project.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns a list of projects.

/organization/projects

List all projects in the organization.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Include Archived

If true returns all projects including those that have been archived. Archived projects are not included by default.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns a list of service accounts in the project.

/organization/projects/{project_id}/service_accounts

List all service accounts in a project.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns a list of users in the project.

/organization/projects/{project_id}/users

List all users in a project.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns the rate limits per model for a project.

/organization/projects/{project_id}/rate_limits

Retrieve the rate limits per model for a project.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

Limit

A limit on the number of objects to be returned. The default is 100.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Before

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, beginning with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

Response Type

The response format expected from the API (e.g. application/json).

POST Updates a project rate limit.

/organization/projects/{project_id}/rate_limits/{rate_limit_id}

Update the rate limit configuration for a specific project, identified by the project ID and rate limit ID.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Project Id

The ID of the project.

Rate Limit Id

The ID of the rate limit.

Response Type

The response format expected from the API (e.g. application/json).

Options (6)

Option Name

Description

Max Requests Per 1 Minute

The maximum requests per minute.

Max Tokens Per 1 Minute

The maximum tokens per minute.

Max Images Per 1 Minute

The maximum images per minute. Only relevant for certain models.

Max Audio Megabytes Per 1 Minute

The maximum audio megabytes per minute. Only relevant for certain models.

Max Requests Per 1 Day

The maximum requests per day. Only relevant for certain models.

Batch 1 Day Max Input Tokens

The maximum batch input tokens per day. Only relevant for certain models.

Realtime

POST Create an ephemeral API token for use in client-side applications with the Realtime API. Can be configured with the same session parameters as the `session.update` client event. It responds with a session object, plus a `client_secret` key which contains a usable ephemeral API token that can be used to authenticate browser clients for the Realtime API.

/realtime/sessions

Create an ephemeral API token for client-side applications using the Realtime API, configured with session parameters. Returns a session object and a client secret token for authenticating browser clients.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (8)

Option Name

Description

Modalities

The set of modalities the model can respond with. To disable audio,
set this to ["text"].

Model

The Realtime model used for this session.

Instructions

The default system instructions (i.e. system message) prepended to model
calls. This field allows the client to guide the model on desired
responses. The model can be instructed on response content and format,
(e.g. "be extremely succinct", "act friendly", "here are examples of good
responses") and on audio behavior (e.g. "talk quickly", "inject emotion
into your voice", "laugh frequently"). The instructions are not guaranteed
to be followed by the model, but they provide guidance to the model on the
desired behavior.

Note that the server sets default instructions which will be used if this
field is not set and are visible in the session.created event at the
start of the session.

Voice

The voice the model uses to respond. Voice cannot be changed during the
session once the model has responded with audio at least once. Current
voice options are alloy, ash, ballad, coral, echo sage,
shimmer and verse.

Input Audio Format

The format of input audio. Options are pcm16, g711_ulaw, or g711_alaw.

Output Audio Format

The format of output audio. Options are pcm16, g711_ulaw, or g711_alaw.

Tool Choice

How the model chooses tools. Options are auto, none, required, or
specify a function.

Temperature

Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.

Uploads (4)

POST Adds a [Part](/docs/api-reference/uploads/part-object) to an [Upload](/docs/api-reference/uploads/object) object. A Part represents a chunk of bytes from the file you are trying to upload. Each Part can be at most 64 MB, and you can add Parts until you hit the Upload maximum of 8 GB. It is possible to add multiple Parts in parallel. You can decide the intended order of the Parts when you [complete the Upload](/docs/api-reference/uploads/complete).

/uploads/{upload_id}/parts

Add a chunk of bytes (a Part) to an existing Upload. Each Part can be up to 64 MB, and multiple Parts can be added in parallel until the 8 GB total limit is reached.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Upload Id

The ID of the Upload.

Response Type

The response format expected from the API (e.g. application/json).

Options (1)

Option Name

Description

Data

The chunk of bytes for this Part.

POST Cancels the Upload. No Parts may be added after an Upload is cancelled.

/uploads/{upload_id}/cancel

Cancel an Upload, preventing any further Parts from being added. Use this to abort an upload that is no longer needed.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Upload Id

The ID of the Upload.

Response Type

The response format expected from the API (e.g. application/json).

POST Completes the [Upload](/docs/api-reference/uploads/object). Within the returned Upload object, there is a nested [File](/docs/api-reference/files/object) object that is ready to use in the rest of the platform. You can specify the order of the Parts by passing in an ordered list of the Part IDs. The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed.

/uploads/{upload_id}/complete

Finalize an Upload by specifying the order of Parts. After completion, a File object is created for use in the platform. The total bytes uploaded must match the initially specified size.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Upload Id

The ID of the Upload.

Response Type

The response format expected from the API (e.g. application/json).

Options (2)

Option Name

Description

Part Ids

The ordered list of Part IDs.

Md5

The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect.

POST Creates an intermediate [Upload](/docs/api-reference/uploads/object) object that you can add [Parts](/docs/api-reference/uploads/part-object) to. Currently, an Upload can accept at most 8 GB in total and expires after an hour after you create it. Once you complete the Upload, we will create a [File](/docs/api-reference/files/object) object that contains all the parts you uploaded. This File is usable in the rest of our platform as a regular File object. For certain `purpose`s, the correct `mime_type` must be specified. Please refer to documentation for the supported MIME types for your use case: - [Assistants](/docs/assistants/tools/file-search#supported-files) For guidance on the proper filename extensions for each purpose, please follow the documentation on [creating a File](/docs/api-reference/files/create).

/uploads

Initiate a new Upload to which Parts can be added. The Upload expires after one hour and can hold up to 8 GB. After completion, a File object is created.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (4)

Option Name

Description

Filename

The name of the file to upload.

Purpose

The intended purpose of the uploaded file.

See the documentation on File purposes.

Bytes

The number of bytes in the file you are uploading.

Mime Type

The MIME type of the file.

This must fall within the supported MIME types for your file purpose. See the supported MIME types for assistants and vision.

Usage (9)

GET Get audio speeches usage details for the organization.

/organization/usage/audio_speeches

Retrieve usage details for audio speeches within the organization, such as total usage or cost.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Start Time

Start time (Unix seconds) of the query time range, inclusive.

End Time

End time (Unix seconds) of the query time range, exclusive.

Bucket Width

Width of each time bucket in response. Currently 1m, 1h and 1d are supported, default to 1d.

Project Ids

Return only usage for these projects.

User Ids

Return only usage for these users.

Api Key Ids

Return only usage for these API keys.

Models

Return only usage for these models.

Group By

Group the usage data by the specified fields. Support fields include project_id, user_id, api_key_id, model or any combination of them.

Limit

Specifies the number of buckets to return.

  • bucket_width=1d: default: 7, max: 31

  • bucket_width=1h: default: 24, max: 168

  • bucket_width=1m: default: 60, max: 1440

Page

A cursor for use in pagination. Corresponding to the next_page field from the previous response.

Response Type

The response format expected from the API (e.g. application/json).

GET Get audio transcriptions usage details for the organization.

/organization/usage/audio_transcriptions

Retrieve usage details for audio transcriptions within the organization.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Start Time

Start time (Unix seconds) of the query time range, inclusive.

End Time

End time (Unix seconds) of the query time range, exclusive.

Bucket Width

Width of each time bucket in response. Currently 1m, 1h and 1d are supported, default to 1d.

Project Ids

Return only usage for these projects.

User Ids

Return only usage for these users.

Api Key Ids

Return only usage for these API keys.

Models

Return only usage for these models.

Group By

Group the usage data by the specified fields. Support fields include project_id, user_id, api_key_id, model or any combination of them.

Limit

Specifies the number of buckets to return.

  • bucket_width=1d: default: 7, max: 31

  • bucket_width=1h: default: 24, max: 168

  • bucket_width=1m: default: 60, max: 1440

Page

A cursor for use in pagination. Corresponding to the next_page field from the previous response.

Response Type

The response format expected from the API (e.g. application/json).

GET Get code interpreter sessions usage details for the organization.

/organization/usage/code_interpreter_sessions

Retrieve usage details for code interpreter sessions within the organization.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Start Time

Start time (Unix seconds) of the query time range, inclusive.

End Time

End time (Unix seconds) of the query time range, exclusive.

Bucket Width

Width of each time bucket in response. Currently 1m, 1h and 1d are supported, default to 1d.

Project Ids

Return only usage for these projects.

Group By

Group the usage data by the specified fields. Support fields include project_id.

Limit

Specifies the number of buckets to return.

  • bucket_width=1d: default: 7, max: 31

  • bucket_width=1h: default: 24, max: 168

  • bucket_width=1m: default: 60, max: 1440

Page

A cursor for use in pagination. Corresponding to the next_page field from the previous response.

Response Type

The response format expected from the API (e.g. application/json).

GET Get completions usage details for the organization.

/organization/usage/completions

Retrieve usage details for completions (e.g., chat completions) within the organization.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Start Time

Start time (Unix seconds) of the query time range, inclusive.

End Time

End time (Unix seconds) of the query time range, exclusive.

Bucket Width

Width of each time bucket in response. Currently 1m, 1h and 1d are supported, default to 1d.

Project Ids

Return only usage for these projects.

User Ids

Return only usage for these users.

Api Key Ids

Return only usage for these API keys.

Models

Return only usage for these models.

Batch

If true, return batch jobs only. If false, return non-batch jobs only. By default, return both.

Group By

Group the usage data by the specified fields. Support fields include project_id, user_id, api_key_id, model, batch or any combination of them.

Limit

Specifies the number of buckets to return.

  • bucket_width=1d: default: 7, max: 31

  • bucket_width=1h: default: 24, max: 168

  • bucket_width=1m: default: 60, max: 1440

Page

A cursor for use in pagination. Corresponding to the next_page field from the previous response.

Response Type

The response format expected from the API (e.g. application/json).

GET Get costs details for the organization.

/organization/costs

Retrieve cost details for the organization, including breakdowns by service or time period.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Start Time

Start time (Unix seconds) of the query time range, inclusive.

End Time

End time (Unix seconds) of the query time range, exclusive.

Bucket Width

Width of each time bucket in response. Currently only 1d is supported, default to 1d.

Project Ids

Return only costs for these projects.

Group By

Group the costs by the specified fields. Support fields include project_id, line_item and any combination of them.

Limit

A limit on the number of buckets to be returned. Limit can range between 1 and 180, and the default is 7.

Page

A cursor for use in pagination. Corresponding to the next_page field from the previous response.

Response Type

The response format expected from the API (e.g. application/json).

GET Get embeddings usage details for the organization.

/organization/usage/embeddings

Retrieve usage details for embeddings within the organization.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Start Time

Start time (Unix seconds) of the query time range, inclusive.

End Time

End time (Unix seconds) of the query time range, exclusive.

Bucket Width

Width of each time bucket in response. Currently 1m, 1h and 1d are supported, default to 1d.

Project Ids

Return only usage for these projects.

User Ids

Return only usage for these users.

Api Key Ids

Return only usage for these API keys.

Models

Return only usage for these models.

Group By

Group the usage data by the specified fields. Support fields include project_id, user_id, api_key_id, model or any combination of them.

Limit

Specifies the number of buckets to return.

  • bucket_width=1d: default: 7, max: 31

  • bucket_width=1h: default: 24, max: 168

  • bucket_width=1m: default: 60, max: 1440

Page

A cursor for use in pagination. Corresponding to the next_page field from the previous response.

Response Type

The response format expected from the API (e.g. application/json).

GET Get images usage details for the organization.

/organization/usage/images

Retrieve usage details for images within the organization.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Start Time

Start time (Unix seconds) of the query time range, inclusive.

End Time

End time (Unix seconds) of the query time range, exclusive.

Bucket Width

Width of each time bucket in response. Currently 1m, 1h and 1d are supported, default to 1d.

Sources

Return only usages for these sources. Possible values are image.generation, image.edit, image.variation or any combination of them.

Sizes

Return only usages for these image sizes. Possible values are 256x256, 512x512, 1024x1024, 1792x1792, 1024x1792 or any combination of them.

Project Ids

Return only usage for these projects.

User Ids

Return only usage for these users.

Api Key Ids

Return only usage for these API keys.

Models

Return only usage for these models.

Group By

Group the usage data by the specified fields. Support fields include project_id, user_id, api_key_id, model, size, source or any combination of them.

Limit

Specifies the number of buckets to return.

  • bucket_width=1d: default: 7, max: 31

  • bucket_width=1h: default: 24, max: 168

  • bucket_width=1m: default: 60, max: 1440

Page

A cursor for use in pagination. Corresponding to the next_page field from the previous response.

Response Type

The response format expected from the API (e.g. application/json).

GET Get moderations usage details for the organization.

/organization/usage/moderations

Retrieve usage details for moderations within the organization.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Start Time

Start time (Unix seconds) of the query time range, inclusive.

End Time

End time (Unix seconds) of the query time range, exclusive.

Bucket Width

Width of each time bucket in response. Currently 1m, 1h and 1d are supported, default to 1d.

Project Ids

Return only usage for these projects.

User Ids

Return only usage for these users.

Api Key Ids

Return only usage for these API keys.

Models

Return only usage for these models.

Group By

Group the usage data by the specified fields. Support fields include project_id, user_id, api_key_id, model or any combination of them.

Limit

Specifies the number of buckets to return.

  • bucket_width=1d: default: 7, max: 31

  • bucket_width=1h: default: 24, max: 168

  • bucket_width=1m: default: 60, max: 1440

Page

A cursor for use in pagination. Corresponding to the next_page field from the previous response.

Response Type

The response format expected from the API (e.g. application/json).

GET Get vector stores usage details for the organization.

/organization/usage/vector_stores

Retrieve usage details for vector stores within the organization.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Start Time

Start time (Unix seconds) of the query time range, inclusive.

End Time

End time (Unix seconds) of the query time range, exclusive.

Bucket Width

Width of each time bucket in response. Currently 1m, 1h and 1d are supported, default to 1d.

Project Ids

Return only usage for these projects.

Group By

Group the usage data by the specified fields. Support fields include project_id.

Limit

Specifies the number of buckets to return.

  • bucket_width=1d: default: 7, max: 31

  • bucket_width=1h: default: 24, max: 168

  • bucket_width=1m: default: 60, max: 1440

Page

A cursor for use in pagination. Corresponding to the next_page field from the previous response.

Response Type

The response format expected from the API (e.g. application/json).

Users (4)

DELETE Deletes a user from the organization.

/organization/users/{user_id}

Permanently remove a user from the organization by their user ID.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

User Id

The ID of the user.

Response Type

The response format expected from the API (e.g. application/json).

GET Lists all of the users in the organization.

/organization/users

Retrieve a list of all users currently in the organization.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Response Type

The response format expected from the API (e.g. application/json).

POST Modifies a user's role in the organization.

/organization/users/{user_id}

Change the role assigned to a specific user in the organization.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

User Id

The ID of the user.

Response Type

The response format expected from the API (e.g. application/json).

Options (1)

Option Name

Description

Role

owner or reader

GET Retrieves a user by their identifier.

/organization/users/{user_id}

Get details about a specific user using their unique identifier.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

User Id

The ID of the user.

Response Type

The response format expected from the API (e.g. application/json).

Vector stores (13)

POST Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.

/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel

Attempt to cancel processing of a file batch in a vector store as soon as possible.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Vector Store Id

The ID of the vector store that the file batch belongs to.

Batch Id

The ID of the file batch to cancel.

Response Type

The response format expected from the API (e.g. application/json).

POST Create a vector store file batch.

/vector_stores/{vector_store_id}/file_batches

Create a new batch of files to be processed and added to a vector store.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Vector Store Id

The ID of the vector store for which to create a File Batch.

Response Type

The response format expected from the API (e.g. application/json).

Options (1)

Option Name

Description

File Ids

A list of File IDs that the vector store should use. Useful for tools like file_search that can access files.

POST Create a vector store file by attaching a [File](/docs/api-reference/files) to a [vector store](/docs/api-reference/vector-stores/object).

/vector_stores/{vector_store_id}/files

Attach an existing File to a vector store, making its content searchable.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Vector Store Id

The ID of the vector store for which to create a File.

Response Type

The response format expected from the API (e.g. application/json).

Options (1)

Option Name

Description

File Id

A File ID that the vector store should use. Useful for tools like file_search that can access files.

POST Create a vector store.

/vector_stores

Create a new empty vector store for storing file embeddings.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Response Type

The response format expected from the API (e.g. application/json).

Options (3)

Option Name

Description

File Ids

A list of File IDs that the vector store should use. Useful for tools like file_search that can access files.

Name

The name of the vector store.

Metadata

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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

DELETE Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the [delete file](/docs/api-reference/files/delete) endpoint.

/vector_stores/{vector_store_id}/files/{file_id}

Remove a file from a vector store without deleting the original file.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Vector Store Id

The ID of the vector store that the file belongs to.

File Id

The ID of the file to delete.

Response Type

The response format expected from the API (e.g. application/json).

DELETE Delete a vector store.

/vector_stores/{vector_store_id}

Permanently delete a vector store and all its associated files.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Vector Store Id

The ID of the vector store to delete.

Response Type

The response format expected from the API (e.g. application/json).

POST Modifies a vector store.

/vector_stores/{vector_store_id}

Update the properties of an existing vector store, such as its name or metadata. Use this action when you need to change configuration details of a vector store.

Parameters

Parameter Name

Description

Content Type

The content type of the request payload sent to the API (e.g. application/json).

headers

Additional HTTP header name/value pairs to include in the request.

Vector Store Id

The ID of the vector store to modify.

Response Type

The response format expected from the API (e.g. application/json).

Options (2)

Option Name

Description

Name

The name of the vector store.

Metadata

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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

GET Retrieves a vector store file batch.

/vector_stores/{vector_store_id}/file_batches/{batch_id}

Get detailed information about a specific file batch operation within a vector store, including its status and file count. Use this action to monitor the progress of file processing.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Vector Store Id

The ID of the vector store that the file batch belongs to.

Batch Id

The ID of the file batch being retrieved.

Response Type

The response format expected from the API (e.g. application/json).

GET Retrieves a vector store file.

/vector_stores/{vector_store_id}/files/{file_id}

Fetch the details of a single file that has been attached to a vector store. Use this action to verify file attributes or check processing status.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Vector Store Id

The ID of the vector store that the file belongs to.

File Id

The ID of the file being retrieved.

Response Type

The response format expected from the API (e.g. application/json).

GET Retrieves a vector store.

/vector_stores/{vector_store_id}

Obtain the full details of a specific vector store, including its name, creation time, and usage statistics. Use this action to inspect a vector store's configuration and status.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Vector Store Id

The ID of the vector store to retrieve.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns a list of vector store files in a batch.

/vector_stores/{vector_store_id}/file_batches/{batch_id}/files

List all files that are part of a specific file batch within a vector store. Use this action to see which files were included in a batch operation.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Vector Store Id

The ID of the vector store that the files belong to.

Batch Id

The ID of the file batch that the files belong to.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Order

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Before

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

Filter

Filter by file status. One of in_progress, completed, failed, cancelled.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns a list of vector store files.

/vector_stores/{vector_store_id}/files

Retrieve a paginated list of all files that have been added to a vector store. Use this action to browse or search through the files in a vector store.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Vector Store Id

The ID of the vector store that the files belong to.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Order

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Before

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

Filter

Filter by file status. One of in_progress, completed, failed, cancelled.

Response Type

The response format expected from the API (e.g. application/json).

GET Returns a list of vector stores.

/vector_stores

Retrieve a paginated list of all vector stores in your OpenAI account. Use this action to browse existing vector stores or find a specific one by its properties.

Parameters

Parameter Name

Description

headers

Additional HTTP header name/value pairs to include in the request.

Limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Order

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

After

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Before

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

Response Type

The response format expected from the API (e.g. application/json).