All URIs are relative to https://api.openai.com/v1
Method | HTTP request | Description |
---|---|---|
cancelRun | POST /threads/{thread_id}/runs/{run_id}/cancel | Cancels a run that is `in_progress`. |
createAssistant | POST /assistants | Create an assistant with a model and instructions. |
createMessage | POST /threads/{thread_id}/messages | Create a message. |
createRun | POST /threads/{thread_id}/runs | Create a run. |
createThread | POST /threads | Create a thread. |
createThreadAndRun | POST /threads/runs | Create a thread and run it in one request. |
deleteAssistant | DELETE /assistants/{assistant_id} | Delete an assistant. |
deleteMessage | DELETE /threads/{thread_id}/messages/{message_id} | Deletes a message. |
deleteThread | DELETE /threads/{thread_id} | Delete a thread. |
getAssistant | GET /assistants/{assistant_id} | Retrieves an assistant. |
getMessage | GET /threads/{thread_id}/messages/{message_id} | Retrieve a message. |
getRun | GET /threads/{thread_id}/runs/{run_id} | Retrieves a run. |
getRunStep | GET /threads/{thread_id}/runs/{run_id}/steps/{step_id} | Retrieves a run step. |
getThread | GET /threads/{thread_id} | Retrieves a thread. |
listAssistants | GET /assistants | Returns a list of assistants. |
listMessages | GET /threads/{thread_id}/messages | Returns a list of messages for a given thread. |
listRunSteps | GET /threads/{thread_id}/runs/{run_id}/steps | Returns a list of run steps belonging to a run. |
listRuns | GET /threads/{thread_id}/runs | Returns a list of runs belonging to a thread. |
modifyAssistant | POST /assistants/{assistant_id} | Modifies an assistant. |
modifyMessage | POST /threads/{thread_id}/messages/{message_id} | Modifies a message. |
modifyRun | POST /threads/{thread_id}/runs/{run_id} | Modifies a run. |
modifyThread | POST /threads/{thread_id} | Modifies a thread. |
submitToolOuputsToRun | POST /threads/{thread_id}/runs/{run_id}/submit_tool_outputs | 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. |
RunObject cancelRun(threadId, runId)
Cancels a run that is `in_progress`.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the thread to which this run belongs.
String runId = "runId_example"; // String | The ID of the run to cancel.
try {
RunObject result = apiInstance.cancelRun(threadId, runId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#cancelRun");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread to which this run belongs. | |
runId | String | The ID of the run to cancel. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
AssistantObject createAssistant(createAssistantRequest)
Create an assistant with a model and instructions.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
CreateAssistantRequest createAssistantRequest = new CreateAssistantRequest(); // CreateAssistantRequest |
try {
AssistantObject result = apiInstance.createAssistant(createAssistantRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#createAssistant");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
createAssistantRequest | CreateAssistantRequest |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
MessageObject createMessage(threadId, createMessageRequest)
Create a message.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the [thread](/docs/api-reference/threads) to create a message for.
CreateMessageRequest createMessageRequest = new CreateMessageRequest(); // CreateMessageRequest |
try {
MessageObject result = apiInstance.createMessage(threadId, createMessageRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#createMessage");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread to create a message for. | |
createMessageRequest | CreateMessageRequest |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
RunObject createRun(threadId, createRunRequest, include)
Create a run.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the thread to run.
CreateRunRequest createRunRequest = new CreateRunRequest(); // CreateRunRequest |
List<String> include = Arrays.asList(); // List<String> | A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. See the [file search tool documentation](/docs/assistants/tools/file-search/customizing-file-search-settings) for more information.
try {
RunObject result = apiInstance.createRun(threadId, createRunRequest, include);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#createRun");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread to run. | |
createRunRequest | CreateRunRequest | ||
include | List<String> | A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[].file_search.results[].content` to fetch the file search result content. See the file search tool documentation for more information. | [optional] [enum: step_details.tool_calls[].file_search.results[].content] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
ThreadObject createThread(createThreadRequest)
Create a thread.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
CreateThreadRequest createThreadRequest = new CreateThreadRequest(); // CreateThreadRequest |
try {
ThreadObject result = apiInstance.createThread(createThreadRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#createThread");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
createThreadRequest | CreateThreadRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
RunObject createThreadAndRun(createThreadAndRunRequest)
Create a thread and run it in one request.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
CreateThreadAndRunRequest createThreadAndRunRequest = new CreateThreadAndRunRequest(); // CreateThreadAndRunRequest |
try {
RunObject result = apiInstance.createThreadAndRun(createThreadAndRunRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#createThreadAndRun");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
createThreadAndRunRequest | CreateThreadAndRunRequest |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
DeleteAssistantResponse deleteAssistant(assistantId)
Delete an assistant.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String assistantId = "assistantId_example"; // String | The ID of the assistant to delete.
try {
DeleteAssistantResponse result = apiInstance.deleteAssistant(assistantId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#deleteAssistant");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
assistantId | String | The ID of the assistant to delete. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
DeleteMessageResponse deleteMessage(threadId, messageId)
Deletes a message.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the thread to which this message belongs.
String messageId = "messageId_example"; // String | The ID of the message to delete.
try {
DeleteMessageResponse result = apiInstance.deleteMessage(threadId, messageId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#deleteMessage");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread to which this message belongs. | |
messageId | String | The ID of the message to delete. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
DeleteThreadResponse deleteThread(threadId)
Delete a thread.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the thread to delete.
try {
DeleteThreadResponse result = apiInstance.deleteThread(threadId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#deleteThread");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread to delete. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
AssistantObject getAssistant(assistantId)
Retrieves an assistant.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String assistantId = "assistantId_example"; // String | The ID of the assistant to retrieve.
try {
AssistantObject result = apiInstance.getAssistant(assistantId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#getAssistant");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
assistantId | String | The ID of the assistant to retrieve. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
MessageObject getMessage(threadId, messageId)
Retrieve a message.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the [thread](/docs/api-reference/threads) to which this message belongs.
String messageId = "messageId_example"; // String | The ID of the message to retrieve.
try {
MessageObject result = apiInstance.getMessage(threadId, messageId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#getMessage");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread to which this message belongs. | |
messageId | String | The ID of the message to retrieve. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
RunObject getRun(threadId, runId)
Retrieves a run.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the [thread](/docs/api-reference/threads) that was run.
String runId = "runId_example"; // String | The ID of the run to retrieve.
try {
RunObject result = apiInstance.getRun(threadId, runId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#getRun");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread that was run. | |
runId | String | The ID of the run to retrieve. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
RunStepObject getRunStep(threadId, runId, stepId, include)
Retrieves a run step.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the thread to which the run and run step belongs.
String runId = "runId_example"; // String | The ID of the run to which the run step belongs.
String stepId = "stepId_example"; // String | The ID of the run step to retrieve.
List<String> include = Arrays.asList(); // List<String> | A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. See the [file search tool documentation](/docs/assistants/tools/file-search/customizing-file-search-settings) for more information.
try {
RunStepObject result = apiInstance.getRunStep(threadId, runId, stepId, include);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#getRunStep");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread to which the run and run step belongs. | |
runId | String | The ID of the run to which the run step belongs. | |
stepId | String | The ID of the run step to retrieve. | |
include | List<String> | A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[].file_search.results[].content` to fetch the file search result content. See the file search tool documentation for more information. | [optional] [enum: step_details.tool_calls[].file_search.results[].content] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
ThreadObject getThread(threadId)
Retrieves a thread.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the thread to retrieve.
try {
ThreadObject result = apiInstance.getThread(threadId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#getThread");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread to retrieve. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
ListAssistantsResponse listAssistants(limit, order, after, before)
Returns a list of assistants.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
Integer limit = 20; // Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
String order = "asc"; // String | Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
String after = "after_example"; // String | 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.
String before = "before_example"; // String | 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.
try {
ListAssistantsResponse result = apiInstance.listAssistants(limit, order, after, before);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#listAssistants");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
limit | Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. | [optional] [default to 20] |
order | String | Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. | [optional] [default to desc] [enum: asc, desc] |
after | String | 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. | [optional] |
before | String | 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. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
ListMessagesResponse listMessages(threadId, limit, order, after, before, runId)
Returns a list of messages for a given thread.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the [thread](/docs/api-reference/threads) the messages belong to.
Integer limit = 20; // Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
String order = "asc"; // String | Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
String after = "after_example"; // String | 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.
String before = "before_example"; // String | 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.
String runId = "runId_example"; // String | Filter messages by the run ID that generated them.
try {
ListMessagesResponse result = apiInstance.listMessages(threadId, limit, order, after, before, runId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#listMessages");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread the messages belong to. | |
limit | Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. | [optional] [default to 20] |
order | String | Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. | [optional] [default to desc] [enum: asc, desc] |
after | String | 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. | [optional] |
before | String | 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. | [optional] |
runId | String | Filter messages by the run ID that generated them. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
ListRunStepsResponse listRunSteps(threadId, runId, limit, order, after, before, include)
Returns a list of run steps belonging to a run.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the thread the run and run steps belong to.
String runId = "runId_example"; // String | The ID of the run the run steps belong to.
Integer limit = 20; // Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
String order = "asc"; // String | Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
String after = "after_example"; // String | 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.
String before = "before_example"; // String | 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.
List<String> include = Arrays.asList(); // List<String> | A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. See the [file search tool documentation](/docs/assistants/tools/file-search/customizing-file-search-settings) for more information.
try {
ListRunStepsResponse result = apiInstance.listRunSteps(threadId, runId, limit, order, after, before, include);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#listRunSteps");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread the run and run steps belong to. | |
runId | String | The ID of the run the run steps belong to. | |
limit | Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. | [optional] [default to 20] |
order | String | Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. | [optional] [default to desc] [enum: asc, desc] |
after | String | 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. | [optional] |
before | String | 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. | [optional] |
include | List<String> | A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[].file_search.results[].content` to fetch the file search result content. See the file search tool documentation for more information. | [optional] [enum: step_details.tool_calls[].file_search.results[].content] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
ListRunsResponse listRuns(threadId, limit, order, after, before)
Returns a list of runs belonging to a thread.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the thread the run belongs to.
Integer limit = 20; // Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
String order = "asc"; // String | Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order.
String after = "after_example"; // String | 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.
String before = "before_example"; // String | 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.
try {
ListRunsResponse result = apiInstance.listRuns(threadId, limit, order, after, before);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#listRuns");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread the run belongs to. | |
limit | Integer | A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. | [optional] [default to 20] |
order | String | Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. | [optional] [default to desc] [enum: asc, desc] |
after | String | 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. | [optional] |
before | String | 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. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
AssistantObject modifyAssistant(assistantId, modifyAssistantRequest)
Modifies an assistant.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String assistantId = "assistantId_example"; // String | The ID of the assistant to modify.
ModifyAssistantRequest modifyAssistantRequest = new ModifyAssistantRequest(); // ModifyAssistantRequest |
try {
AssistantObject result = apiInstance.modifyAssistant(assistantId, modifyAssistantRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#modifyAssistant");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
assistantId | String | The ID of the assistant to modify. | |
modifyAssistantRequest | ModifyAssistantRequest |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
MessageObject modifyMessage(threadId, messageId, modifyMessageRequest)
Modifies a message.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the thread to which this message belongs.
String messageId = "messageId_example"; // String | The ID of the message to modify.
ModifyMessageRequest modifyMessageRequest = new ModifyMessageRequest(); // ModifyMessageRequest |
try {
MessageObject result = apiInstance.modifyMessage(threadId, messageId, modifyMessageRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#modifyMessage");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread to which this message belongs. | |
messageId | String | The ID of the message to modify. | |
modifyMessageRequest | ModifyMessageRequest |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
RunObject modifyRun(threadId, runId, modifyRunRequest)
Modifies a run.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the [thread](/docs/api-reference/threads) that was run.
String runId = "runId_example"; // String | The ID of the run to modify.
ModifyRunRequest modifyRunRequest = new ModifyRunRequest(); // ModifyRunRequest |
try {
RunObject result = apiInstance.modifyRun(threadId, runId, modifyRunRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#modifyRun");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread that was run. | |
runId | String | The ID of the run to modify. | |
modifyRunRequest | ModifyRunRequest |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
ThreadObject modifyThread(threadId, modifyThreadRequest)
Modifies a thread.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the thread to modify. Only the `metadata` can be modified.
ModifyThreadRequest modifyThreadRequest = new ModifyThreadRequest(); // ModifyThreadRequest |
try {
ThreadObject result = apiInstance.modifyThread(threadId, modifyThreadRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#modifyThread");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread to modify. Only the `metadata` can be modified. | |
modifyThreadRequest | ModifyThreadRequest |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
RunObject submitToolOuputsToRun(threadId, runId, submitToolOutputsRunRequest)
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.
// Import classes:
import com.github.ainoya.client.ApiClient;
import com.github.ainoya.client.ApiException;
import com.github.ainoya.client.Configuration;
import com.github.ainoya.client.auth.*;
import com.github.ainoya.client.models.*;
import com.github.ainoya.openai.client.api.AssistantsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.openai.com/v1");
// Configure HTTP bearer authorization: ApiKeyAuth
HttpBearerAuth ApiKeyAuth = (HttpBearerAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setBearerToken("BEARER TOKEN");
AssistantsApi apiInstance = new AssistantsApi(defaultClient);
String threadId = "threadId_example"; // String | The ID of the [thread](/docs/api-reference/threads) to which this run belongs.
String runId = "runId_example"; // String | The ID of the run that requires the tool output submission.
SubmitToolOutputsRunRequest submitToolOutputsRunRequest = new SubmitToolOutputsRunRequest(); // SubmitToolOutputsRunRequest |
try {
RunObject result = apiInstance.submitToolOuputsToRun(threadId, runId, submitToolOutputsRunRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AssistantsApi#submitToolOuputsToRun");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
threadId | String | The ID of the thread to which this run belongs. | |
runId | String | The ID of the run that requires the tool output submission. | |
submitToolOutputsRunRequest | SubmitToolOutputsRunRequest |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |