LinuxCommandLibrary

openai

chat completion

TLDR

Chat completion

$ openai api chat.completions.create -m gpt-4 -g user "[prompt]"
copy
Create embedding
$ openai api embeddings.create -m text-embedding-ada-002 -i "[text]"
copy
List models
$ openai api models.list
copy
Generate image
$ openai api images.generate -p "[description]"
copy

SYNOPSIS

openai [command] [options]

DESCRIPTION

openai is the OpenAI CLI. Interacts with GPT models and other APIs.
The tool provides command-line API access. Requires API key.

PARAMETERS

api ENDPOINT

API command.
-m MODEL
Model name.
-g ROLE MESSAGE
Message with role.
-i INPUT
Input text.
-p PROMPT
Prompt text.
--help
Display help information.

CAVEATS

Requires OPENAIAPIKEY. API usage billed. Rate limits apply.

HISTORY

openai CLI was created by OpenAI for command-line API access.

SEE ALSO

curl(1), ollama(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community