OpenAI API: API reference
from OpenAI APIを触ってみる
ChatGPT API
https://platform.openai.com/docs/api-reference/introduction
Models
List and describe the various models available in the API. You can refer to the Models documentation to understand what models are available and the differences between them.
List models
GET https://api.openai.com/v1/models
Lists the currently available models, and provides basic information about each one such as the owner and availability.
なんかたくさん返ってきたyosider.icon
Retrieve model
GET https://api.openai.com/v1/models/{model}
Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
Completions
Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position.
穴埋めしてくれる?Chatとは何が違う?
Create completion
POST https://api.openai.com/v1/completions
OpenAI API: Chat
Edits
Given a prompt and an instruction, the model will return an edited version of the prompt.
入力と指示を与えると、指示に沿って入力を編集してくれる
Create edit
POST https://api.openai.com/v1/edits
Images
Given a prompt and/or an input image, the model will generate a new image.
言語以外もあるのかyosider.icon
https://platform.openai.com/docs/guides/images
Create image
POST https://api.openai.com/v1/images/generations
Create image edit
POST https://api.openai.com/v1/images/edits
Creates an edited or extended image given an original image and a prompt.
Create image variation
POST https://api.openai.com/v1/images/variations
Creates a variation of a given image.
Embeddings
Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.
そんなのもあるのか!yosider.icon
encoderとして使えそう
https://platform.openai.com/docs/guides/embeddings/what-are-embeddings
Create embeddings
POST https://api.openai.com/v1/embeddings
models
OpenAI offers one second-generation embedding model (denoted by -002 in the model ID) and 16 first-generation models (denoted by -001 in the model ID).
We recommend using text-embedding-ada-002 for nearly all use cases. It’s better, cheaper, and simpler to use. Read the blog post announcement.
1536次元?
Audio
Learn how to turn audio into text.
https://platform.openai.com/docs/guides/speech-to-text
Create transcription
POST https://api.openai.com/v1/audio/transcriptions
Transcribes audio into the input language.
文字起こし
Create translation
POST https://api.openai.com/v1/audio/translations
文字起こしして英語に翻訳
Files
Files are used to upload documents that can be used with features like Fine-tuning.
Fine-tunes
Manage fine-tuning jobs to tailor a model to your specific training data.
https://platform.openai.com/docs/guides/fine-tuning
Create fine-tune
POST https://api.openai.com/v1/fine-tunes
model
You can select one of "ada", "babbage", "curie", "davinci", or a fine-tuned model created after 2022-04-21.
List fine-tunes
GET https://api.openai.com/v1/fine-tunes
Moderations
Given a input text, outputs if the model classifies it as violating OpenAI's content policy.