Skip to content

Latest commit

 

History

History
1323 lines (988 loc) · 41.3 KB

File metadata and controls

1323 lines (988 loc) · 41.3 KB

OpenAIApi

All URIs are relative to https://api.openai.com/v1

Method HTTP request Description
cancelFineTune POST /fine-tunes/{fine_tune_id}/cancel Immediately cancel a fine-tune job.
createAnswer POST /answers Answers the specified question using the provided documents and examples. The endpoint first searches over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for completion.
createChatCompletion POST /chat/completions Creates a completion for the chat message
createClassification POST /classifications Classifies the specified `query` using provided examples. The endpoint first searches over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the completions endpoint. Labeled examples can be provided via an uploaded `file`, or explicitly listed in the request using the `examples` parameter for quick tests and small scale use cases.
createCompletion POST /completions Creates a completion for the provided prompt and parameters
createEdit POST /edits Creates a new edit for the provided input, instruction, and parameters.
createEmbedding POST /embeddings Creates an embedding vector representing the input text.
createFile POST /files Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
createFineTune POST /fine-tunes Creates 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. Learn more about Fine-tuning
createImage POST /images/generations Creates an image given a prompt.
createImageEdit POST /images/edits Creates an edited or extended image given an original image and a prompt.
createImageVariation POST /images/variations Creates a variation of a given image.
createModeration POST /moderations Classifies if text violates OpenAI's Content Policy
createSearch POST /engines/{engine_id}/search The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them. To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores. The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.
createTranscription POST /audio/transcriptions Transcribes audio into the input language.
createTranslation POST /audio/translations Translates audio into into English.
deleteFile DELETE /files/{file_id} Delete a file.
deleteModel DELETE /models/{model} Delete a fine-tuned model. You must have the Owner role in your organization.
downloadFile GET /files/{file_id}/content Returns the contents of the specified file
listEngines GET /engines Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
listFiles GET /files Returns a list of files that belong to the user's organization.
listFineTuneEvents GET /fine-tunes/{fine_tune_id}/events Get fine-grained status updates for a fine-tune job.
listFineTunes GET /fine-tunes List your organization's fine-tuning jobs
listModels GET /models Lists the currently available models, and provides basic information about each one such as the owner and availability.
retrieveEngine GET /engines/{engine_id} Retrieves a model instance, providing basic information about it such as the owner and availability.
retrieveFile GET /files/{file_id} Returns information about a specific file.
retrieveFineTune GET /fine-tunes/{fine_tune_id} Gets info about the fine-tune job. Learn more about Fine-tuning
retrieveModel GET /models/{model} Retrieves a model instance, providing basic information about the model such as the owner and permissioning.

cancelFineTune

FineTune cancelFineTune(fineTuneId)

Immediately cancel a fine-tune job.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val fineTuneId : kotlin.String = fineTuneId_example // kotlin.String | The ID of the fine-tune job to cancel 
try {
    val result : FineTune = apiInstance.cancelFineTune(fineTuneId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#cancelFineTune")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#cancelFineTune")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
fineTuneId kotlin.String The ID of the fine-tune job to cancel

Return type

FineTune

Authorization

No authorization required

HTTP request headers

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

createAnswer

CreateAnswerResponse createAnswer(body)

Answers the specified question using the provided documents and examples. The endpoint first searches over provided documents or files to find relevant context. The relevant context is combined with the provided examples and question to create the prompt for completion.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val body : CreateAnswerRequest =  // CreateAnswerRequest | 
try {
    val result : CreateAnswerResponse = apiInstance.createAnswer(body)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#createAnswer")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#createAnswer")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
body CreateAnswerRequest

Return type

CreateAnswerResponse

Authorization

No authorization required

HTTP request headers

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

createChatCompletion

CreateChatCompletionResponse createChatCompletion(body)

Creates a completion for the chat message

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val body : CreateChatCompletionRequest =  // CreateChatCompletionRequest | 
try {
    val result : CreateChatCompletionResponse = apiInstance.createChatCompletion(body)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#createChatCompletion")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#createChatCompletion")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
body CreateChatCompletionRequest

Return type

CreateChatCompletionResponse

Authorization

No authorization required

HTTP request headers

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

createClassification

CreateClassificationResponse createClassification(body)

Classifies the specified `query` using provided examples. The endpoint first searches over the labeled examples to select the ones most relevant for the particular query. Then, the relevant examples are combined with the query to construct a prompt to produce the final label via the completions endpoint. Labeled examples can be provided via an uploaded `file`, or explicitly listed in the request using the `examples` parameter for quick tests and small scale use cases.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val body : CreateClassificationRequest =  // CreateClassificationRequest | 
try {
    val result : CreateClassificationResponse = apiInstance.createClassification(body)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#createClassification")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#createClassification")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
body CreateClassificationRequest

Return type

CreateClassificationResponse

Authorization

No authorization required

HTTP request headers

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

createCompletion

CreateCompletionResponse createCompletion(body)

Creates a completion for the provided prompt and parameters

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val body : CreateCompletionRequest =  // CreateCompletionRequest | 
try {
    val result : CreateCompletionResponse = apiInstance.createCompletion(body)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#createCompletion")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#createCompletion")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
body CreateCompletionRequest

Return type

CreateCompletionResponse

Authorization

No authorization required

HTTP request headers

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

createEdit

CreateEditResponse createEdit(body)

Creates a new edit for the provided input, instruction, and parameters.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val body : CreateEditRequest =  // CreateEditRequest | 
try {
    val result : CreateEditResponse = apiInstance.createEdit(body)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#createEdit")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#createEdit")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
body CreateEditRequest

Return type

CreateEditResponse

Authorization

No authorization required

HTTP request headers

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

createEmbedding

CreateEmbeddingResponse createEmbedding(body)

Creates an embedding vector representing the input text.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val body : CreateEmbeddingRequest =  // CreateEmbeddingRequest | 
try {
    val result : CreateEmbeddingResponse = apiInstance.createEmbedding(body)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#createEmbedding")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#createEmbedding")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
body CreateEmbeddingRequest

Return type

CreateEmbeddingResponse

Authorization

No authorization required

HTTP request headers

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

createFile

OpenAIFile createFile(file, purpose)

Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val file : kotlin.Array<kotlin.Byte> = file_example // kotlin.Array<kotlin.Byte> | 
val purpose : kotlin.String = purpose_example // kotlin.String | 
try {
    val result : OpenAIFile = apiInstance.createFile(file, purpose)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#createFile")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#createFile")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
file kotlin.Array<kotlin.Byte>
purpose kotlin.String

Return type

OpenAIFile

Authorization

No authorization required

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

createFineTune

FineTune createFineTune(body)

Creates 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. Learn more about Fine-tuning

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val body : CreateFineTuneRequest =  // CreateFineTuneRequest | 
try {
    val result : FineTune = apiInstance.createFineTune(body)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#createFineTune")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#createFineTune")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
body CreateFineTuneRequest

Return type

FineTune

Authorization

No authorization required

HTTP request headers

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

createImage

ImagesResponse createImage(body)

Creates an image given a prompt.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val body : CreateImageRequest =  // CreateImageRequest | 
try {
    val result : ImagesResponse = apiInstance.createImage(body)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#createImage")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#createImage")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
body CreateImageRequest

Return type

ImagesResponse

Authorization

No authorization required

HTTP request headers

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

createImageEdit

ImagesResponse createImageEdit(image, mask, prompt, n, size, responseFormat, user)

Creates an edited or extended image given an original image and a prompt.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val image : kotlin.Array<kotlin.Byte> = image_example // kotlin.Array<kotlin.Byte> | 
val mask : kotlin.Array<kotlin.Byte> = mask_example // kotlin.Array<kotlin.Byte> | 
val prompt : kotlin.String = prompt_example // kotlin.String | 
val n : kotlin.Int = 56 // kotlin.Int | 
val size : kotlin.String = size_example // kotlin.String | 
val responseFormat : kotlin.String = responseFormat_example // kotlin.String | 
val user : kotlin.String = user_example // kotlin.String | 
try {
    val result : ImagesResponse = apiInstance.createImageEdit(image, mask, prompt, n, size, responseFormat, user)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#createImageEdit")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#createImageEdit")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
image kotlin.Array<kotlin.Byte>
mask kotlin.Array<kotlin.Byte>
prompt kotlin.String
n kotlin.Int [enum: 10, 1]
size kotlin.String [enum: 256x256, 512x512, 1024x1024]
responseFormat kotlin.String [enum: url, b64_json]
user kotlin.String

Return type

ImagesResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

createImageVariation

ImagesResponse createImageVariation(image, n, size, responseFormat, user)

Creates a variation of a given image.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val image : kotlin.Array<kotlin.Byte> = image_example // kotlin.Array<kotlin.Byte> | 
val n : kotlin.Int = 56 // kotlin.Int | 
val size : kotlin.String = size_example // kotlin.String | 
val responseFormat : kotlin.String = responseFormat_example // kotlin.String | 
val user : kotlin.String = user_example // kotlin.String | 
try {
    val result : ImagesResponse = apiInstance.createImageVariation(image, n, size, responseFormat, user)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#createImageVariation")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#createImageVariation")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
image kotlin.Array<kotlin.Byte>
n kotlin.Int [enum: 10, 1]
size kotlin.String [enum: 256x256, 512x512, 1024x1024]
responseFormat kotlin.String [enum: url, b64_json]
user kotlin.String

Return type

ImagesResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

createModeration

CreateModerationResponse createModeration(body)

Classifies if text violates OpenAI's Content Policy

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val body : CreateModerationRequest =  // CreateModerationRequest | 
try {
    val result : CreateModerationResponse = apiInstance.createModeration(body)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#createModeration")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#createModeration")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
body CreateModerationRequest

Return type

CreateModerationResponse

Authorization

No authorization required

HTTP request headers

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

createSearch

CreateSearchResponse createSearch(body, engineId)

The search endpoint computes similarity scores between provided query and documents. Documents can be passed directly to the API if there are no more than 200 of them. To go beyond the 200 document limit, documents can be processed offline and then used for efficient retrieval at query time. When `file` is set, the search endpoint searches over all the documents in the given file and returns up to the `max_rerank` number of documents. These documents will be returned along with their search scores. The similarity score is a positive score that usually ranges from 0 to 300 (but can sometimes go higher), where a score above 200 usually means the document is semantically similar to the query.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val body : CreateSearchRequest =  // CreateSearchRequest | 
val engineId : kotlin.String = engineId_example // kotlin.String | The ID of the engine to use for this request.  You can select one of `ada`, `babbage`, `curie`, or `davinci`.
try {
    val result : CreateSearchResponse = apiInstance.createSearch(body, engineId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#createSearch")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#createSearch")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
body CreateSearchRequest
engineId kotlin.String The ID of the engine to use for this request. You can select one of `ada`, `babbage`, `curie`, or `davinci`.

Return type

CreateSearchResponse

Authorization

No authorization required

HTTP request headers

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

createTranscription

CreateTranscriptionResponse createTranscription(file, model, prompt, responseFormat, temperature, language)

Transcribes audio into the input language.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val file : kotlin.Array<kotlin.Byte> = file_example // kotlin.Array<kotlin.Byte> | 
val model : kotlin.String = model_example // kotlin.String | 
val prompt : kotlin.String = prompt_example // kotlin.String | 
val responseFormat : kotlin.String = responseFormat_example // kotlin.String | 
val temperature : java.math.BigDecimal = 1.2 // java.math.BigDecimal | 
val language : kotlin.String = language_example // kotlin.String | 
try {
    val result : CreateTranscriptionResponse = apiInstance.createTranscription(file, model, prompt, responseFormat, temperature, language)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#createTranscription")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#createTranscription")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
file kotlin.Array<kotlin.Byte>
model kotlin.String
prompt kotlin.String
responseFormat kotlin.String
temperature java.math.BigDecimal
language kotlin.String

Return type

CreateTranscriptionResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

createTranslation

CreateTranslationResponse createTranslation(file, model, prompt, responseFormat, temperature)

Translates audio into into English.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val file : kotlin.Array<kotlin.Byte> = file_example // kotlin.Array<kotlin.Byte> | 
val model : kotlin.String = model_example // kotlin.String | 
val prompt : kotlin.String = prompt_example // kotlin.String | 
val responseFormat : kotlin.String = responseFormat_example // kotlin.String | 
val temperature : java.math.BigDecimal = 1.2 // java.math.BigDecimal | 
try {
    val result : CreateTranslationResponse = apiInstance.createTranslation(file, model, prompt, responseFormat, temperature)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#createTranslation")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#createTranslation")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
file kotlin.Array<kotlin.Byte>
model kotlin.String
prompt kotlin.String
responseFormat kotlin.String
temperature java.math.BigDecimal

Return type

CreateTranslationResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

deleteFile

DeleteFileResponse deleteFile(fileId)

Delete a file.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val fileId : kotlin.String = fileId_example // kotlin.String | The ID of the file to use for this request
try {
    val result : DeleteFileResponse = apiInstance.deleteFile(fileId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#deleteFile")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#deleteFile")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
fileId kotlin.String The ID of the file to use for this request

Return type

DeleteFileResponse

Authorization

No authorization required

HTTP request headers

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

deleteModel

DeleteModelResponse deleteModel(model)

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

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val model : kotlin.String = model_example // kotlin.String | The model to delete
try {
    val result : DeleteModelResponse = apiInstance.deleteModel(model)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#deleteModel")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#deleteModel")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
model kotlin.String The model to delete

Return type

DeleteModelResponse

Authorization

No authorization required

HTTP request headers

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

downloadFile

kotlin.String downloadFile(fileId)

Returns the contents of the specified file

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val fileId : kotlin.String = fileId_example // kotlin.String | The ID of the file to use for this request
try {
    val result : kotlin.String = apiInstance.downloadFile(fileId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#downloadFile")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#downloadFile")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
fileId kotlin.String The ID of the file to use for this request

Return type

kotlin.String

Authorization

No authorization required

HTTP request headers

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

listEngines

ListEnginesResponse listEngines()

Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
try {
    val result : ListEnginesResponse = apiInstance.listEngines()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#listEngines")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#listEngines")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

ListEnginesResponse

Authorization

No authorization required

HTTP request headers

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

listFiles

ListFilesResponse listFiles()

Returns a list of files that belong to the user's organization.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
try {
    val result : ListFilesResponse = apiInstance.listFiles()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#listFiles")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#listFiles")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

ListFilesResponse

Authorization

No authorization required

HTTP request headers

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

listFineTuneEvents

ListFineTuneEventsResponse listFineTuneEvents(fineTuneId, stream)

Get fine-grained status updates for a fine-tune job.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val fineTuneId : kotlin.String = fineTuneId_example // kotlin.String | The ID of the fine-tune job to get events for. 
val stream : kotlin.Boolean = true // kotlin.Boolean | Whether to stream events for the fine-tune job. If set to true, events will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available. The stream will terminate with a `data: [DONE]` message when the job is finished (succeeded, cancelled, or failed).  If set to false, only events generated so far will be returned. 
try {
    val result : ListFineTuneEventsResponse = apiInstance.listFineTuneEvents(fineTuneId, stream)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#listFineTuneEvents")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#listFineTuneEvents")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
fineTuneId kotlin.String The ID of the fine-tune job to get events for.
stream kotlin.Boolean Whether to stream events for the fine-tune job. If set to true, events will be sent as data-only server-sent events as they become available. The stream will terminate with a `data: [DONE]` message when the job is finished (succeeded, cancelled, or failed). If set to false, only events generated so far will be returned. [optional] [default to false]

Return type

ListFineTuneEventsResponse

Authorization

No authorization required

HTTP request headers

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

listFineTunes

ListFineTunesResponse listFineTunes()

List your organization's fine-tuning jobs

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
try {
    val result : ListFineTunesResponse = apiInstance.listFineTunes()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#listFineTunes")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#listFineTunes")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

ListFineTunesResponse

Authorization

No authorization required

HTTP request headers

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

listModels

ListModelsResponse listModels()

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

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
try {
    val result : ListModelsResponse = apiInstance.listModels()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#listModels")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#listModels")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

ListModelsResponse

Authorization

No authorization required

HTTP request headers

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

retrieveEngine

Engine retrieveEngine(engineId)

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

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val engineId : kotlin.String = engineId_example // kotlin.String | The ID of the engine to use for this request 
try {
    val result : Engine = apiInstance.retrieveEngine(engineId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#retrieveEngine")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#retrieveEngine")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
engineId kotlin.String The ID of the engine to use for this request

Return type

Engine

Authorization

No authorization required

HTTP request headers

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

retrieveFile

OpenAIFile retrieveFile(fileId)

Returns information about a specific file.

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val fileId : kotlin.String = fileId_example // kotlin.String | The ID of the file to use for this request
try {
    val result : OpenAIFile = apiInstance.retrieveFile(fileId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#retrieveFile")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#retrieveFile")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
fileId kotlin.String The ID of the file to use for this request

Return type

OpenAIFile

Authorization

No authorization required

HTTP request headers

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

retrieveFineTune

FineTune retrieveFineTune(fineTuneId)

Gets info about the fine-tune job. Learn more about Fine-tuning

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val fineTuneId : kotlin.String = fineTuneId_example // kotlin.String | The ID of the fine-tune job 
try {
    val result : FineTune = apiInstance.retrieveFineTune(fineTuneId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#retrieveFineTune")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#retrieveFineTune")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
fineTuneId kotlin.String The ID of the fine-tune job

Return type

FineTune

Authorization

No authorization required

HTTP request headers

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

retrieveModel

Model retrieveModel(model)

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

Example

// Import classes:
//import io.swagger.client.infrastructure.*
//import io.swagger.client.models.*;

val apiInstance = OpenAIApi()
val model : kotlin.String = model_example // kotlin.String | The ID of the model to use for this request
try {
    val result : Model = apiInstance.retrieveModel(model)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling OpenAIApi#retrieveModel")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling OpenAIApi#retrieveModel")
    e.printStackTrace()
}

Parameters

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

Return type

Model

Authorization

No authorization required

HTTP request headers

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