Openaiconnector v1

Version 1

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

Assistants (23)

POST Cancels a run that is `in_progress`.

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Thread Id

The ID of the thread to which this run belongs.

Run Id

The ID of the run to cancel.

Response Type

N/A

POST Create a message.

/threads/{thread_id}/messages

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Thread Id

The ID of the thread to create a message for.

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Thread Id

The ID of the thread to delete.

Response Type

N/A

DELETE Delete an assistant.

/assistants/{assistant_id}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Assistant Id

The ID of the assistant to delete.

Response Type

N/A

DELETE Deletes a message.

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Thread Id

The ID of the thread to which this message belongs.

Message Id

The ID of the message to delete.

Response Type

N/A

POST Modifies a message.

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Thread Id

The ID of the thread to which this message belongs.

Message Id

The ID of the message to modify.

Response Type

N/A

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}

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Thread Id

The ID of the thread that was run.

Run Id

The ID of the run to modify.

Response Type

N/A

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}

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Thread Id

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

Response Type

N/A

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}

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Assistant Id

The ID of the assistant to modify.

Response Type

N/A

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}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Thread Id

The ID of the thread to which this message belongs.

Message Id

The ID of the message to retrieve.

Response Type

N/A

GET Retrieves a run step.

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Retrieves a run.

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Thread Id

The ID of the thread that was run.

Run Id

The ID of the run to retrieve.

Response Type

N/A

GET Retrieves a thread.

/threads/{thread_id}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Thread Id

The ID of the thread to retrieve.

Response Type

N/A

GET Retrieves an assistant.

/assistants/{assistant_id}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Assistant Id

The ID of the assistant to retrieve.

Response Type

N/A

GET Returns a list of assistants.

/assistants

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Returns a list of messages for a given thread.

/threads/{thread_id}/messages

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

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

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Returns a list of runs belonging to a thread.

/threads/{thread_id}/runs

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Batch Id

The ID of the batch to cancel.

Response Type

N/A

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

/batches

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Retrieves a batch.

/batches/{batch_id}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Batch Id

The ID of the batch to retrieve.

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

Options (1)

Option Name

Description

Name

N/A

DELETE Delete an organization admin API key

/organization/admin_api_keys/{key_id}

Delete the specified admin API key.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Key Id

The ID of the API key to be deleted.

Response Type

N/A

GET List organization API keys

/organization/admin_api_keys

Retrieve a paginated list of organization admin API keys.

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

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

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Key Id

The ID of the API key.

Response Type

N/A

Embeddings

POST Creates an embedding vector representing the input text.

/embeddings

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

File Id

The ID of the file to use for this request.

Response Type

N/A

GET Returns a list of files.

/files

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Returns information about a specific file.

/files/{file_id}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

File Id

The ID of the file to use for this request.

Response Type

N/A

GET Returns the contents of the specified file.

/files/{file_id}/content

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

File Id

The ID of the file to use for this request.

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Fine Tuning Job Id

The ID of the fine-tuning job.

Response Type

N/A

GET Get status updates for a fine-tuning job.

/fine_tuning/jobs/{fine_tuning_job_id}/events

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

POST Immediately cancel a fine-tune job.

/fine_tuning/jobs/{fine_tuning_job_id}/cancel

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Fine Tuning Job Id

The ID of the fine-tuning job to cancel.

Response Type

N/A

GET List checkpoints for a fine-tuning job.

/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET List your organization's fine-tuning jobs

/fine_tuning/jobs

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

After

Identifier for the last job from the previous pagination request.

Limit

Number of fine-tuning jobs to retrieve.

Response Type

N/A

Images (3)

POST Creates a variation of a given image.

/images/variations

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Invite Id

The ID of the invite to delete.

Response Type

N/A

GET Retrieves an invite.

/organization/invites/{invite_id}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Invite Id

The ID of the invite to retrieve.

Response Type

N/A

GET Returns a list of invites in the organization.

/organization/invites

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

Models (3)

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

/models/{model}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Model

The model to delete

Response Type

N/A

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

/models

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

/models/{model}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Model

The ID of the model to use for this request

Response Type

N/A

Moderations

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

/moderations

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Project Id

The ID of the project.

Response Type

N/A

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Project Id

The ID of the project.

Response Type

N/A

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

/organization/projects

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Project Id

The ID of the project.

Response Type

N/A

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}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Project Id

The ID of the project.

Service Account Id

The ID of the service account.

Response Type

N/A

DELETE Deletes a user from the project.

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Project Id

The ID of the project.

User Id

The ID of the user.

Response Type

N/A

DELETE Deletes an API key from the project.

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Project Id

The ID of the project.

Key Id

The ID of the API key.

Response Type

N/A

POST Modifies a project in the organization.

/organization/projects/{project_id}

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Project Id

The ID of the project.

Response Type

N/A

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}

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Project Id

The ID of the project.

User Id

The ID of the user.

Response Type

N/A

Options (1)

Option Name

Description

Role

owner or member

GET Retrieves a project.

/organization/projects/{project_id}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Project Id

The ID of the project.

Response Type

N/A

GET Retrieves a service account in the project.

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Project Id

The ID of the project.

Service Account Id

The ID of the service account.

Response Type

N/A

GET Retrieves a user in the project.

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Project Id

The ID of the project.

User Id

The ID of the user.

Response Type

N/A

GET Retrieves an API key in the project.

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Project Id

The ID of the project.

Key Id

The ID of the API key.

Response Type

N/A

GET Returns a list of API keys in the project.

/organization/projects/{project_id}/api_keys

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Returns a list of projects.

/organization/projects

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Returns a list of service accounts in the project.

/organization/projects/{project_id}/service_accounts

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Returns a list of users in the project.

/organization/projects/{project_id}/users

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Returns the rate limits per model for a project.

/organization/projects/{project_id}/rate_limits

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

POST Updates a project rate limit.

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Project Id

The ID of the project.

Rate Limit Id

The ID of the rate limit.

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Upload Id

The ID of the Upload.

Response Type

N/A

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Upload Id

The ID of the Upload.

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Upload Id

The ID of the Upload.

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Get audio transcriptions usage details for the organization.

/organization/usage/audio_transcriptions

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Get code interpreter sessions usage details for the organization.

/organization/usage/code_interpreter_sessions

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Get completions usage details for the organization.

/organization/usage/completions

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Get costs details for the organization.

/organization/costs

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Get embeddings usage details for the organization.

/organization/usage/embeddings

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Get images usage details for the organization.

/organization/usage/images

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Get moderations usage details for the organization.

/organization/usage/moderations

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Get vector stores usage details for the organization.

/organization/usage/vector_stores

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

Users (4)

DELETE Deletes a user from the organization.

/organization/users/{user_id}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

User Id

The ID of the user.

Response Type

N/A

GET Lists all of the users in the organization.

/organization/users

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

POST Modifies a user's role in the organization.

/organization/users/{user_id}

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

User Id

The ID of the user.

Response Type

N/A

Options (1)

Option Name

Description

Role

owner or reader

GET Retrieves a user by their identifier.

/organization/users/{user_id}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

User Id

The ID of the user.

Response Type

N/A

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

POST Create a vector store file batch.

/vector_stores/{vector_store_id}/file_batches

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Vector Store Id

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

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Vector Store Id

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

Response Type

N/A

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

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Response Type

N/A

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}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

DELETE Delete a vector store.

/vector_stores/{vector_store_id}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Vector Store Id

The ID of the vector store to delete.

Response Type

N/A

POST Modifies a vector store.

/vector_stores/{vector_store_id}

Parameters

Parameter Name

Description

Content Type

N/A

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Vector Store Id

The ID of the vector store to modify.

Response Type

N/A

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}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Retrieves a vector store file.

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Retrieves a vector store.

/vector_stores/{vector_store_id}

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

Vector Store Id

The ID of the vector store to retrieve.

Response Type

N/A

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

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

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Returns a list of vector store files.

/vector_stores/{vector_store_id}/files

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A

GET Returns a list of vector stores.

/vector_stores

Parameters

Parameter Name

Description

headers

N/A

headers.Header Key

N/A

headers.Header Value

N/A

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

N/A