All URIs are relative to https://api.openai.com/v1
Method | HTTP request | Description |
---|---|---|
delete_model | DELETE /models/{model} | Delete a fine-tuned model. You must have the Owner role in your organization to delete a model. |
list_models | GET /models | Lists the currently available models, and provides basic information about each one such as the owner and availability. |
retrieve_model | GET /models/{model} | Retrieves a model instance, providing basic information about the model such as the owner and permissioning. |
delete_model(model)
Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.
require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
# Configure Bearer authorization: ApiKeyAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = OpenapiClient::ModelsApi.new
model = 'ft:gpt-3.5-turbo:acemeco:suffix:abc123' # String | The model to delete
begin
# Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.
result = api_instance.delete_model(model)
p result
rescue OpenapiClient::ApiError => e
puts "Error when calling ModelsApi->delete_model: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> delete_model_with_http_info(model)
begin
# Delete a fine-tuned model. You must have the Owner role in your organization to delete a model.
data, status_code, headers = api_instance.delete_model_with_http_info(model)
p status_code # => 2xx
p headers # => { ... }
p data # => <DeleteModelResponse>
rescue OpenapiClient::ApiError => e
puts "Error when calling ModelsApi->delete_model_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
model | String | The model to delete |
- Content-Type: Not defined
- Accept: application/json
list_models
Lists the currently available models, and provides basic information about each one such as the owner and availability.
require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
# Configure Bearer authorization: ApiKeyAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = OpenapiClient::ModelsApi.new
begin
# Lists the currently available models, and provides basic information about each one such as the owner and availability.
result = api_instance.list_models
p result
rescue OpenapiClient::ApiError => e
puts "Error when calling ModelsApi->list_models: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> list_models_with_http_info
begin
# Lists the currently available models, and provides basic information about each one such as the owner and availability.
data, status_code, headers = api_instance.list_models_with_http_info
p status_code # => 2xx
p headers # => { ... }
p data # => <ListModelsResponse>
rescue OpenapiClient::ApiError => e
puts "Error when calling ModelsApi->list_models_with_http_info: #{e}"
end
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
retrieve_model(model)
Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
require 'time'
require 'openapi_client'
# setup authorization
OpenapiClient.configure do |config|
# Configure Bearer authorization: ApiKeyAuth
config.access_token = 'YOUR_BEARER_TOKEN'
end
api_instance = OpenapiClient::ModelsApi.new
model = 'gpt-3.5-turbo' # String | The ID of the model to use for this request
begin
# Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
result = api_instance.retrieve_model(model)
p result
rescue OpenapiClient::ApiError => e
puts "Error when calling ModelsApi->retrieve_model: #{e}"
end
This returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> retrieve_model_with_http_info(model)
begin
# Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
data, status_code, headers = api_instance.retrieve_model_with_http_info(model)
p status_code # => 2xx
p headers # => { ... }
p data # => <Model>
rescue OpenapiClient::ApiError => e
puts "Error when calling ModelsApi->retrieve_model_with_http_info: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
model | String | The ID of the model to use for this request |
- Content-Type: Not defined
- Accept: application/json