All URIs are relative to https://api.openai.com/v1
Method | HTTP request | Description |
---|---|---|
deleteModel | DELETE /models/{model} | Delete a fine-tuned model. You must have the Owner role in your organization to delete a model. |
listModels | GET /models | Lists the currently available models, and provides basic information about each one such as the owner and availability. |
retrieveModel | GET /models/{model} | Retrieves a model instance, providing basic information about the model such as the owner and permissioning. |
DeleteModelResponse deleteModel(model)
Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.
// 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.ModelsApi;
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");
ModelsApi apiInstance = new ModelsApi(defaultClient);
String model = "ft:gpt-4o-mini:acemeco:suffix:abc123"; // String | The model to delete
try {
DeleteModelResponse result = apiInstance.deleteModel(model);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ModelsApi#deleteModel");
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 |
---|---|---|---|
model | String | The model to delete |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
ListModelsResponse listModels()
Lists the currently available models, and provides basic information about each one such as the owner and availability.
// 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.ModelsApi;
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");
ModelsApi apiInstance = new ModelsApi(defaultClient);
try {
ListModelsResponse result = apiInstance.listModels();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ModelsApi#listModels");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
Model retrieveModel(model)
Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
// 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.ModelsApi;
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");
ModelsApi apiInstance = new ModelsApi(defaultClient);
String model = "gpt-4o-mini"; // String | The ID of the model to use for this request
try {
Model result = apiInstance.retrieveModel(model);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ModelsApi#retrieveModel");
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 |
---|---|---|---|
model | String | The ID of the model to use for this request |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |