class

OpenAI::Client

Inherits Reference < Object

Constants

DEFAULT_BASE_URL = "https://api.openai.com/v1"
DEFAULT_TIMEOUT = 120.seconds

Constructors

new(api_key : String = ENV["OPENAI_API_KEY"]? || "", base_url : String = DEFAULT_BASE_URL, timeout : Time::Span = DEFAULT_TIMEOUT, organization : String | Nil = ENV["OPENAI_ORGANIZATION"]?)
Source

Instance methods

accept_realtime_call(call_id : String, request_body : RealtimeSessionCreateRequestGA) : Nil

Accept call Accept an incoming SIP call and configure the realtime session that will handle it.

Source
activate_organization_certificates(request_body : ToggleCertificatesRequest) : ListCertificatesResponse

Activate certificates for organization Activate certificates at the organization level.

You can atomically and idempotently activate up to 10 certificates at a time.

Source
activate_project_certificates(project_id : String, request_body : ToggleCertificatesRequest) : ListCertificatesResponse

Activate certificates for project Activate certificates at the project level.

You can atomically and idempotently activate up to 10 certificates at a time.

Source
add_group_user(group_id : String, request_body : CreateGroupUserBody) : GroupUserAssignment

Add group user Adds a user to a group.

Source
add_project_group(project_id : String, request_body : InviteProjectGroupBody) : ProjectGroup

Add project group Grants a group access to a project.

Source
add_upload_part(upload_id : String, request_body : AddUploadPartRequest) : UploadPart

Add upload part Adds 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 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.

Source
admin_api_keys_create(request_body : AdminApiKeysCreateRequestBody) : AdminApiKey

Create admin API key Create an organization admin API key

Source
admin_api_keys_delete(key_id : String) : AdminApiKeysDeleteResponse

Delete admin API key Delete an organization admin API key

Source
admin_api_keys_get(key_id : String) : AdminApiKey

Retrieve admin API key Retrieve a single organization API key

Source
admin_api_keys_list(after : String | Nil = nil, order : String | Nil = nil, limit : Int64 | Nil = nil) : ApiKeyList

List all organization and project API keys. List organization API keys

Source
api_key
Source
api_key=(api_key : String)
Source
archive_project(project_id : String) : Project

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

Source
assign_group_role(group_id : String, request_body : PublicAssignOrganizationGroupRoleBody) : GroupRoleAssignment

Assign organization role to group Assigns an organization role to a group within the organization.

Source
assign_project_group_role(project_id : String, group_id : String, request_body : PublicAssignOrganizationGroupRoleBody) : GroupRoleAssignment

Assign project role to group Assigns a project role to a group within a project.

Source
assign_project_user_role(project_id : String, user_id : String, request_body : PublicAssignOrganizationGroupRoleBody) : UserRoleAssignment

Assign project role to user Assigns a project role to a user within a project.

Source
assign_user_role(user_id : String, request_body : PublicAssignOrganizationGroupRoleBody) : UserRoleAssignment

Assign organization role to user Assigns an organization role to a user within the organization.

Source
base_url
Source
base_url=(base_url : String)
Source
cancel_batch(batch_id : String) : Batch

Cancel batch 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.

Source
cancel_chat_session_method(session_id : String) : ChatSessionResource

Cancel chat session Cancel a ChatKit session

Source
cancel_eval_run(eval_id : String, run_id : String) : EvalRun

Cancel eval run Cancel an ongoing evaluation run.

Source
cancel_fine_tuning_job(fine_tuning_job_id : String) : FineTuningJob

Cancel fine-tuning Immediately cancel a fine-tune job.

Source
cancel_response(response_id : String) : Response

Cancel a response Cancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled. Learn more.

Source
cancel_run(thread_id : String, run_id : String) : RunObject

Cancel a run Cancels a run that is in_progress.

Source
cancel_upload(upload_id : String) : Upload

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

Source
cancel_vector_store_file_batch(vector_store_id : String, batch_id : String) : VectorStoreFileBatchObject

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

Source
compactconversation(request_body : CompactResponseMethodPublicBody | Nil = nil) : CompactResource

Compact a response Compact conversation

Source
complete_upload(upload_id : String, request_body : CompleteUploadRequest) : Upload

Complete upload Completes 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 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.

Source
create_assistant(request_body : CreateAssistantRequest) : AssistantObject

Create assistant Create an assistant with a model and instructions.

Source
create_batch(request_body : CreateBatchRequestBody) : Batch

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

Source
create_chat_completion(request_body : CreateChatCompletionRequest) : CreateChatCompletionResponse

Create chat completion Starting a new project? We recommend trying Responses to take advantage of the latest OpenAI platform features. Compare Chat Completions with Responses.


Creates a model response for the given chat conversation. Learn more in the text generation, vision, and 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.

Source
create_chat_completion_stream(request_body : CreateChatCompletionRequest, &block : CreateChatCompletionStreamResponse -> )

Streaming version of create_chat_completion

Source
create_chat_session_method(request_body : CreateChatSessionBody | Nil = nil) : ChatSessionResource

Create ChatKit session Create a ChatKit session

