OpenAI API (all endpoints)
The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
Endpoints 388
Assistants
- GETList assistants
/assistants?limit=20&order=desc&after=string&before=stringDeprecated. Returns a list of assistants. - POSTCreate assistant
/assistantsDeprecated. Create an assistant with a model and instructions. - GETRetrieve assistant
/assistants/:assistant_idDeprecated. Retrieves an assistant. - POSTModify assistant
/assistants/:assistant_idDeprecated. Modifies an assistant. - DELETEDelete assistant
/assistants/:assistant_idDeprecated. Delete an assistant. - POSTCreate thread
/threadsCreate a thread. - POSTCreate thread and run
/threads/runsCreate a thread and run it in one request. - GETRetrieve thread
/threads/:thread_idRetrieves a thread. - POSTModify thread
/threads/:thread_idModifies a thread. - DELETEDelete thread
/threads/:thread_idDelete a thread. - GETList messages
/threads/:thread_id/messages?limit=20&order=desc&after=string&before=string&run_id=stringReturns a list of messages for a given thread. - POSTCreate message
/threads/:thread_id/messagesCreate a message. - GETRetrieve message
/threads/:thread_id/messages/:message_idRetrieve a message. - POSTModify message
/threads/:thread_id/messages/:message_idModifies a message. - DELETEDelete message
/threads/:thread_id/messages/:message_idDeletes a message. - GETList runs
/threads/:thread_id/runs?limit=20&order=desc&after=string&before=stringReturns a list of runs belonging to a thread. - POSTCreate run
/threads/:thread_id/runs?include[]=step_details.tool_calls[*].file_search.results[*].contentCreate a run. - GETRetrieve run
/threads/:thread_id/runs/:run_idRetrieves a run. - POSTModify run
/threads/:thread_id/runs/:run_idModifies a run. - POSTCancel a run
/threads/:thread_id/runs/:run_id/cancelCancels a run that is in_progress. - GETList run steps
/threads/:thread_id/runs/:run_id/steps?limit=20&order=desc&after=string&before=string&include[]=step_details.tool_calls[*].file_search.results[*].contentReturns a list of run steps belonging to a run. - GETRetrieve run step
/threads/:thread_id/runs/:run_id/steps/:step_id?include[]=step_details.tool_calls[*].file_search.results[*].contentRetrieves a run step. - POSTSubmit tool outputs to run
/threads/:thread_id/runs/:run_id/submit_tool_outputsWhen 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…
Audio
- POSTCreate speech
/audio/speechGenerates audio from the input text. Returns the audio file content, or a stream of audio events. The tts-1, tts-1-hd, gpt-4o-mini-tts,… - POSTCreate transcription
/audio/transcriptionsTranscribes audio into the input language. Returns a transcription object in json, diarized_json, or verbose_json format, plain text in text, srt, or vtt… - POSTCreate translation
/audio/translationsDeprecated. Translates audio into English. This endpoint supports only whisper-1. The endpoint and model are deprecated and scheduled to shut down on February… - GETList voice consents
/audio/voice_consents?after=string&limit=20Returns a list of voice consent recordings. - POSTCreate voice consent
/audio/voice_consentsUpload a voice consent recording. - GETRetrieve voice consent
/audio/voice_consents/:consent_idRetrieves a voice consent recording. - POSTUpdate voice consent
/audio/voice_consents/:consent_idUpdates a voice consent recording (metadata only). - DELETEDelete voice consent
/audio/voice_consents/:consent_idDeletes a voice consent recording. - POSTCreate voice
/audio/voicesCreates a voice from a text prompt or from a consent recording and an audio sample. For prompt-based creation, send type: "prompt" with a name and prompt as… - DELETEDelete voice
/audio/voices/:voice_idDeletes a voice created from a text prompt or an audio sample. Requires voice write permission and access to the voice's project. Access to voices created…
Chat
- GETList Chat Completions
/chat/completions?model=string&metadata={"additionalProp1":"string"}&after=string&limit=20&order=ascList stored Chat Completions. Only Chat Completions that have been stored with the store parameter set to true will be returned. - POSTCreate chat completion
/chat/completionsStarting a new project? We recommend trying Responses to take advantage of the latest OpenAI platform features. Compare Chat Completions with Responses.… - GETGet chat completion
/chat/completions/:completion_idGet a stored chat completion. Only Chat Completions that have been created with the store parameter set to true will be returned. - POSTUpdate chat completion
/chat/completions/:completion_idModify a stored chat completion. Only Chat Completions that have been created with the store parameter set to true can be modified. Currently, the only… - DELETEDelete chat completion
/chat/completions/:completion_idDelete a stored chat completion. Only Chat Completions that have been created with the store parameter set to true can be deleted. - GETGet chat messages
/chat/completions/:completion_id/messages?after=string&limit=20&order=ascGet the messages in a stored chat completion. Only Chat Completions that have been created with the store parameter set to true will be returned.
Conversations
- GETList items
/conversations/:conversation_id/items?limit=20&order=asc&after=string&include=file_search_call.resultsList all items for a conversation with the given ID. - POSTCreate items
/conversations/:conversation_id/items?include=file_search_call.resultsCreate items in a conversation with the given ID. - GETRetrieve an item
/conversations/:conversation_id/items/:item_id?include=file_search_call.resultsGet a single item from a conversation with the given IDs. - DELETEDelete an item
/conversations/:conversation_id/items/:item_idDelete an item from a conversation with the given IDs. - POSTCreate a conversation
/conversationsCreate a conversation. - GETRetrieve a conversation
/conversations/:conversation_idGet a conversation - POSTUpdate a conversation
/conversations/:conversation_idUpdate a conversation - DELETEDelete a conversation
/conversations/:conversation_idDelete a conversation. Items in the conversation will not be deleted.
Completions
- POSTCreate completion
/completionsCreates a completion for the provided prompt and parameters. Returns a completion object, or a sequence of completion objects if the request is streamed.
Embeddings
- POSTCreate embeddings
/embeddingsCreates an embedding vector representing the input text.
Evals
- GETList evals
/evals?after=string&limit=20&order=asc&order_by=created_atList evaluations for a project. - POSTCreate eval
/evalsCreate the structure of an evaluation that can be used to test a model's performance. An evaluation is a set of testing criteria and the config for a data… - GETGet an eval
/evals/:eval_idGet an evaluation by ID. - POSTUpdate an eval
/evals/:eval_idUpdate certain properties of an evaluation. - DELETEDelete an eval
/evals/:eval_idDelete an evaluation. - GETGet eval runs
/evals/:eval_id/runs?after=string&limit=20&order=asc&status=queuedGet a list of runs for an evaluation. - POSTCreate eval run
/evals/:eval_id/runsKicks off a new run for a given evaluation, specifying the data source, and what model configuration to use to test. The datasource will be validated against… - GETGet an eval run
/evals/:eval_id/runs/:run_idGet an evaluation run by ID. - DELETEDelete eval run
/evals/:eval_id/runs/:run_idDelete an eval run. - POSTCancel eval run
/evals/:eval_id/runs/:run_id/cancelCancel an ongoing evaluation run. - GETGet eval run output items
/evals/:eval_id/runs/:run_id/output_items?after=string&limit=20&status=fail&order=ascGet a list of output items for an evaluation run. - GETGet an output item of an eval run
/evals/:eval_id/runs/:run_id/output_items/:output_item_idGet an evaluation run output item by ID.
Fine-tuning
- POSTRun grader
/fine_tuning/alpha/graders/runRun a grader. - POSTValidate grader
/fine_tuning/alpha/graders/validateValidate a grader. - GETList checkpoint permissions
/fine_tuning/checkpoints/:fine_tuned_model_checkpoint/permissions?project_id=string&after=string&limit=10&order=descendingNOTE: This endpoint requires an admin API key. Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint. - POSTCreate checkpoint permissions
/fine_tuning/checkpoints/:fine_tuned_model_checkpoint/permissionsNOTE: Calling this endpoint requires an admin API key. This enables organization owners to share fine-tuned models with other projects in their organization. - DELETEDelete checkpoint permission
/fine_tuning/checkpoints/:fine_tuned_model_checkpoint/permissions/:permission_idNOTE: This endpoint requires an admin API key. Organization owners can use this endpoint to delete a permission for a fine-tuned model checkpoint. - GETList fine-tuning jobs
/fine_tuning/jobs?after=string&limit=20&metadata={"additionalProp1":"string"}List your organization's fine-tuning jobs - POSTCreate fine-tuning job
/fine_tuning/jobsCreates 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… - GETRetrieve fine-tuning job
/fine_tuning/jobs/:fine_tuning_job_idGet info about a fine-tuning job. Learn more about fine-tuning - POSTCancel fine-tuning
/fine_tuning/jobs/:fine_tuning_job_id/cancelImmediately cancel a fine-tune job. - GETList fine-tuning checkpoints
/fine_tuning/jobs/:fine_tuning_job_id/checkpoints?after=string&limit=10List checkpoints for a fine-tuning job. - GETList fine-tuning events
/fine_tuning/jobs/:fine_tuning_job_id/events?after=string&limit=20Get status updates for a fine-tuning job. - POSTPause fine-tuning
/fine_tuning/jobs/:fine_tuning_job_id/pausePause a fine-tune job. - POSTResume fine-tuning
/fine_tuning/jobs/:fine_tuning_job_id/resumeResume a fine-tune job.
Batch
- GETList batches
/batches?after=string&limit=20List your organization's batches. - POSTCreate batch
/batchesCreates and executes a batch from an uploaded file of requests - GETRetrieve batch
/batches/:batch_idRetrieves a batch. - POSTCancel batch
/batches/:batch_id/cancelCancels 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…
Files
- GETList files
/files?purpose=string&limit=10000&order=desc&after=stringReturns a list of files. - POSTUpload file
/filesUpload a file that can be used across various endpoints. Individual files can be up to 512 MB, and each project can store up to 2.5 TB of files in total.… - GETRetrieve file
/files/:file_idReturns information about a specific file. - DELETEDelete file
/files/:file_idDelete a file and remove it from all vector stores. - GETRetrieve file content
/files/:file_id/contentReturns a response containing the contents of the specified file.
Uploads
- POSTCreate upload
/uploadsCreates an intermediate Upload object that you can add Parts to. Currently, an Upload can accept at most 8 GB in total and expires after an hour after you… - POSTCancel upload
/uploads/:upload_id/cancelCancels the Upload. No Parts may be added after an Upload is cancelled. Returns the Upload object with status cancelled. - POSTComplete upload
/uploads/:upload_id/completeCompletes the Upload. Within the returned Upload object, there is a nested File object that is ready to use in the rest of the platform. You can specify the… - POSTAdd upload part
/uploads/:upload_id/partsAdds a Part to an Upload 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…
Images
- POSTCreate image edit
/images/editsCreates an edited or extended image given one or more source images and a prompt. This endpoint supports GPT Image models. - POSTCreate image
/images/generationsCreates an image given a prompt using a GPT Image model. Learn more. - POSTCreate image variation
/images/variationsDeprecated. This endpoint is retired and no longer available. Use the image edits endpoint with a GPT Image model and a prompt to create a variation of an…
Models
- GETList models
/modelsLists the currently available models, and provides basic information about each one such as the owner and availability. - GETRetrieve model
/models/:modelRetrieves a model instance, providing basic information about the model such as the owner and permissioning. - DELETEDelete a fine-tuned model
/models/:modelDelete a fine-tuned model. You must have the Owner role in your organization to delete a model.
Moderations
- POSTCreate moderation
/moderationsClassifies if text and/or image inputs are potentially harmful. Learn more in the moderation guide.
Responses
- POSTCreate a model response
/responsesCreates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like… - GETGet a model response
/responses/:response_id?include=file_search_call.results&stream=true&starting_after=0&include_obfuscation=trueRetrieves a model response with the given ID. - DELETEDelete a model response
/responses/:response_idDeletes a model response with the given ID. - POSTCancel a response
/responses/:response_id/cancelCancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled. Learn more. - GETList input items
/responses/:response_id/input_items?limit=20&order=asc&after=string&include=file_search_call.resultsReturns a list of input items for a given response. - POSTGet input token counts
/responses/input_tokensReturns input token counts of the request. Returns an object with object set to response.input_tokens and an input_tokens count. - POSTCompact conversation
/responses/compactCompact a conversation. Returns a compacted response object. Learn when and how to compact long-running conversations in the conversation state guide. For… - POSTCreate a model response
/responses?beta=trueCreates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like… - GETGet a model response
/responses/:response_id?beta=true?include=file_search_call.results&stream=true&starting_after=0&include_obfuscation=trueRetrieves a model response with the given ID. - DELETEDelete a model response
/responses/:response_id?beta=trueDeletes a model response with the given ID. - POSTCancel a response
/responses/:response_id/cancel?beta=trueCancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled. Learn more. - POSTCompact conversation
/responses/compact?beta=trueCompact a conversation. Returns a compacted response object. Learn when and how to compact long-running conversations in the conversation state guide. For… - GETList input items
/responses/:response_id/input_items?beta=true?limit=20&order=asc&after=string&include=file_search_call.resultsReturns a list of input items for a given response. - POSTGet input token counts
/responses/input_tokens?beta=trueReturns input token counts of the request. Returns an object with object set to response.input_tokens and an input_tokens count.
Audit Logs
- GETList audit logs
/organization/audit_logs?effective_at={"gt":0,"gte":0,"lt":0,"lte":0}&project_ids[]=string&event_types[]=api_key.created&actor_ids[]=string&actor_emails[]=string&resource_ids[]=string&tenant_only=false&limit=20&after=string&before=stringList user actions and configuration changes within this organization.
Live
- POSTCreate session
/live/sessionsCreate a Live WebRTC session or place an outbound SIP call. Start with the Live prompting guide for session configuration and Telephony and SIP for trunk… - POSTAccept call
/live/sessions/:session_id/acceptAccept an incoming SIP call. Supply session with type live, the model, and startup configuration. Before accepting calls, follow the Live prompting guide to… - POSTFork session
/live/sessions/:session_id/forkFork a stored Live session onto a new WebRTC connection. - POSTHang up session
/live/sessions/:session_id/hangupEnd a SIP call identified by session_id. - POSTTransfer call
/live/sessions/:session_id/referTransfer a SIP call to another destination. Supply a nonblank target_uri for the SIP Refer-To header. - POSTReject call
/live/sessions/:session_id/rejectReject an incoming SIP call. Send a required SIP rejection status_code between 300 and 699. - GETDownload recording
/live/sessions/:session_id/contentGet Live session content
Certificates
- GETList organization certificates
/organization/certificates?limit=20&after=string&order=descList uploaded certificates for this organization. - POSTUpload certificate
/organization/certificatesUpload a certificate to the organization. This does not automatically activate the certificate. Organizations can upload up to 50 certificates. - POSTActivate certificates for organization
/organization/certificates/activateActivate certificates at the organization level. You can atomically and idempotently activate up to 10 certificates at a time. - POSTDeactivate certificates for organization
/organization/certificates/deactivateDeactivate certificates at the organization level. You can atomically and idempotently deactivate up to 10 certificates at a time. - GETGet certificate
/organization/certificates/:certificate_id?include=contentGet a certificate that has been uploaded to the organization. You can get a certificate regardless of whether it is active or not. - POSTModify certificate
/organization/certificates/:certificate_idModify a certificate. Note that only the name can be modified. - DELETEDelete certificate
/organization/certificates/:certificate_idDelete a certificate from the organization. The certificate must be inactive for the organization and all projects. - GETList project certificates
/organization/projects/:project_id/certificates?limit=20&after=string&order=descList certificates for this project. - POSTActivate certificates for project
/organization/projects/:project_id/certificates/activateActivate certificates at the project level. You can atomically and idempotently activate up to 10 certificates at a time. - POSTDeactivate certificates for project
/organization/projects/:project_id/certificates/deactivateDeactivate certificates at the project level. You can atomically and idempotently deactivate up to 10 certificates at a time.
Usage
- GETCosts
/organization/costs?start_time=0&end_time=0&bucket_width=1d&project_ids=string&api_key_ids=string&line_items=string&group_by=project_id&limit=7&page=stringGet costs details for the organization. - GETAudio speeches
/organization/usage/audio_speeches?start_time=0&end_time=0&bucket_width=1d&project_ids=string&user_ids=string&api_key_ids=string&models=string&group_by=project_id&limit=0&page=stringGet audio speeches usage details for the organization. - GETAudio transcriptions
/organization/usage/audio_transcriptions?start_time=0&end_time=0&bucket_width=1d&project_ids=string&user_ids=string&api_key_ids=string&models=string&group_by=project_id&limit=0&page=stringGet audio transcriptions usage details for the organization. - GETCode interpreter sessions
/organization/usage/code_interpreter_sessions?start_time=0&end_time=0&bucket_width=1d&project_ids=string&group_by=project_id&limit=0&page=stringGet code interpreter sessions usage details for the organization. - GETCompletions
/organization/usage/completions?start_time=0&end_time=0&bucket_width=1d&project_ids=string&user_ids=string&api_key_ids=string&models=string&batch=true&group_by=project_id&limit=0&page=stringGet completions usage details for the organization. - GETEmbeddings
/organization/usage/embeddings?start_time=0&end_time=0&bucket_width=1d&project_ids=string&user_ids=string&api_key_ids=string&models=string&group_by=project_id&limit=0&page=stringGet embeddings usage details for the organization. - GETFile search calls
/organization/usage/file_search_calls?start_time=0&end_time=0&bucket_width=1d&project_ids=string&user_ids=string&api_key_ids=string&vector_store_ids=string&group_by=project_id&limit=0&page=stringGet file search calls usage details for the organization. - GETImages
/organization/usage/images?start_time=0&end_time=0&bucket_width=1d&sources=image.generation&sizes=256x256&project_ids=string&user_ids=string&api_key_ids=string&models=string&group_by=project_id&limit=0&page=stringGet images usage details for the organization. - GETModerations
/organization/usage/moderations?start_time=0&end_time=0&bucket_width=1d&project_ids=string&user_ids=string&api_key_ids=string&models=string&group_by=project_id&limit=0&page=stringGet moderations usage details for the organization. - GETVector stores
/organization/usage/vector_stores?start_time=0&end_time=0&bucket_width=1d&project_ids=string&group_by=project_id&limit=0&page=stringGet vector stores usage details for the organization. - GETWeb search calls
/organization/usage/web_search_calls?start_time=0&end_time=0&bucket_width=1d&project_ids=string&user_ids=string&api_key_ids=string&models=string&context_levels=low&group_by=project_id&limit=0&page=stringGet web search calls usage details for the organization.
Data retention
- GETRetrieve organization data retention
/organization/data_retentionRetrieves organization data retention controls. - POSTUpdate organization data retention
/organization/data_retentionUpdates organization data retention controls. - GETRetrieve project data retention
/organization/projects/:project_id/data_retentionRetrieves project data retention controls. - POSTUpdate project data retention
/organization/projects/:project_id/data_retentionUpdates project data retention controls.
Groups
- GETList groups
/organization/groups?limit=100&after=string&order=ascLists all groups in the organization. - POSTCreate group
/organization/groupsCreates a new group in the organization. - GETRetrieve group
/organization/groups/:group_idRetrieves a group. - POSTUpdate group
/organization/groups/:group_idUpdates a group's information. - DELETEDelete group
/organization/groups/:group_idDeletes a group from the organization.
Group organization role assignments
- GETList group organization role assignments
/organization/groups/:group_id/roles?limit=0&after=string&order=ascLists the organization roles assigned to a group within the organization. - POSTAssign organization role to group
/organization/groups/:group_id/rolesAssigns an organization role to a group within the organization. - GETRetrieve group organization role
/organization/groups/:group_id/roles/:role_idRetrieves an organization role assigned to a group. - DELETEUnassign organization role from group
/organization/groups/:group_id/roles/:role_idUnassigns an organization role from a group within the organization.
Group users
- GETList group users
/organization/groups/:group_id/users?limit=100&after=string&order=descLists the users assigned to a group. - POSTAdd group user
/organization/groups/:group_id/usersAdds a user to a group. - GETRetrieve group user
/organization/groups/:group_id/users/:user_idRetrieves a user in a group. - DELETERemove group user
/organization/groups/:group_id/users/:user_idRemoves a user from a group.
Invites
- GETList invites
/organization/invites?limit=20&after=stringReturns a list of invites in the organization. - POSTCreate invite
/organization/invitesCreate an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization. - GETRetrieve invite
/organization/invites/:invite_idRetrieves an invite. - DELETEDelete invite
/organization/invites/:invite_idDelete an invite. If the invite has already been accepted, it cannot be deleted.
Projects
- GETList projects
/organization/projects?limit=20&after=string&include_archived=falseReturns a list of projects. - POSTCreate project
/organization/projectsCreate a new project in the organization. Projects can be created and archived, but cannot be deleted. - GETRetrieve project
/organization/projects/:project_idRetrieves a project. - POSTModify project
/organization/projects/:project_idModifies a project in the organization. - GETList project API keys
/organization/projects/:project_id/api_keys?limit=20&after=string&owner_project_access=activeReturns a list of API keys in the project. - GETRetrieve project API key
/organization/projects/:project_id/api_keys/:api_key_idRetrieves an API key in the project. - POSTUpdate project API key
/organization/projects/:project_id/api_keys/:api_key_idUpdates the scopes and/or expiration of an existing API key in the project, including a service-account-owned key. Requires permission to write project API… - DELETEDelete project API key
/organization/projects/:project_id/api_keys/:api_key_idDeletes an API key from the project, including keys owned by service accounts. Requires permission to write project API keys. Deleting a service-account key… - POSTArchive project
/organization/projects/:project_id/archiveArchives a project in the organization. Archived projects cannot be used or updated. - GETRetrieve project model permissions
/organization/projects/:project_id/model_permissionsReturns model permissions for a project. - POSTModify project model permissions
/organization/projects/:project_id/model_permissionsUpdates model permissions for a project. - DELETEDelete project model permissions
/organization/projects/:project_id/model_permissionsDeletes model permissions for a project. - GETList project rate limits
/organization/projects/:project_id/rate_limits?limit=100&after=string&before=stringReturns the rate limits per model for a project. - POSTModify project rate limit
/organization/projects/:project_id/rate_limits/:rate_limit_idUpdates a project rate limit. - GETList project service accounts
/organization/projects/:project_id/service_accounts?limit=20&after=stringReturns a list of service accounts in the project. - POSTCreate project service account
/organization/projects/:project_id/service_accountsCreates a new service account in the project. By default, this also returns an unredacted API key for the service account. - GETRetrieve project service account
/organization/projects/:project_id/service_accounts/:service_account_idRetrieves a service account in the project. - POSTUpdate project service account
/organization/projects/:project_id/service_accounts/:service_account_idUpdates a service account in the project. - DELETEDelete project service account
/organization/projects/:project_id/service_accounts/:service_account_idDeletes a service account from the project. Returns confirmation of service account deletion, or an error if the project is archived (archived projects have… - GETList project users
/organization/projects/:project_id/users?limit=20&after=stringReturns a list of users in the project. - POSTCreate project user
/organization/projects/:project_id/usersAdds a user to the project. Users must already be members of the organization to be added to a project. - GETRetrieve project user
/organization/projects/:project_id/users/:user_idRetrieves a user in the project. - POSTModify project user
/organization/projects/:project_id/users/:user_idModifies a user's role in the project. - DELETEDelete project user
/organization/projects/:project_id/users/:user_idDeletes a user from the project. Returns confirmation of project user deletion, or an error if the project is archived (archived projects have no users).
Project groups
- GETList project groups
/organization/projects/:project_id/groups?limit=20&after=string&order=ascLists the groups that have access to a project. - POSTAdd project group
/organization/projects/:project_id/groupsGrants a group access to a project. - GETRetrieve project group
/organization/projects/:project_id/groups/:group_id?group_type=groupRetrieves a project's group. - DELETERemove project group
/organization/projects/:project_id/groups/:group_idRevokes a group's access to a project.
Hosted tools
- GETRetrieve project hosted tool permissions
/organization/projects/:project_id/hosted_tool_permissionsReturns hosted tool permissions for a project. - POSTModify project hosted tool permissions
/organization/projects/:project_id/hosted_tool_permissionsUpdates hosted tool permissions for a project.
Spend alerts
- GETList project spend alerts
/organization/projects/:project_id/spend_alerts?limit=0&order=asc&after=string&before=stringLists project spend alerts. - POSTCreate project spend alert
/organization/projects/:project_id/spend_alertsCreates a project spend alert. - GETRetrieve project spend alert
/organization/projects/:project_id/spend_alerts/:alert_idRetrieves a project spend alert. - POSTUpdate project spend alert
/organization/projects/:project_id/spend_alerts/:alert_idUpdates a project spend alert. - DELETEDelete project spend alert
/organization/projects/:project_id/spend_alerts/:alert_idDeletes a project spend alert. - GETList organization spend alerts
/organization/spend_alerts?limit=0&order=asc&after=string&before=stringLists organization spend alerts. - POSTCreate organization spend alert
/organization/spend_alertsCreates an organization spend alert. - GETRetrieve organization spend alert
/organization/spend_alerts/:alert_idRetrieves an organization spend alert. - POSTUpdate organization spend alert
/organization/spend_alerts/:alert_idUpdates an organization spend alert. - DELETEDelete organization spend alert
/organization/spend_alerts/:alert_idDeletes an organization spend alert.
Roles
- GETList organization roles
/organization/roles?limit=1000&after=string&order=ascLists the roles configured for the organization. - POSTCreate organization role
/organization/rolesCreates a custom role for the organization. - GETRetrieve organization role
/organization/roles/:role_idRetrieves an organization role. - POSTUpdate organization role
/organization/roles/:role_idUpdates an existing organization role. - DELETEDelete organization role
/organization/roles/:role_idDeletes a custom role from the organization. - GETList project roles
/projects/:project_id/roles?limit=1000&after=string&order=ascLists the roles configured for a project. - POSTCreate project role
/projects/:project_id/rolesCreates a custom role for a project. - GETRetrieve project role
/projects/:project_id/roles/:role_idRetrieves a project role. - POSTUpdate project role
/projects/:project_id/roles/:role_idUpdates an existing project role. - DELETEDelete project role
/projects/:project_id/roles/:role_idDeletes a custom role from a project.
Users
- GETList users
/organization/users?limit=20&after=string&emails=stringLists all of the users in the organization. - GETRetrieve user
/organization/users/:user_idRetrieves a user by their identifier. - POSTModify user
/organization/users/:user_idModifies a user's role in the organization. - DELETEDelete user
/organization/users/:user_idDeletes a user from the organization.
User organization role assignments
- GETList user organization role assignments
/organization/users/:user_id/roles?limit=0&after=string&order=ascLists the organization roles assigned to a user within the organization. - POSTAssign organization role to user
/organization/users/:user_id/rolesAssigns an organization role to a user within the organization. - GETRetrieve user organization role
/organization/users/:user_id/roles/:role_idRetrieves an organization role assigned to a user. - DELETEUnassign organization role from user
/organization/users/:user_id/roles/:role_idUnassigns an organization role from a user within the organization.
Project group role assignments
- GETList project group role assignments
/projects/:project_id/groups/:group_id/roles?limit=0&after=string&order=ascLists the project roles assigned to a group within a project. - POSTAssign project role to group
/projects/:project_id/groups/:group_id/rolesAssigns a project role to a group within a project. - GETRetrieve project group role
/projects/:project_id/groups/:group_id/roles/:role_idRetrieves a project role assigned to a group. - DELETEUnassign project role from group
/projects/:project_id/groups/:group_id/roles/:role_idUnassigns a project role from a group within a project.
Project user role assignments
- GETList project user role assignments
/projects/:project_id/users/:user_id/roles?limit=0&after=string&order=ascLists the project roles assigned to a user within a project. - POSTAssign project role to user
/projects/:project_id/users/:user_id/rolesAssigns a project role to a user within a project. - GETRetrieve project user role
/projects/:project_id/users/:user_id/roles/:role_idRetrieves a project role assigned to a user. - DELETEUnassign project role from user
/projects/:project_id/users/:user_id/roles/:role_idUnassigns a project role from a user within a project.
Realtime
- POSTCreate call
/realtime/callsCreate a new Realtime API call over WebRTC and receive the SDP answer needed to complete the peer connection. - POSTAccept call
/realtime/calls/:call_id/acceptAccept an incoming SIP call and configure the realtime session that will handle it. - POSTHang up call
/realtime/calls/:call_id/hangupEnd an active Realtime API call, whether it was initiated over SIP or WebRTC. - POSTRefer call
/realtime/calls/:call_id/referTransfer an active SIP call to a new destination using the SIP REFER verb. - POSTReject call
/realtime/calls/:call_id/rejectDecline an incoming SIP call by returning a SIP status code to the caller. - POSTCreate client secret
/realtime/client_secretsCreate a Realtime client secret with an associated session configuration. Client secrets are short-lived tokens that can be passed to a client app, such as a… - POSTCreate session
/realtime/sessionsCreate an ephemeral API token for use in client-side applications with the Realtime API. Can be configured with the same session parameters as the… - POSTCreate transcription session
/realtime/transcription_sessionsCreate an ephemeral API token for use in client-side applications with the Realtime API specifically for realtime transcriptions. Can be configured with the… - POSTCreate translation client secret
/realtime/translations/client_secretsCreate a Realtime translation client secret with an associated translation session configuration. Client secrets are short-lived tokens that can be passed to…
Vector stores
- GETList vector stores
/vector_stores?limit=20&order=desc&after=string&before=stringReturns a list of vector stores. - POSTCreate vector store
/vector_storesCreate a vector store. - GETRetrieve vector store
/vector_stores/:vector_store_idRetrieves a vector store. - POSTModify vector store
/vector_stores/:vector_store_idModifies a vector store. - DELETEDelete vector store
/vector_stores/:vector_store_idDelete a vector store. - POSTCreate vector store file batch
/vector_stores/:vector_store_id/file_batchesCreate a vector store file batch. - GETRetrieve vector store file batch
/vector_stores/:vector_store_id/file_batches/:batch_idRetrieves a vector store file batch. - POSTCancel vector store file batch
/vector_stores/:vector_store_id/file_batches/:batch_id/cancelCancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. - GETList vector store files in a batch
/vector_stores/:vector_store_id/file_batches/:batch_id/files?limit=20&order=desc&after=string&before=string&filter=in_progressReturns a list of vector store files in a batch. - GETList vector store files
/vector_stores/:vector_store_id/files?limit=20&order=desc&after=string&before=string&filter=in_progressReturns a list of vector store files. - POSTCreate vector store file
/vector_stores/:vector_store_id/filesCreate a vector store file by attaching a File to a vector store. - GETRetrieve vector store file
/vector_stores/:vector_store_id/files/:file_idRetrieves a vector store file. - POSTUpdate vector store file attributes
/vector_stores/:vector_store_id/files/:file_idUpdate attributes on a vector store file. - DELETEDelete vector store file
/vector_stores/:vector_store_id/files/:file_idDelete 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… - GETRetrieve vector store file content
/vector_stores/:vector_store_id/files/:file_id/contentRetrieve the parsed contents of a vector store file. - POSTSearch vector store
/vector_stores/:vector_store_id/searchSearch a vector store for relevant chunks based on a query and file attributes filter.
Videos
- GETList videos
/videos?limit=0&order=asc&after=stringDeprecated. List recently generated videos for the current project. - POSTCreate a video
/videosDeprecated. Create a new video generation job from a prompt and optional reference assets. - POSTCreate a character
/videos/charactersDeprecated. Create a character from an uploaded video. - GETRetrieve a character
/videos/characters/:character_idDeprecated. Fetch a character. - POSTCreate a video edit
/videos/editsDeprecated. Create a new video generation job by editing a source video or existing generated video. - POSTCreate a video extension
/videos/extensionsDeprecated. Create an extension of a completed video. - GETRetrieve a video
/videos/:video_idDeprecated. Fetch the latest metadata for a generated video. - DELETEDelete a video
/videos/:video_idDeprecated. Permanently delete a completed or failed video and its stored assets. - GETDownload video content
/videos/:video_id/content?variant=videoDeprecated. Download the generated video bytes or a derived preview asset. Streams the rendered video content for the specified video job. - POSTCreate a video remix
/videos/:video_id/remixDeprecated. Create a remix of a completed video using a refreshed prompt.
Skills
- GETList Skills
/skills?limit=0&order=asc&after=stringList all skills for the current project. - POSTCreate Skill
/skillsCreate a new skill. - GETGet Skill
/skills/:skill_idGet a skill by its ID. - POSTUpdate Skill Default Version
/skills/:skill_idUpdate the default version pointer for a skill. - DELETEDelete Skill
/skills/:skill_idDelete a skill by its ID. - GETGet Skill Content
/skills/:skill_id/contentDownload a skill zip bundle by its ID. - GETList Skill Versions
/skills/:skill_id/versions?limit=0&order=asc&after=skillver_123List skill versions for a skill. - POSTCreate Skill Version
/skills/:skill_id/versionsCreate a new immutable skill version. - GETGet Skill Version
/skills/:skill_id/versions/:versionGet a specific skill version. - DELETEDelete Skill Version
/skills/:skill_id/versions/:versionDelete a skill version. - GETGet Skill Version Content
/skills/:skill_id/versions/:version/contentDownload a skill version zip bundle.
Decisions
- POSTCreate a decision
/decisionsUse this endpoint to quickly answer classification or scoring questions about some input. You can ask multiple questions in one request.
Agents
- GETList automations
/agents/automations?limit=20&order=asc&after=string&session_id=stringLists project-owned automations, optionally filtered by target session. - POSTCreate an automation
/agents/automationsSaves an active automation without invoking it immediately. - GETGet an automation
/agents/automations/:automation_idRetrieves a project-owned automation. - POSTUpdate an automation
/agents/automations/:automation_idUpdates supplied fields; target and metadata replace the whole field. - DELETEDelete an automation
/agents/automations/:automation_idDeletes the automation and prevents future invocations without deleting its target session. - POSTPause an automation
/agents/automations/:automation_id/pausePauses future scheduled delivery without stopping an active session. - POSTResume an automation
/agents/automations/:automation_id/resumeResumes scheduled delivery; one-time automations without a pending invocation require a future run_at. - GETList automation invocations
/agents/automations/:automation_id/invocations?limit=20&order=asc&after=stringLists delivery records for a project-owned automation. - POSTInvoke an automation
/agents/automations/:automation_id/invocationsQueues a manual delivery without changing the saved schedule. - GETGet an automation invocation
/agents/automations/:automation_id/invocations/:invocation_idRetrieves a delivery record for a project-owned automation. - GETList agent environments
/agents/environments?limit=20&order=asc&after=string&type=openai_hostedLists OpenAI-hosted environments owned by the authenticated principal. Requires access to the prewarming beta. - POSTCreate an agent environment
/agents/environmentsCreates an OpenAI-hosted environment before creating a session. Requires access to the prewarming beta. - GETRetrieve an agent environment
/agents/environments/:environment_idRetrieves an execution environment's connection status and safe installed metadata. See environment lifecycle. - GETList agent environment files
/agents/environments/:environment_id/files?path=string&limit=1&order=asc&page=stringLists live files on a connected execution environment with optional directory filtering and opaque cursor pagination. See environment files. - POSTWrite an agent environment file
/agents/environments/:environment_id/filesCopies inline bytes or a Files API file into a connected execution environment, replacing an existing regular file at the same path. Upload between turns and… - GETList session subagents
/agents/sessions/:session_id/subagents?limit=20&order=asc&after=stringLists subagents in a session, including nested and closed subagents. See subagent workflows. - GETRetrieve a session subagent
/agents/sessions/:session_id/subagents/:subagent_idRetrieves a subagent belonging to this session. See subagent workflows. - GETList subagent items
/agents/sessions/:session_id/subagents/:subagent_id/items?limit=20&order=asc&after=stringLists this subagent's own items across all of its turns. See subagent workflows. - GETList subagent turns
/agents/sessions/:session_id/subagents/:subagent_id/turns?limit=20&order=asc&after=stringLists all turns of this subagent, including turns after a resume. See subagent workflows. - GETRetrieve a subagent turn
/agents/sessions/:session_id/subagents/:subagent_id/turns/:turn_idRetrieves a turn belonging to this subagent. See subagent workflows. - GETList subagent turn items
/agents/sessions/:session_id/subagents/:subagent_id/turns/:turn_id/items?limit=20&order=asc&after=stringLists items belonging to one turn of this subagent. See subagent workflows. - GETList agents
/agents?limit=20&order=asc&after=stringLists reusable agents in the current project. See agent configuration. - POSTCreate an agent
/agentsCreates a reusable agent without storing credentials. See agent configuration. - GETRetrieve an agent
/agents/:agent_idRetrieves a reusable agent by ID. See agent configuration. - POSTUpdate an agent
/agents/:agent_idUpdates a reusable agent. See agent configuration. - DELETEDelete an agent
/agents/:agent_idDeletes a reusable agent. See agent configuration. - GETList agent environment templates
/agents/environments/templates?limit=20&order=asc&after=stringLists reusable environment templates without returning confidential values. See reusing a hosted setup. - POSTCreate an agent environment template
/agents/environments/templatesCreates reusable environment configuration without returning confidential setup commands or environment values. See reusing a hosted setup. - GETRetrieve an agent environment template
/agents/environments/templates/:environment_template_idRetrieves reusable environment configuration without returning confidential values. See reusing a hosted setup.
Showing 300 of 388 endpoints. Fork the collection to see all of them.
API details
- Base URL
https://api.openai.com/v1- Authentication
- A bearer token in the Authorization header
A bearer token in the Authorization header - Operations
- 388 operations on 245 pathsGET 170POST 162DELETE 56
17 marked deprecated - Main resources
- Agents 47Projects 24Assistants 23Vector stores 16Responses 14Fine-tuning 13Evals 12Skills 11Usage 11Audio 10
- Response formats
application/jsontext/plaintext/event-streamapplication/octet-stream- Webhooks
- 31 described
- Description format
- OpenAPI 3.1.0, API version
2.3.0 - Links
- OpenAPI document · Terms of service · Support
- Listed from
- OpenAI's published OpenAPI description (openai/openai-openapi) (MIT)
How to test the OpenAI API (all endpoints) in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the OpenAI API (all endpoints) collection, without the publisher's secrets.
- Add your credentialsThis API uses A bearer token in the Authorization header. Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “List assistants” (GET /assistants?limit=20&order=desc&after=string&before=string), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the OpenAI API (all endpoints)?
The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details. It is listed under AI & machine learning and has 388 endpoints.
Who publishes the OpenAI API (all endpoints)?
It is listed from OpenAI's public API description (an OpenAPI document), not published by OpenAI on Swastik Codes. Anyone who controls openai.com can claim the profile by adding a DNS TXT record.
What is the base URL of the OpenAI API (all endpoints)?
Requests go to https://api.openai.com/v1. Endpoint paths are added to this base URL.
How do I authenticate with the OpenAI API (all endpoints)?
It accepts 2 methods: A bearer token in the Authorization header; A bearer token in the Authorization header.
How many endpoints does the OpenAI API (all endpoints) have?
388 operations on 245 paths (170 GET, 162 POST, 56 DELETE). The largest groups are Agents, Projects, Assistants, Vector stores.
Is forking the OpenAI API (all endpoints) free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.