Interface OpenAiApi
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single<FineTuningJob> cancelFineTuningJob(String fineTuningJobId) Cancel fine-tuningio.reactivex.rxjava3.core.Single<Run> cancelThreadRun(String threadId, String runId) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/cancelio.reactivex.rxjava3.core.Single<Assistant> createAssistant(CreateAssistantRequest request) https://api.openai.com/v1/assistantsio.reactivex.rxjava3.core.Single<AssistantFile> createAssistantFile(String assistantId, CreateAssistantFileRequest request) https://api.openai.com/v1/assistants/{assistant_id}/filesio.reactivex.rxjava3.core.Single<AudioResponse> createAudioTranscription(okhttp3.RequestBody request) Create transcriptionBeta Transcribes audio into the input language.io.reactivex.rxjava3.core.Single<AudioResponse> createAudioTranslation(okhttp3.RequestBody request) Create translationBeta Translates audio into English.io.reactivex.rxjava3.core.Single<ChatCompletion> Create chat completionBeta Creates a completion for the chat messageio.reactivex.rxjava3.core.Single<CreateEmbeddingResponse> createEmbedding(CreateEmbeddingRequest request) Create embeddings Creates an embedding vector representing the input text.io.reactivex.rxjava3.core.Single<FineTuningJob> Create fine-tuning jobio.reactivex.rxjava3.core.Single<ImageResponse> createImage(CreateImageRequest request) Create image Beta Creates an image given a prompt.io.reactivex.rxjava3.core.Single<ImageResponse> createImageEdit(okhttp3.RequestBody request) Create image editBeta Creates an edited or extended image given an original image and a prompt.io.reactivex.rxjava3.core.Single<ImageResponse> createImageVariation(okhttp3.RequestBody request) Create image variationBeta Creates a variation of a given image.io.reactivex.rxjava3.core.Single<CreateModerationResponse> createModeration(CreateModerationRequest request) Create moderation Classifies if text violates OpenAI's Content Policyio.reactivex.rxjava3.core.Single<okhttp3.ResponseBody> createSpeech(CreateSpeechRequest request) Generates audio from the input text.io.reactivex.rxjava3.core.Single<Thread> createThread(CreateThreadRequest request) https://api.openai.com/v1/threadsio.reactivex.rxjava3.core.Single<Run> https://api.openai.com/v1/threads/runsio.reactivex.rxjava3.core.Single<Message> createThreadMessage(String threadId, CreateMessageRequest request) https://api.openai.com/v1/threads/{thread_id}/messagesio.reactivex.rxjava3.core.Single<Run> createThreadRun(String threadId, CreateRunRequest request) https://api.openai.com/v1/threads/{thread_id}/runsio.reactivex.rxjava3.core.Single<DeleteResponse> deleteAssistant(String assistantId) https://api.openai.com/v1/assistants/{assistant_id}io.reactivex.rxjava3.core.Single<DeleteResponse> deleteAssistantFile(String assistantId, String fileId) https://api.openai.com/v1/assistants/{assistant_id}/files/{file_id}io.reactivex.rxjava3.core.Single<DeleteResponse> deleteFile(String fileId) Delete fileio.reactivex.rxjava3.core.Single<DeleteResponse> deleteThread(String threadId) https://api.openai.com/v1/threads/{thread_id}io.reactivex.rxjava3.core.Single<Model> Retrieve modelio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<AssistantFile>> https://api.openai.com/v1/assistants/{assistant_id}/filesio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Assistant>> listAssistants(Integer limit, String order, String after, String before) https://api.openai.com/v1/assistantsio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<File>> List filesio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<FineTuningJobEvent>> listFineTuningEvents(String fineTuningJobId, String after, Integer limit) List fine-tuning eventsio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Model>> List modelsio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<MessageFile>> listThreadMessageFiles(String threadId, String messageId, Integer limit, String order, String after, String before) https://api.openai.com/v1/threads/{thread_id}/messages/{message_id}/filesio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Message>> https://api.openai.com/v1/threads/{thread_id}/messagesio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Run>> https://api.openai.com/v1/threads/{thread_id}/runsio.reactivex.rxjava3.core.Single<OpenAiApiListResponse<RunStep>> listThreadRunSteps(String threadId, String runId, Integer limit, String order, String after, String before) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/stepsio.reactivex.rxjava3.core.Single<Assistant> modifyAssistant(String assistantId, ModifyAssistantRequest request) https://api.openai.com/v1/assistants/{assistant_id}io.reactivex.rxjava3.core.Single<Thread> modifyThread(String threadId, ModifyThreadRequest request) https://api.openai.com/v1/threads/{thread_id}io.reactivex.rxjava3.core.Single<Message> modifyThreadMessage(String threadId, String messageId, ModifyMessageRequest request) https://api.openai.com/v1/threads/{thread_id}/messages/{message_id}io.reactivex.rxjava3.core.Single<Run> modifyThreadRun(String threadId, String runId, ModifyRunRequest request) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}io.reactivex.rxjava3.core.Single<Assistant> retrieveAssistant(String assistantId) https://api.openai.com/v1/assistants/{assistant_id}io.reactivex.rxjava3.core.Single<AssistantFile> retrieveAssistantFile(String assistantId, String fileId) https://api.openai.com/v1/assistants/{assistant_id}/files/{file_id}io.reactivex.rxjava3.core.Single<File> retrieveFile(String fileId) Retrieve fileio.reactivex.rxjava3.core.Single<String> retrieveFileContent(String fileId) Retrieve file contentio.reactivex.rxjava3.core.Single<FineTuningJob> retrieveFineTuningJob(String fineTuningJobId) Retrieve fine-tuning jobio.reactivex.rxjava3.core.Single<Thread> retrieveThread(String threadId) https://api.openai.com/v1/threads/{thread_id}io.reactivex.rxjava3.core.Single<Message> retrieveThreadMessage(String threadId, String messageId) https://api.openai.com/v1/threads/{thread_id}/messages/{message_id}io.reactivex.rxjava3.core.Single<MessageFile> retrieveThreadMessageFile(String threadId, String messageId, String fileId) https://api.openai.com/v1/threads/{thread_id}/messages/{message_id}/files/{file_id}io.reactivex.rxjava3.core.Single<Run> retrieveThreadRun(String threadId, String runId) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}io.reactivex.rxjava3.core.Single<RunStep> retrieveThreadRunStep(String threadId, String runId, String stepId) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id}io.reactivex.rxjava3.core.Single<Run> submitToolOutputs(String threadId, String runId, SubmitToolOutputsRequest request) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputsio.reactivex.rxjava3.core.Single<File> uploadFile(okhttp3.MultipartBody.Part file, okhttp3.RequestBody purpose) Upload file
-
Method Details
-
listModels
List models- Returns:
- Lists the currently available models, and provides basic information about each one such as the owner and availability.
-
getModel
@GET("/v1/models/{model_id}") io.reactivex.rxjava3.core.Single<Model> getModel(@Path("model_id") String modelId) Retrieve model- Parameters:
modelId- model ID- Returns:
- Retrieves a model instance, providing basic information about the model such as the owner and permission.
-
createChatCompletion
@POST("/v1/chat/completions") io.reactivex.rxjava3.core.Single<ChatCompletion> createChatCompletion(@Body CreateChatCompletionRequest request) Create chat completionBeta Creates a completion for the chat message- Parameters:
request- Create chat completion request- Returns:
- Chat Completion information
-
createImage
@POST("/v1/images/generations") io.reactivex.rxjava3.core.Single<ImageResponse> createImage(@Body CreateImageRequest request) Create image Beta Creates an image given a prompt.- Parameters:
request- create image request- Returns:
- Image Information Wrapper
-
createImageEdit
@POST("/v1/images/edits") io.reactivex.rxjava3.core.Single<ImageResponse> createImageEdit(@Body okhttp3.RequestBody request) Create image editBeta Creates an edited or extended image given an original image and a prompt.- Parameters:
request- request body- Returns:
- Image Information Wrapper
-
createImageVariation
@POST("/v1/images/variations") io.reactivex.rxjava3.core.Single<ImageResponse> createImageVariation(@Body okhttp3.RequestBody request) Create image variationBeta Creates a variation of a given image.- Parameters:
request- request body- Returns:
- Image Information Wrapper
-
createEmbedding
@POST("/v1/embeddings") io.reactivex.rxjava3.core.Single<CreateEmbeddingResponse> createEmbedding(@Body CreateEmbeddingRequest request) Create embeddings Creates an embedding vector representing the input text.- Parameters:
request- create embedding request- Returns:
- Embeddings
-
createSpeech
@POST("/v1/audio/speech") io.reactivex.rxjava3.core.Single<okhttp3.ResponseBody> createSpeech(@Body CreateSpeechRequest request) Generates audio from the input text.- Parameters:
request- create speech request- Returns:
- audio file
-
createAudioTranscription
@POST("/v1/audio/transcriptions") io.reactivex.rxjava3.core.Single<AudioResponse> createAudioTranscription(@Body okhttp3.RequestBody request) Create transcriptionBeta Transcribes audio into the input language.- Parameters:
request- body- Returns:
- Text of audio
-
createAudioTranslation
@POST("/v1/audio/translations") io.reactivex.rxjava3.core.Single<AudioResponse> createAudioTranslation(@Body okhttp3.RequestBody request) Create translationBeta Translates audio into English.- Parameters:
request- body- Returns:
- Text of audio
-
createModeration
@POST("/v1/moderations") io.reactivex.rxjava3.core.Single<CreateModerationResponse> createModeration(@Body CreateModerationRequest request) Create moderation Classifies if text violates OpenAI's Content Policy- Parameters:
request- create moderation request- Returns:
- Moderation
-
listFiles
List filesRReturns a list of files that belong to the user's organization.
- Returns:
- A list of
Fileobjects.
-
uploadFile
@Multipart @POST("/v1/files") io.reactivex.rxjava3.core.Single<File> uploadFile(@Part okhttp3.MultipartBody.Part file, @Part("purpose") okhttp3.RequestBody purpose) Upload fileUpload a file that can be used across various endpoints. The size of all the files uploaded by one organization can be up to 100 GB.
The size of individual files can be a maximum of 512 MB or 2 million tokens for Assistants. See the Assistants Tools guide to learn more about the types of files supported. The Fine-tuning API only supports .jsonl files.
Please contact us if you need to increase these storage limits.
- Parameters:
file- The File object (not file name) to be uploaded.purpose- The intended purpose of the uploaded file. Use "fine-tune" for Fine-tuning and "assistants" for Assistants and Messages. This allows us to validate the format of the uploaded file is correct for fine-tuning.- Returns:
- The uploaded
Fileobject.
-
deleteFile
@DELETE("/v1/files/{file_id}") io.reactivex.rxjava3.core.Single<DeleteResponse> deleteFile(@Path("file_id") String fileId) Delete fileDelete a file.
- Parameters:
fileId- fileId- Returns:
- Deletion status
-
retrieveFile
@GET("/v1/files/{file_id}") io.reactivex.rxjava3.core.Single<File> retrieveFile(@Path("file_id") String fileId) Retrieve fileReturns information about a specific file.
- Parameters:
fileId- fileId- Returns:
- The
Fileobject matching the specified ID.
-
retrieveFileContent
@GET("/v1/files/{file_id}/content") io.reactivex.rxjava3.core.Single<String> retrieveFileContent(@Path("file_id") String fileId) Retrieve file contentReturns the contents of the specified file.
- Parameters:
fileId- The ID of the file to use for this request.- Returns:
- The file content.
-
createFineTuningJob
@POST("/v1/fine_tuning/jobs") io.reactivex.rxjava3.core.Single<FineTuningJob> createFineTuningJob(@Body CreateFineTuningJobRequest request) Create fine-tuning jobCreates a job that fine-tunes a specified 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.
- Parameters:
request- create fine tuning job request- Returns:
- A
FineTuningJobobject.
-
cancelFineTuningJob
@POST("/v1/fine_tuning/jobs/{fine_tuning_job_id}/cancel") io.reactivex.rxjava3.core.Single<FineTuningJob> cancelFineTuningJob(@Path("fine_tuning_job_id") String fineTuningJobId) Cancel fine-tuningImmediately cancel a fine-tune job.
- Parameters:
fineTuningJobId- The ID of the fine-tuning job to cancel.- Returns:
- The cancelled
FineTuningJobobject.
-
retrieveFineTuningJob
@GET("/v1/fine_tuning/jobs/{fine_tuning_job_id}") io.reactivex.rxjava3.core.Single<FineTuningJob> retrieveFineTuningJob(@Path("fine_tuning_job_id") String fineTuningJobId) Retrieve fine-tuning jobGet info about a fine-tuning job.
- Parameters:
fineTuningJobId- The ID of the fine-tuning job.- Returns:
- The
FineTuningJobobject with the given ID.
-
listFineTuningEvents
@GET("/v1/fine_tuning/jobs/{fine_tuning_job_id}/events") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<FineTuningJobEvent>> listFineTuningEvents(@Path("fine_tuning_job_id") String fineTuningJobId, @Query("after") String after, @Query("limit") Integer limit) List fine-tuning eventsGet status updates for a fine-tuning job.
- Parameters:
fineTuningJobId- The ID of the fine-tuning job to get events for.after- Optional Identifier for the last event from the previous pagination request.limit- Optional Defaults to 20 Number of events to retrieve.- Returns:
- A list of fine-tuning event objects.
-
createAssistant
@POST("/v1/assistants") io.reactivex.rxjava3.core.Single<Assistant> createAssistant(@Body CreateAssistantRequest request) https://api.openai.com/v1/assistantsCreate an assistant with a model and instructions.
- Parameters:
request- Request body- Returns:
- An
Assistantobject.
-
retrieveAssistant
@GET("/v1/assistants/{assistant_id}") io.reactivex.rxjava3.core.Single<Assistant> retrieveAssistant(@Path("assistant_id") String assistantId) https://api.openai.com/v1/assistants/{assistant_id}The assistant object matching the specified ID.
- Parameters:
assistantId- The ID of the assistant to retrieve.- Returns:
- The ID of the
Assistantto retrieve.
-
modifyAssistant
@POST("/v1/assistants/{assistant_id}") io.reactivex.rxjava3.core.Single<Assistant> modifyAssistant(@Path("assistant_id") String assistantId, @Body ModifyAssistantRequest request) https://api.openai.com/v1/assistants/{assistant_id}Modifies an assistant.
- Parameters:
assistantId- The ID of the assistant to modify.request- Request body- Returns:
- The modified
Assistantobject.
-
deleteAssistant
@DELETE("/v1/assistants/{assistant_id}") io.reactivex.rxjava3.core.Single<DeleteResponse> deleteAssistant(@Path("assistant_id") String assistantId) https://api.openai.com/v1/assistants/{assistant_id}Delete an assistant.
- Parameters:
assistantId- The ID of the assistant to delete.- Returns:
- Deletion status
-
listAssistants
@GET("/v1/assistants") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Assistant>> listAssistants(@Query("limit") Integer limit, @Query("order") String order, @Query("after") String after, @Query("before") String before) https://api.openai.com/v1/assistantsReturns a list of assistants.
- Parameters:
limit- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.order- Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.after- A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.before- A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.- Returns:
- A list of
Assistantobjects.
-
createAssistantFile
@POST("/v1/assistants/{assistant_id}/files") io.reactivex.rxjava3.core.Single<AssistantFile> createAssistantFile(@Path("assistant_id") String assistantId, @Body CreateAssistantFileRequest request) https://api.openai.com/v1/assistants/{assistant_id}/filesCreate assistant file
- Parameters:
assistantId- The ID of the assistant for which to create a File.request- Request body- Returns:
- An
AssistantFileobject.
-
retrieveAssistantFile
@GET("/v1/assistants/{assistant_id}/files/{file_id}") io.reactivex.rxjava3.core.Single<AssistantFile> retrieveAssistantFile(@Path("assistant_id") String assistantId, @Path("file_id") String fileId) https://api.openai.com/v1/assistants/{assistant_id}/files/{file_id}Retrieve assistant file
- Parameters:
assistantId- The ID of the assistant who the file belongs to.fileId- The ID of the file we're getting.- Returns:
- The
AssistantFileobject matching the specified ID.
-
deleteAssistantFile
@DELETE("/v1/assistants/{assistant_id}/files/{file_id}") io.reactivex.rxjava3.core.Single<DeleteResponse> deleteAssistantFile(@Path("assistant_id") String assistantId, @Path("file_id") String fileId) https://api.openai.com/v1/assistants/{assistant_id}/files/{file_id}Delete an assistant file.
- Parameters:
assistantId- The ID of the assistant who the file belongs to.fileId- The ID of the file to delete.- Returns:
- Deletion status
-
listAssistantFiles
@GET("/v1/assistants/{assistant_id}/files") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<AssistantFile>> listAssistantFiles(@Path("assistant_id") String assistantId, @Query("limit") Integer limit, @Query("order") String order, @Query("after") String after, @Query("before") String before) https://api.openai.com/v1/assistants/{assistant_id}/filesReturns a list of assistant files.
- Parameters:
assistantId- The ID of the assistant the file belongs to.limit- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.order- Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.after- A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.before- A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.- Returns:
- A list of
AssistantFileobjects.
-
createThread
@POST("/v1/threads") io.reactivex.rxjava3.core.Single<Thread> createThread(@Body CreateThreadRequest request) https://api.openai.com/v1/threadsCreate thread
- Parameters:
request- Request body- Returns:
- An
Threadobject.
-
retrieveThread
@GET("/v1/threads/{thread_id}") io.reactivex.rxjava3.core.Single<Thread> retrieveThread(@Path("thread_id") String threadId) https://api.openai.com/v1/threads/{thread_id}Retrieve thread
- Parameters:
threadId- The ID of the thread to retrieve.- Returns:
- The
Threadobject matching the specified ID.
-
modifyThread
@POST("/v1/threads/{thread_id}") io.reactivex.rxjava3.core.Single<Thread> modifyThread(@Path("thread_id") String threadId, @Body ModifyThreadRequest request) https://api.openai.com/v1/threads/{thread_id}Modify thread
- Parameters:
threadId- The ID of the thread to modify. Only the metadata can be modified.request- Request body- Returns:
- The modified
Threadobject matching the specified ID.
-
deleteThread
@DELETE("/v1/threads/{thread_id}") io.reactivex.rxjava3.core.Single<DeleteResponse> deleteThread(@Path("thread_id") String threadId) https://api.openai.com/v1/threads/{thread_id}Delete thread
- Parameters:
threadId- The ID of the thread to delete.- Returns:
- Deletion status
-
createThreadMessage
@POST("/v1/threads/{thread_id}/messages") io.reactivex.rxjava3.core.Single<Message> createThreadMessage(@Path("thread_id") String threadId, @Body CreateMessageRequest request) https://api.openai.com/v1/threads/{thread_id}/messagesCreate message
-
retrieveThreadMessage
@GET("/v1/threads/{thread_id}/messages/{message_id}") io.reactivex.rxjava3.core.Single<Message> retrieveThreadMessage(@Path("thread_id") String threadId, @Path("message_id") String messageId) https://api.openai.com/v1/threads/{thread_id}/messages/{message_id}Retrieve message
-
modifyThreadMessage
@POST("/v1/threads/{thread_id}/messages/{message_id}") io.reactivex.rxjava3.core.Single<Message> modifyThreadMessage(@Path("thread_id") String threadId, @Path("message_id") String messageId, @Body ModifyMessageRequest request) https://api.openai.com/v1/threads/{thread_id}/messages/{message_id}Modify message
- Parameters:
threadId- The ID of the thread to which this message belongs.messageId- The ID of the message to modify.request- Request body- Returns:
- The modified
Messageobject.
-
listThreadMessages
@GET("/v1/threads/{thread_id}/messages") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Message>> listThreadMessages(@Path("thread_id") String threadId, @Query("limit") Integer limit, @Query("order") String order, @Query("after") String after, @Query("before") String before) https://api.openai.com/v1/threads/{thread_id}/messagesList messages
- Parameters:
threadId- The ID of theThreadthe messages belong to.limit- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.order- Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.after- A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.before- A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.- Returns:
- A list of
Messageobjects.
-
retrieveThreadMessageFile
@GET("/v1/threads/{thread_id}/messages/{message_id}/files/{file_id}") io.reactivex.rxjava3.core.Single<MessageFile> retrieveThreadMessageFile(@Path("thread_id") String threadId, @Path("message_id") String messageId, @Path("file_id") String fileId) https://api.openai.com/v1/threads/{thread_id}/messages/{message_id}/files/{file_id}Retrieves a message file.
- Parameters:
threadId- The ID of the thread to which the message and File belong.messageId- The ID of the message the file belongs to.fileId- The ID of the file being retrieved.- Returns:
- The
MessageFileobject.
-
listThreadMessageFiles
@GET("/v1/threads/{thread_id}/messages") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<MessageFile>> listThreadMessageFiles(@Path("thread_id") String threadId, @Path("message_id") String messageId, @Query("limit") Integer limit, @Query("order") String order, @Query("after") String after, @Query("before") String before) https://api.openai.com/v1/threads/{thread_id}/messages/{message_id}/filesReturns a list of message files.
- Parameters:
threadId- The ID of the thread that the message and files belong to.messageId- The ID of the message that the files belongs to.limit- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.order- Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.after- A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.before- A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.- Returns:
- A list of
MessageFileobjects.
-
createThreadRun
@POST("/v1/threads/{thread_id}/runs") io.reactivex.rxjava3.core.Single<Run> createThreadRun(@Path("thread_id") String threadId, @Body CreateRunRequest request) https://api.openai.com/v1/threads/{thread_id}/runsCreate a run.
- Parameters:
threadId- The ID of the thread to run.request- Request body- Returns:
- An
Runobject.
-
retrieveThreadRun
@GET("/v1/threads/{thread_id}/runs/{run_id}") io.reactivex.rxjava3.core.Single<Run> retrieveThreadRun(@Path("thread_id") String threadId, @Path("run_id") String runId) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}Retrieves a run.
-
modifyThreadRun
@POST("/v1/threads/{thread_id}/runs/{run_id}") io.reactivex.rxjava3.core.Single<Run> modifyThreadRun(@Path("thread_id") String threadId, @Path("run_id") String runId, @Body ModifyRunRequest request) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}Modify message
-
listThreadRuns
@GET("/v1/threads/{thread_id}/runs") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<Run>> listThreadRuns(@Path("thread_id") String threadId, @Query("limit") Integer limit, @Query("order") String order, @Query("after") String after, @Query("before") String before) https://api.openai.com/v1/threads/{thread_id}/runsList messages
- Parameters:
threadId- The ID of theThreadthe messages belong to.limit- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.order- Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.after- A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.before- A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.- Returns:
- A list of
Runobjects.
-
submitToolOutputs
@GET("/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputs") io.reactivex.rxjava3.core.Single<Run> submitToolOutputs(@Path("thread_id") String threadId, @Path("run_id") String runId, @Body SubmitToolOutputsRequest request) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/submit_tool_outputs -
cancelThreadRun
@GET("/v1/threads/{thread_id}/runs/{run_id}/cancel") io.reactivex.rxjava3.core.Single<Run> cancelThreadRun(@Path("thread_id") String threadId, @Path("run_id") String runId) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/cancelCancels a run that is in_progress.
- Parameters:
threadId- The ID of the thread to which this run belongs.runId- The ID of the run to cancel.- Returns:
- The modified
Runobject matching the specified ID.
-
createThreadAndRun
https://api.openai.com/v1/threads/runsCreate a thread and run it in one request.
- Parameters:
request- Request body- Returns:
- A
Runobject.
-
retrieveThreadRunStep
@GET("/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id}") io.reactivex.rxjava3.core.Single<RunStep> retrieveThreadRunStep(@Path("thread_id") String threadId, @Path("run_id") String runId, @Path("step_id") String stepId) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/steps/{step_id}Retrieves a run step.
- Parameters:
threadId- The ID of the thread to which the run and run step belongs.runId- The ID of the run to which the run step belongs.stepId- The ID of the run step to retrieve.- Returns:
- The
RunStepobject matching the specified ID.
-
listThreadRunSteps
@GET("/v1/threads/{thread_id}/runs/{run_id}/steps") io.reactivex.rxjava3.core.Single<OpenAiApiListResponse<RunStep>> listThreadRunSteps(@Path("thread_id") String threadId, @Path("run_id") String runId, @Query("limit") Integer limit, @Query("order") String order, @Query("after") String after, @Query("before") String before) https://api.openai.com/v1/threads/{thread_id}/runs/{run_id}/stepsList run steps
- Parameters:
threadId- The ID of theThreadthe messages belong to.runId- The ID of the run steps belong to.limit- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.order- Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.after- A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.before- A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.- Returns:
- A list of
RunStepobjects.
-