Source
create_completion(request_body : CreateCompletionRequest) : CreateCompletionResponse

Create completion Creates a completion for the provided prompt and parameters.

Source
create_container(request_body : CreateContainerBody | Nil = nil) : ContainerResource

Create container Create Container

Source
create_container_file(container_id : String, request_body : CreateContainerFileBody) : ContainerFileResource

Create container file Create a Container File

You can send either a multipart/form-data request with the raw file content, or a JSON request with a file ID.

Source
create_conversation(request_body : CreateConversationBody | Nil = nil) : ConversationResource

Create a conversation Create a conversation.

Source
create_conversation_items(conversation_id : String, request_body : CreateConversationItemsRequestBody, include_value : Array(IncludeEnum) | Nil = nil) : ConversationItemList

Create items Create items in a conversation with the given ID.

Source
create_embedding(request_body : CreateEmbeddingRequest) : CreateEmbeddingResponse

Create embeddings Creates an embedding vector representing the input text.

Source
create_eval(request_body : CreateEvalRequest) : Eval

Create eval Create 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 source, which dictates the schema of the data used in the evaluation. After creating an evaluation, you can run it on different models and model parameters. We support several types of graders and datasources. For more information, see the Evals guide.

Source
create_eval_run(eval_id : String, request_body : CreateEvalRunRequest) : EvalRun

Create eval run Kicks 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 the schema specified in the config of the evaluation.

Source
create_file(request_body : CreateFileRequest) : OpenAIFile

Upload file 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 1 TB.

  • The Assistants API supports files up to 2 million tokens and of specific file types. See the Assistants Tools guide for details.
  • The Fine-tuning API only supports .jsonl files. The input also has certain required formats for fine-tuning chat or completions models.
  • The Batch API only supports .jsonl files up to 200 MB in size. The input also has a specific required format.

Please contact us if you need to increase these storage limits.

Source
create_fine_tuning_checkpoint_permission(fine_tuned_model_checkpoint : String, request_body : CreateFineTuningCheckpointPermissionRequest) : ListFineTuningCheckpointPermissionResponse

Create checkpoint permissions NOTE: Calling this endpoint requires an admin API key.

This enables organization owners to share fine-tuned models with other projects in their organization.

Source
create_fine_tuning_job(request_body : CreateFineTuningJobRequest) : FineTuningJob

Create fine-tuning job 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

Source
create_group(request_body : CreateGroupBody) : GroupResponse

Create group Creates a new group in the organization.

Source
create_image(request_body : CreateImageRequest) : ImagesResponse

Create image Creates an image given a prompt. Learn more.

Source
create_image_edit(request_body : CreateImageEditRequest) : ImagesResponse

Create image edit Creates an edited or extended image given one or more source images and a prompt. This endpoint only supports gpt-image-1 and dall-e-2.

Source
create_image_edit_stream(request_body : CreateImageEditRequest, &block : ImagesResponse -> )

Streaming version of create_image_edit

Source
create_image_stream(request_body : CreateImageRequest, &block : ImagesResponse -> )

Streaming version of create_image

Source
create_image_variation(request_body : CreateImageVariationRequest) : ImagesResponse

Create image variation Creates a variation of a given image. This endpoint only supports dall-e-2.

Source
create_message(thread_id : String, request_body : CreateMessageRequest) : MessageObject

Create message Create a message.

Source
create_moderation(request_body : CreateModerationRequest) : CreateModerationResponse

Create moderation Classifies if text and/or image inputs are potentially harmful. Learn more in the moderation guide.

Source
create_project(request_body : ProjectCreateRequest) : Project

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

Source
create_project_role(project_id : String, request_body : PublicCreateOrganizationRoleBody) : Role

Create project role Creates a custom role for a project.

Source
create_project_service_account(project_id : String, request_body : ProjectServiceAccountCreateRequest) : ProjectServiceAccountCreateResponse

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

Source
create_project_user(project_id : String, request_body : ProjectUserCreateRequest) : ProjectUser

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

Source
create_realtime_call(request_body : RealtimeCallCreateRequest) : JSON::Any

Create call Create a new Realtime API call over WebRTC and receive the SDP answer needed to complete the peer connection.

Source
create_realtime_client_secret(request_body : RealtimeCreateClientSecretRequest) : RealtimeCreateClientSecretResponse

Create client secret Create a Realtime client secret with an associated session configuration.

Source
create_realtime_session(request_body : RealtimeSessionCreateRequest) : RealtimeSessionCreateResponse

Create session 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.

Source
create_realtime_transcription_session(request_body : RealtimeTranscriptionSessionCreateRequest) : RealtimeTranscriptionSessionCreateResponse

Create transcription session Create an ephemeral API token for use in client-side applications with the Realtime API specifically for realtime transcriptions. Can be configured with the same session parameters as the transcription_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.

Source
create_response(request_body : CreateResponse) : Response

Create a model response Creates 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 web search or file search to use your own data as input for the model's response.

Source
create_response_stream(request_body : CreateResponse, &block : Response -> )

Streaming version of create_response

