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. |
FineTune cancelFineTune(fineTuneId)
Immediately cancel a fine-tune job.
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| fineTuneId | kotlin.String | The ID of the fine-tune job to cancel |
No authorization required
- Content-Type: Not defined
- Accept: application/json
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.
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| body | CreateAnswerRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
CreateChatCompletionResponse createChatCompletion(body)
Creates a completion for the chat message
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| body | CreateChatCompletionRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
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.
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| body | CreateClassificationRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
CreateCompletionResponse createCompletion(body)
Creates a completion for the provided prompt and parameters
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| body | CreateCompletionRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
CreateEditResponse createEdit(body)
Creates a new edit for the provided input, instruction, and parameters.
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| body | CreateEditRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
CreateEmbeddingResponse createEmbedding(body)
Creates an embedding vector representing the input text.
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| body | CreateEmbeddingRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
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.
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| file | kotlin.Array<kotlin.Byte> | ||
| purpose | kotlin.String |
No authorization required
- Content-Type: multipart/form-data
- Accept: application/json
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
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| body | CreateFineTuneRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
ImagesResponse createImage(body)
Creates an image given a prompt.
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| body | CreateImageRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
ImagesResponse createImageEdit(image, mask, prompt, n, size, responseFormat, user)
Creates an edited or extended image given an original image and a prompt.
// 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()
}| 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 |
No authorization required
- Content-Type: multipart/form-data
- Accept: application/json
ImagesResponse createImageVariation(image, n, size, responseFormat, user)
Creates a variation of a given image.
// 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()
}| 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 |
No authorization required
- Content-Type: multipart/form-data
- Accept: application/json
CreateModerationResponse createModeration(body)
Classifies if text violates OpenAI's Content Policy
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| body | CreateModerationRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
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.
// 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()
}| 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`. |
No authorization required
- Content-Type: application/json
- Accept: application/json
CreateTranscriptionResponse createTranscription(file, model, prompt, responseFormat, temperature, language)
Transcribes audio into the input language.
// 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()
}| 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 |
No authorization required
- Content-Type: multipart/form-data
- Accept: application/json
CreateTranslationResponse createTranslation(file, model, prompt, responseFormat, temperature)
Translates audio into into English.
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| file | kotlin.Array<kotlin.Byte> | ||
| model | kotlin.String | ||
| prompt | kotlin.String | ||
| responseFormat | kotlin.String | ||
| temperature | java.math.BigDecimal |
No authorization required
- Content-Type: multipart/form-data
- Accept: application/json
DeleteFileResponse deleteFile(fileId)
Delete a file.
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| fileId | kotlin.String | The ID of the file to use for this request |
No authorization required
- Content-Type: Not defined
- Accept: application/json
DeleteModelResponse deleteModel(model)
Delete a fine-tuned model. You must have the Owner role in your organization.
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| model | kotlin.String | The model to delete |
No authorization required
- Content-Type: Not defined
- Accept: application/json
kotlin.String downloadFile(fileId)
Returns the contents of the specified file
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| fileId | kotlin.String | The ID of the file to use for this request |
kotlin.String
No authorization required
- Content-Type: Not defined
- Accept: application/json
ListEnginesResponse listEngines()
Lists the currently available (non-finetuned) models, and provides basic information about each one such as the owner and availability.
// 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()
}This endpoint does not need any parameter.
No authorization required
- Content-Type: Not defined
- Accept: application/json
ListFilesResponse listFiles()
Returns a list of files that belong to the user's organization.
// 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()
}This endpoint does not need any parameter.
No authorization required
- Content-Type: Not defined
- Accept: application/json
ListFineTuneEventsResponse listFineTuneEvents(fineTuneId, stream)
Get fine-grained status updates for a fine-tune job.
// 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()
}| 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] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
ListFineTunesResponse listFineTunes()
List your organization's fine-tuning jobs
// 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()
}This endpoint does not need any parameter.
No authorization required
- Content-Type: Not defined
- Accept: application/json
ListModelsResponse listModels()
Lists the currently available models, and provides basic information about each one such as the owner and availability.
// 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()
}This endpoint does not need any parameter.
No authorization required
- Content-Type: Not defined
- Accept: application/json
Engine retrieveEngine(engineId)
Retrieves a model instance, providing basic information about it such as the owner and availability.
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| engineId | kotlin.String | The ID of the engine to use for this request |
No authorization required
- Content-Type: Not defined
- Accept: application/json
OpenAIFile retrieveFile(fileId)
Returns information about a specific file.
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| fileId | kotlin.String | The ID of the file to use for this request |
No authorization required
- Content-Type: Not defined
- Accept: application/json
FineTune retrieveFineTune(fineTuneId)
Gets info about the fine-tune job. Learn more about Fine-tuning
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| fineTuneId | kotlin.String | The ID of the fine-tune job |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Model retrieveModel(model)
Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
// 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()
}| Name | Type | Description | Notes |
|---|---|---|---|
| model | kotlin.String | The ID of the model to use for this request |
No authorization required
- Content-Type: Not defined
- Accept: application/json