Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Latest commit

 

History

History
208 lines (145 loc) · 5.68 KB

ModelsApi.md

File metadata and controls

208 lines (145 loc) · 5.68 KB

OpenapiClient::ModelsApi

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

delete_model(model)

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

Examples

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

Using the delete_model_with_http_info variant

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

Parameters

Name Type Description Notes
model String The model to delete

Return type

DeleteModelResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

list_models

list_models

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

Examples

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

Using the list_models_with_http_info variant

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

Parameters

This endpoint does not need any parameter.

Return type

ListModelsResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

retrieve_model

retrieve_model(model)

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

Examples

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

Using the retrieve_model_with_http_info variant

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

Parameters

Name Type Description Notes
model String The ID of the model to use for this request

Return type

Model

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json