Source
create_role(request_body : PublicCreateOrganizationRoleBody) : Role

Create organization role Creates a custom role for the organization.

Source
create_run(thread_id : String, request_body : CreateRunRequest, include_value : Array(String) | Nil = nil) : RunObject

Create run Create a run.

Source
create_speech(request_body : CreateSpeechRequest) : String

Create speech Generates audio from the input text.

Source
create_speech_stream(request_body : CreateSpeechRequest, &block : String -> )

Streaming version of create_speech

Source
create_thread(request_body : CreateThreadRequest | Nil = nil) : ThreadObject

Create thread Create a thread.

Source
create_thread_and_run(request_body : CreateThreadAndRunRequest) : RunObject

Create thread and run Create a thread and run it in one request.

Source
create_transcription(request_body : CreateTranscriptionRequest) : CreateTranscriptionResponse

Create transcription Transcribes audio into the input language.

Source
create_transcription_stream(request_body : CreateTranscriptionRequest, &block : CreateTranscriptionResponse -> )

Streaming version of create_transcription

Source
create_translation(request_body : CreateTranslationRequest) : CreateTranslationResponse

Create translation Translates audio into English.

Source
create_upload(request_body : CreateUploadRequest) : Upload

Create upload Creates 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 create it.

Once you complete the Upload, we will create a File 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 values, the correct mime_type must be specified. Please refer to documentation for the supported MIME types for your use case.

For guidance on the proper filename extensions for each purpose, please follow the documentation on creating a File.

Source
create_vector_store(request_body : CreateVectorStoreRequest) : VectorStoreObject

Create vector store Create a vector store.

Source
create_vector_store_file(vector_store_id : String, request_body : CreateVectorStoreFileRequest) : VectorStoreFileObject

Create vector store file Create a vector store file by attaching a File to a vector store.

Source
create_vector_store_file_batch(vector_store_id : String, request_body : CreateVectorStoreFileBatchRequest) : VectorStoreFileBatchObject

Create vector store file batch Create a vector store file batch.

Source
create_video(request_body : CreateVideoBody | Nil = nil) : VideoResource

Create video Create a video

Source
create_video_remix(video_id : String, request_body : CreateVideoRemixBody | Nil = nil) : VideoResource

Remix video Create a video remix

Source
deactivate_organization_certificates(request_body : ToggleCertificatesRequest) : ListCertificatesResponse

Deactivate certificates for organization Deactivate certificates at the organization level.

You can atomically and idempotently deactivate up to 10 certificates at a time.

Source
deactivate_project_certificates(project_id : String, request_body : ToggleCertificatesRequest) : ListCertificatesResponse

Deactivate certificates for project Deactivate certificates at the project level. You can atomically and idempotently deactivate up to 10 certificates at a time.

Source
delete_assistant(assistant_id : String) : DeleteAssistantResponse

Delete assistant Delete an assistant.

Source
delete_certificate

Delete certificate Delete a certificate from the organization.

The certificate must be inactive for the organization and all projects.

Source
delete_chat_completion(completion_id : String) : ChatCompletionDeleted

Delete chat completion Delete a stored chat completion. Only Chat Completions that have been created with the store parameter set to true can be deleted.

Source
delete_container(container_id : String) : Nil

Delete a container Delete Container

Source
delete_container_file(container_id : String, file_id : String) : Nil

Delete a container file Delete Container File

Source
delete_conversation(conversation_id : String) : DeletedConversationResource

Delete a conversation Delete a conversation. Items in the conversation will not be deleted.

Source
delete_conversation_item(conversation_id : String, item_id : String) : ConversationResource

Delete an item Delete an item from a conversation with the given IDs.

Source
delete_eval(eval_id : String) : DeleteEvalResponse

Delete an eval Delete an evaluation.

Source
delete_eval_run(eval_id : String, run_id : String) : DeleteEvalRunResponse

Delete eval run Delete an eval run.

Source
delete_file(file_id : String) : DeleteFileResponse

Delete file Delete a file and remove it from all vector stores.

Source
delete_fine_tuning_checkpoint_permission(fine_tuned_model_checkpoint : String, permission_id : String) : DeleteFineTuningCheckpointPermissionResponse

Delete checkpoint permission NOTE: This endpoint requires an admin API key.

Organization owners can use this endpoint to delete a permission for a fine-tuned model checkpoint.

Source
delete_group(group_id : String) : GroupDeletedResource

Delete group Deletes a group from the organization.

Source
delete_invite(invite_id : String) : InviteDeleteResponse

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

Source
delete_message(thread_id : String, message_id : String) : DeleteMessageResponse

Delete message Deletes a message.

Source
delete_model(model : String) : DeleteModelResponse

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

Source
delete_project_api_key(project_id : String, key_id : String) : ProjectApiKeyDeleteResponse

Delete project API key Deletes an API key from the project.

Source
delete_project_role(project_id : String, role_id : String) : RoleDeletedResource

Delete project role Deletes a custom role from a project.

Source
delete_project_service_account(project_id : String, service_account_id : String) : ProjectServiceAccountDeleteResponse

Delete project service account Deletes a service account from the project.

Source
delete_project_user(project_id : String, user_id : String) : ProjectUserDeleteResponse

Delete project user Deletes a user from the project.

Source
delete_response(response_id : String) : Nil

Delete a model response Deletes a model response with the given ID.

Source
delete_role(role_id : String) : RoleDeletedResource

Delete organization role Deletes a custom role from the organization.

Source
delete_thread(thread_id : String) : DeleteThreadResponse

Delete thread Delete a thread.

Source
delete_thread_method(thread_id : String) : DeletedThreadResource

Delete ChatKit thread Delete a ChatKit thread

Source
delete_user(user_id : String) : UserDeleteResponse

Delete user Deletes a user from the organization.

Source
delete_vector_store(vector_store_id : String) : DeleteVectorStoreResponse

Delete vector store Delete a vector store.

Source
delete_vector_store_file(vector_store_id : String, file_id : String) : DeleteVectorStoreFileResponse

Delete vector store file 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 endpoint.

Source
delete_video(video_id : String) : DeletedVideoResource

Delete video Delete a video

Source
download_file(file_id : String) : String

Retrieve file content Returns the contents of the specified file.

Source
get_assistant(assistant_id : String) : AssistantObject

Retrieve assistant Retrieves an assistant.

Source
get_certificate(certificate_id : String, include_value : Array(String) | Nil = nil) : Certificate

Get certificate Get a certificate that has been uploaded to the organization.

You can get a certificate regardless of whether it is active or not.

Source
get_chat_completion(completion_id : String) : CreateChatCompletionResponse

Get chat completion Get a stored chat completion. Only Chat Completions that have been created with the store parameter set to true will be returned.

Source
get_chat_completion_messages(completion_id : String, after : String | Nil = nil, limit : Int64 | Nil = nil, order : String | Nil = nil) : ChatCompletionMessageList

Get chat messages Get the messages in a stored chat completion. Only Chat Completions that have been created with the store parameter set to true will be returned.

Source
get_conversation(conversation_id : String) : ConversationResource

Retrieve a conversation Get a conversation

Source
get_conversation_item(conversation_id : String, item_id : String, include_value : Array(IncludeEnum) | Nil = nil) : ConversationItem

Retrieve an item Get a single item from a conversation with the given IDs.

Source
get_eval(eval_id : String) : Eval

Get an eval Get an evaluation by ID.

Source
get_eval_run(eval_id : String, run_id : String) : EvalRun

Get an eval run Get an evaluation run by ID.

Source
get_eval_run_output_item(eval_id : String, run_id : String, output_item_id : String) : EvalRunOutputItem

Get an output item of an eval run Get an evaluation run output item by ID.

Source
get_eval_run_output_items(eval_id : String, run_id : String, after : String | Nil = nil, limit : Int64 | Nil = nil, status : String | Nil = nil, order : String | Nil = nil) : EvalRunOutputItemList

Get eval run output items Get a list of output items for an evaluation run.

Source
get_eval_runs(eval_id : String, after : String | Nil = nil, limit : Int64 | Nil = nil, order : String | Nil = nil, status : String | Nil = nil) : EvalRunList

Get eval runs Get a list of runs for an evaluation.

Source
get_message(thread_id : String, message_id : String) : MessageObject

Retrieve message Retrieve a message.

Source
get_response(response_id : String, include_value : Array(IncludeEnum) | Nil = nil, stream : Bool | Nil = nil, starting_after : Int64 | Nil = nil, include_obfuscation : Bool | Nil = nil) : Response

Get a model response Retrieves a model response with the given ID.

Source
get_run(thread_id : String, run_id : String) : RunObject

Retrieve run Retrieves a run.

Source
get_run_step(thread_id : String, run_id : String, step_id : String, include_value : Array(String) | Nil = nil) : RunStepObject

Retrieve run step Retrieves a run step.

Source
get_thread(thread_id : String) : ThreadObject

Retrieve thread Retrieves a thread.

Source
get_thread_method(thread_id : String) : ThreadResource

Retrieve ChatKit thread Retrieve a ChatKit thread

Source
get_vector_store(vector_store_id : String) : VectorStoreObject

Retrieve vector store Retrieves a vector store.

Source
get_vector_store_file(vector_store_id : String, file_id : String) : VectorStoreFileObject

Retrieve vector store file Retrieves a vector store file.

Source
get_vector_store_file_batch(vector_store_id : String, batch_id : String) : VectorStoreFileBatchObject

Retrieve vector store file batch Retrieves a vector store file batch.

Source
get_video(video_id : String) : VideoResource

Retrieve video Retrieve a video

Source
getinputtokencounts(request_body : TokenCountsBody | Nil = nil) : TokenCountsResource

Get input token counts

Source
hangup_realtime_call(call_id : String) : Nil

Hang up call End an active Realtime API call, whether it was initiated over SIP or WebRTC.

Source
invite_user(request_body : InviteRequest) : Invite

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

Source
list_assistants(limit : Int64 | Nil = nil, order : String | Nil = nil, after : String | Nil = nil, before : String | Nil = nil) : ListAssistantsResponse

List assistants Returns a list of assistants.

Source
list_audit_logs(effective_at : ListAuditLogsEffectiveAt | Nil = nil, project_ids : Array(String) | Nil = nil, event_types : Array(AuditLogEventType) | Nil = nil, actor_ids : Array(String) | Nil = nil, actor_emails : Array(String) | Nil = nil, resource_ids : Array(String) | Nil = nil, limit : Int64 | Nil = nil, after : String | Nil = nil, before : String | Nil = nil) : ListAuditLogsResponse

List audit logs List user actions and configuration changes within this organization.

Source
list_batches(after : String | Nil = nil, limit : Int64 | Nil = nil) : ListBatchesResponse

List batch List your organization's batches.

Source
list_chat_completions(model : String | Nil = nil, metadata : Metadata | Nil = nil, after : String | Nil = nil, limit : Int64 | Nil = nil, order : String | Nil = nil) : ChatCompletionList

List Chat Completions List stored Chat Completions. Only Chat Completions that have been stored with the store parameter set to true will be returned.

Source
list_container_files(container_id : String, limit : Int64 | Nil = nil, order : String | Nil = nil, after : String | Nil = nil) : ContainerFileListResource

List container files List Container files

Source
list_containers(limit : Int64 | Nil = nil, order : String | Nil = nil, after : String | Nil = nil) : ContainerListResource

List containers List Containers

Source
list_conversation_items(conversation_id : String, limit : Int64 | Nil = nil, order : String | Nil = nil, after : String | Nil = nil, include_value : Array(IncludeEnum) | Nil = nil) : ConversationItemList

List items List all items for a conversation with the given ID.

Source
list_evals(after : String | Nil = nil, limit : Int64 | Nil = nil, order : String | Nil = nil, order_by : String | Nil = nil) : EvalList

List evals List evaluations for a project.

Source
list_files(purpose : String | Nil = nil, limit : Int64 | Nil = nil, order : String | Nil = nil, after : String | Nil = nil) : ListFilesResponse

List files Returns a list of files.

Source
list_files_in_vector_store_batch(vector_store_id : String, batch_id : String, limit : Int64 | Nil = nil, order : String | Nil = nil, after : String | Nil = nil, before : String | Nil = nil, filter : String | Nil = nil) : ListVectorStoreFilesResponse

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

Source
list_fine_tuning_checkpoint_permissions(fine_tuned_model_checkpoint : String, project_id : String | Nil = nil, after : String | Nil = nil, limit : Int64 | Nil = nil, order : String | Nil = nil) : ListFineTuningCheckpointPermissionResponse

List checkpoint permissions NOTE: This endpoint requires an admin API key.

Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint.

Source
list_fine_tuning_events(fine_tuning_job_id : String, after : String | Nil = nil, limit : Int64 | Nil = nil) : ListFineTuningJobEventsResponse

List fine-tuning events Get status updates for a fine-tuning job.

Source
list_fine_tuning_job_checkpoints(fine_tuning_job_id : String, after : String | Nil = nil, limit : Int64 | Nil = nil) : ListFineTuningJobCheckpointsResponse

List fine-tuning checkpoints List checkpoints for a fine-tuning job.

Source
list_group_role_assignments(group_id : String, limit : Int64 | Nil = nil, after : String | Nil = nil, order : String | Nil = nil) : RoleListResource

List group organization role assignments Lists the organization roles assigned to a group within the organization.

Source
list_group_users(group_id : String, limit : Int64 | Nil = nil, after : String | Nil = nil, order : String | Nil = nil) : UserListResource

List group users Lists the users assigned to a group.

Source
list_groups(limit : Int64 | Nil = nil, after : String | Nil = nil, order : String | Nil = nil) : GroupListResource

List groups Lists all groups in the organization.

Source
list_input_items(response_id : String, limit : Int64 | Nil = nil, order : String | Nil = nil, after : String | Nil = nil, include_value : Array(IncludeEnum) | Nil = nil) : ResponseItemList

List input items Returns a list of input items for a given response.

Source
list_invites(limit : Int64 | Nil = nil, after : String | Nil = nil) : InviteListResponse

List invites Returns a list of invites in the organization.

Source
list_messages(thread_id : String, limit : Int64 | Nil = nil, order : String | Nil = nil, after : String | Nil = nil, before : String | Nil = nil, run_id : String | Nil = nil) : ListMessagesResponse

List messages Returns a list of messages for a given thread.

Source
list_models

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

Source
list_organization_certificates(limit : Int64 | Nil = nil, after : String | Nil = nil, order : String | Nil = nil) : ListCertificatesResponse

List organization certificates List uploaded certificates for this organization.

Source
list_paginated_fine_tuning_jobs(after : String | Nil = nil, limit : Int64 | Nil = nil, metadata : Hash(String, String) | Nil = nil) : ListPaginatedFineTuningJobsResponse

List fine-tuning jobs List your organization's fine-tuning jobs

Source
list_project_api_keys(project_id : String, limit : Int64 | Nil = nil, after : String | Nil = nil) : ProjectApiKeyListResponse

List project API keys Returns a list of API keys in the project.

Source
list_project_certificates(project_id : String, limit : Int64 | Nil = nil, after : String | Nil = nil, order : String | Nil = nil) : ListCertificatesResponse

List project certificates List certificates for this project.

Source
list_project_group_role_assignments(project_id : String, group_id : String, limit : Int64 | Nil = nil, after : String | Nil = nil, order : String | Nil = nil) : RoleListResource

List project group role assignments Lists the project roles assigned to a group within a project.

Source
list_project_groups(project_id : String, limit : Int64 | Nil = nil, after : String | Nil = nil, order : String | Nil = nil) : ProjectGroupListResource

List project groups Lists the groups that have access to a project.

Source
list_project_rate_limits(project_id : String, limit : Int64 | Nil = nil, after : String | Nil = nil, before : String | Nil = nil) : ProjectRateLimitListResponse

List project rate limits Returns the rate limits per model for a project.

Source
list_project_roles(project_id : String, limit : Int64 | Nil = nil, after : String | Nil = nil, order : String | Nil = nil) : PublicRoleListResource

List project roles Lists the roles configured for a project.

Source
list_project_service_accounts(project_id : String, limit : Int64 | Nil = nil, after : String | Nil = nil) : ProjectServiceAccountListResponse

List project service accounts Returns a list of service accounts in the project.

Source
list_project_user_role_assignments(project_id : String, user_id : String, limit : Int64 | Nil = nil, after : String | Nil = nil, order : String | Nil = nil) : RoleListResource

List project user role assignments Lists the project roles assigned to a user within a project.

Source
list_project_users(project_id : String, limit : Int64 | Nil = nil, after : String | Nil = nil) : ProjectUserListResponse

List project users Returns a list of users in the project.

Source
list_projects(limit : Int64 | Nil = nil, after : String | Nil = nil, include_archived : Bool | Nil = nil) : ProjectListResponse

List projects Returns a list of projects.

Source
list_roles(limit : Int64 | Nil = nil, after : String | Nil = nil, order : String | Nil = nil) : PublicRoleListResource

List organization roles Lists the roles configured for the organization.

Source
list_run_steps(thread_id : String, run_id : String, limit : Int64 | Nil = nil, order : String | Nil = nil, after : String | Nil = nil, before : String | Nil = nil, include_value : Array(String) | Nil = nil) : ListRunStepsResponse

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

Source
list_runs(thread_id : String, limit : Int64 | Nil = nil, order : String | Nil = nil, after : String | Nil = nil, before : String | Nil = nil) : ListRunsResponse

List runs Returns a list of runs belonging to a thread.

Source
list_thread_items_method(thread_id : String, limit : Int64 | Nil = nil, order : OrderEnum | Nil = nil, after : String | Nil = nil, before : String | Nil = nil) : ThreadItemListResource

List ChatKit thread items

Source
list_threads_method(limit : Int64 | Nil = nil, order : OrderEnum | Nil = nil, after : String | Nil = nil, before : String | Nil = nil, user : String | Nil = nil) : ThreadListResource

List ChatKit threads

Source
list_user_role_assignments(user_id : String, limit : Int64 | Nil = nil, after : String | Nil = nil, order : String | Nil = nil) : RoleListResource

List user organization role assignments Lists the organization roles assigned to a user within the organization.

Source
list_users(limit : Int64 | Nil = nil, after : String | Nil = nil, emails : Array(String) | Nil = nil) : UserListResponse

List users Lists all of the users in the organization.

Source
list_vector_store_files(vector_store_id : String, limit : Int64 | Nil = nil, order : String | Nil = nil, after : String | Nil = nil, before : String | Nil = nil, filter : String | Nil = nil) : ListVectorStoreFilesResponse

List vector store files Returns a list of vector store files.

Source
list_vector_stores(limit : Int64 | Nil = nil, order : String | Nil = nil, after : String | Nil = nil, before : String | Nil = nil) : ListVectorStoresResponse

List vector stores Returns a list of vector stores.

Source
list_videos(limit : Int64 | Nil = nil, order : OrderEnum | Nil = nil, after : String | Nil = nil) : VideoListResource

List videos

Source
modify_assistant(assistant_id : String, request_body : ModifyAssistantRequest) : AssistantObject

Modify assistant Modifies an assistant.

Source
modify_certificate(request_body : ModifyCertificateRequest) : Certificate

Modify certificate Modify a certificate. Note that only the name can be modified.

Source
modify_message(thread_id : String, message_id : String, request_body : ModifyMessageRequest) : MessageObject

Modify message Modifies a message.

Source
modify_project(project_id : String, request_body : ProjectUpdateRequest) : Project

Modify project Modifies a project in the organization.

Source
modify_project_user(project_id : String, user_id : String, request_body : ProjectUserUpdateRequest) : ProjectUser

Modify project user Modifies a user's role in the project.

Source
modify_run(thread_id : String, run_id : String, request_body : ModifyRunRequest) : RunObject

Modify run Modifies a run.

Source
modify_thread(thread_id : String, request_body : ModifyThreadRequest) : ThreadObject

Modify thread Modifies a thread.

Source
modify_user(user_id : String, request_body : UserRoleUpdateRequest) : User

Modify user Modifies a user's role in the organization.

Source
modify_vector_store(vector_store_id : String, request_body : UpdateVectorStoreRequest) : VectorStoreObject

Modify vector store Modifies a vector store.

Source
organization
Source
organization=(organization : String | Nil)
Source
pause_fine_tuning_job(fine_tuning_job_id : String) : FineTuningJob

Pause fine-tuning Pause a fine-tune job.

Source
refer_realtime_call(call_id : String, request_body : RealtimeCallReferRequest) : Nil

Refer call Transfer an active SIP call to a new destination using the SIP REFER verb.

Source
reject_realtime_call(call_id : String, request_body : RealtimeCallRejectRequest | Nil = nil) : Nil

Reject call Decline an incoming SIP call by returning a SIP status code to the caller.

Source
remove_group_user(group_id : String, user_id : String) : GroupUserDeletedResource

Remove group user Removes a user from a group.

Source
remove_project_group(project_id : String, group_id : String) : ProjectGroupDeletedResource

Remove project group Revokes a group's access to a project.

Source
resume_fine_tuning_job(fine_tuning_job_id : String) : FineTuningJob

Resume fine-tuning Resume a fine-tune job.

Source
retrieve_batch(batch_id : String) : Batch

Retrieve batch Retrieves a batch.

Source
retrieve_container(container_id : String) : ContainerResource

Retrieve container Retrieve Container

Source
retrieve_container_file(container_id : String, file_id : String) : ContainerFileResource

Retrieve container file Retrieve Container File

Source
retrieve_container_file_content(container_id : String, file_id : String) : Nil

Retrieve container file content Retrieve Container File Content

Source
retrieve_file(file_id : String) : OpenAIFile

Retrieve file Returns information about a specific file.

Source
retrieve_fine_tuning_job(fine_tuning_job_id : String) : FineTuningJob

Retrieve fine-tuning job Get info about a fine-tuning job.

Learn more about fine-tuning

Source
retrieve_invite(invite_id : String) : Invite

Retrieve invite Retrieves an invite.

Source
retrieve_model(model : String) : Model

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

Source
retrieve_project(project_id : String) : Project

Retrieve project Retrieves a project.

Source
retrieve_project_api_key(project_id : String, key_id : String) : ProjectApiKey

Retrieve project API key Retrieves an API key in the project.

Source
retrieve_project_service_account(project_id : String, service_account_id : String) : ProjectServiceAccount

Retrieve project service account Retrieves a service account in the project.

Source
retrieve_project_user(project_id : String, user_id : String) : ProjectUser

Retrieve project user Retrieves a user in the project.

Source
retrieve_user(user_id : String) : User

Retrieve user Retrieves a user by their identifier.

Source
retrieve_vector_store_file_content(vector_store_id : String, file_id : String) : VectorStoreFileContentResponse

Retrieve vector store file content Retrieve the parsed contents of a vector store file.

Source
retrieve_video_content(video_id : String, variant : VideoContentVariant | Nil = nil) : String

Retrieve video content Download video content

Source
run_grader(request_body : RunGraderRequest) : RunGraderResponse

Run grader Run a grader.

Source
search_vector_store(vector_store_id : String, request_body : VectorStoreSearchRequest) : VectorStoreSearchResultsPage

Search vector store Search a vector store for relevant chunks based on a query and file attributes filter.

Source
submit_tool_ouputs_to_run(thread_id : String, run_id : String, request_body : SubmitToolOutputsRunRequest) : RunObject

Submit tool outputs to run 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.

Source
timeout
Source
timeout=(timeout : Time::Span)
Source
unassign_group_role(group_id : String, role_id : String) : DeletedRoleAssignmentResource

Unassign organization role from group Unassigns an organization role from a group within the organization.

Source
unassign_project_group_role(project_id : String, group_id : String, role_id : String) : DeletedRoleAssignmentResource

Unassign project role from group Unassigns a project role from a group within a project.

Source
unassign_project_user_role(project_id : String, user_id : String, role_id : String) : DeletedRoleAssignmentResource

Unassign project role from user Unassigns a project role from a user within a project.

Source
unassign_user_role(user_id : String, role_id : String) : DeletedRoleAssignmentResource

Unassign organization role from user Unassigns an organization role from a user within the organization.

Source
update_chat_completion(completion_id : String, request_body : UpdateChatCompletionRequestBody) : CreateChatCompletionResponse

Update chat completion Modify a stored chat completion. Only Chat Completions that have been created with the store parameter set to true can be modified. Currently, the only supported modification is to update the metadata field.

Source
update_conversation(conversation_id : String, request_body : UpdateConversationBody | Nil = nil) : ConversationResource

Update a conversation

Source
update_eval(eval_id : String, request_body : UpdateEvalRequestBody) : Eval

Update an eval Update certain properties of an evaluation.

Source
update_group(group_id : String, request_body : UpdateGroupBody) : GroupResourceWithSuccess

Update group Updates a group's information.

Source
update_project_rate_limits(project_id : String, rate_limit_id : String, request_body : ProjectRateLimitUpdateRequest) : ProjectRateLimit

Modify project rate limit Updates a project rate limit.

Source
update_project_role(project_id : String, role_id : String, request_body : PublicUpdateOrganizationRoleBody) : Role

Update project role Updates an existing project role.

Source
update_role(role_id : String, request_body : PublicUpdateOrganizationRoleBody) : Role

Update organization role Updates an existing organization role.

Source
update_vector_store_file_attributes(vector_store_id : String, file_id : String, request_body : UpdateVectorStoreFileAttributesRequest) : VectorStoreFileObject

Update vector store file attributes Update attributes on a vector store file.

Source
upload_certificate(request_body : UploadCertificateRequest) : Certificate

Upload certificate Upload a certificate to the organization. This does not automatically activate the certificate.

Organizations can upload up to 50 certificates.

Source
usage_audio_speeches(start_time : Int64, end_time : Int64 | Nil = nil, bucket_width : String | Nil = nil, project_ids : Array(String) | Nil = nil, user_ids : Array(String) | Nil = nil, api_key_ids : Array(String) | Nil = nil, models : Array(String) | Nil = nil, group_by : Array(String) | Nil = nil, limit : Int64 | Nil = nil, page : String | Nil = nil) : UsageResponse

Audio speeches Get audio speeches usage details for the organization.

Source
usage_audio_transcriptions(start_time : Int64, end_time : Int64 | Nil = nil, bucket_width : String | Nil = nil, project_ids : Array(String) | Nil = nil, user_ids : Array(String) | Nil = nil, api_key_ids : Array(String) | Nil = nil, models : Array(String) | Nil = nil, group_by : Array(String) | Nil = nil, limit : Int64 | Nil = nil, page : String | Nil = nil) : UsageResponse

Audio transcriptions Get audio transcriptions usage details for the organization.

Source
usage_code_interpreter_sessions(start_time : Int64, end_time : Int64 | Nil = nil, bucket_width : String | Nil = nil, project_ids : Array(String) | Nil = nil, group_by : Array(String) | Nil = nil, limit : Int64 | Nil = nil, page : String | Nil = nil) : UsageResponse

Code interpreter sessions Get code interpreter sessions usage details for the organization.

Source
usage_completions(start_time : Int64, end_time : Int64 | Nil = nil, bucket_width : String | Nil = nil, project_ids : Array(String) | Nil = nil, user_ids : Array(String) | Nil = nil, api_key_ids : Array(String) | Nil = nil, models : Array(String) | Nil = nil, batch : Bool | Nil = nil, group_by : Array(String) | Nil = nil, limit : Int64 | Nil = nil, page : String | Nil = nil) : UsageResponse

Completions Get completions usage details for the organization.

Source
usage_costs(start_time : Int64, end_time : Int64 | Nil = nil, bucket_width : String | Nil = nil, project_ids : Array(String) | Nil = nil, group_by : Array(String) | Nil = nil, limit : Int64 | Nil = nil, page : String | Nil = nil) : UsageResponse

Costs Get costs details for the organization.

Source
usage_embeddings(start_time : Int64, end_time : Int64 | Nil = nil, bucket_width : String | Nil = nil, project_ids : Array(String) | Nil = nil, user_ids : Array(String) | Nil = nil, api_key_ids : Array(String) | Nil = nil, models : Array(String) | Nil = nil, group_by : Array(String) | Nil = nil, limit : Int64 | Nil = nil, page : String | Nil = nil) : UsageResponse

Embeddings Get embeddings usage details for the organization.

Source
usage_images(start_time : Int64, end_time : Int64 | Nil = nil, bucket_width : String | Nil = nil, sources : Array(String) | Nil = nil, sizes : Array(String) | Nil = nil, project_ids : Array(String) | Nil = nil, user_ids : Array(String) | Nil = nil, api_key_ids : Array(String) | Nil = nil, models : Array(String) | Nil = nil, group_by : Array(String) | Nil = nil, limit : Int64 | Nil = nil, page : String | Nil = nil) : UsageResponse

Images Get images usage details for the organization.

Source
usage_moderations(start_time : Int64, end_time : Int64 | Nil = nil, bucket_width : String | Nil = nil, project_ids : Array(String) | Nil = nil, user_ids : Array(String) | Nil = nil, api_key_ids : Array(String) | Nil = nil, models : Array(String) | Nil = nil, group_by : Array(String) | Nil = nil, limit : Int64 | Nil = nil, page : String | Nil = nil) : UsageResponse

Moderations Get moderations usage details for the organization.

Source
usage_vector_stores(start_time : Int64, end_time : Int64 | Nil = nil, bucket_width : String | Nil = nil, project_ids : Array(String) | Nil = nil, group_by : Array(String) | Nil = nil, limit : Int64 | Nil = nil, page : String | Nil = nil) : UsageResponse

Vector stores Get vector stores usage details for the organization.

Source
validate_grader(request_body : ValidateGraderRequest) : ValidateGraderResponse

Validate grader Validate a grader.

Source