> openai --help
USAGE:
openai [OPTIONS] <COMMAND>
EXAMPLES:
openai file list --jq '.[].id'
openai file list --jq ".[] | select(.sizeInBytes > 100000) | .id"
openai vector create --name mystore --meta 'key1=value1' --meta 'key2=value'
openai vector create --name myfiles --file asdf123 --file qwer456
openai vector search mystore "what's the return policy on headphones?"
--score 0.7
OPTIONS:
-h, --help Prints help information
COMMANDS:
auth
file
vector
model
sponsor
Authentication is managed for you by the CLI, using the Git Credential Manager as the cross-platform secure storage for your API key(s). You can login multiple project/key combination and then just change the active one without ever re-entering the keys.
See authentication for more details.
> openai auth --help
USAGE:
openai auth [OPTIONS] <COMMAND>
OPTIONS:
-h, --help Prints help information
COMMANDS:
login <project> Authenticate to OpenAI.
Supports API key autentication using the Git Credential
Manager for storage.
Switch easily between keys by just specifying the project
name after initial login with `--with-token`.
Alternatively, openai will use the authentication token
found in environment variables with the name
`OPENAI_API_KEY`.
This method is most suitable for "headless" use such as
in automation.
For example, to use openai in GitHub Actions, add
`OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}` to "env"
logout Log out of api.openai.com
status Shows the current authentication status
token Print the auth token openai is configured to use
> openai auth login --help
DESCRIPTION:
Authenticate to OpenAI.
Supports API key autentication using the Git Credential Manager for storage.
Switch easily between keys by just specifying the project name after initial
login with `--with-token`.
Alternatively, openai will use the authentication token found in environment
variables with the name `OPENAI_API_KEY`.
This method is most suitable for "headless" use such as in automation.
For example, to use openai in GitHub Actions, add `OPENAI_API_KEY: ${{
secrets.OPENAI_API_KEY }}` to "env"
USAGE:
openai auth login <project> [OPTIONS]
ARGUMENTS:
<project> OpenAI project the API key belongs to
OPTIONS:
-h, --help Prints help information
--with-token Read token from standard input
> openai auth logout --help
DESCRIPTION:
Log out of api.openai.com
USAGE:
openai auth logout [OPTIONS]
OPTIONS:
-h, --help Prints help information
> openai auth status --help
DESCRIPTION:
Shows the current authentication status
USAGE:
openai auth status [OPTIONS]
OPTIONS:
-h, --help Prints help information
--show-token Display the auth token
Implements the Files API.
> openai file --help
USAGE:
openai file [OPTIONS] <COMMAND>
EXAMPLES:
openai file list --jq '.[].id'
openai file list --jq ".[] | select(.sizeInBytes > 100000) | .id"
OPTIONS:
-h, --help Prints help information
COMMANDS:
upload <FILE> Upload a local file, specifying its purpose
delete <ID> Delete a file by its ID
list List files
view <ID> View a file by its ID
> openai file list --help
DESCRIPTION:
List files
USAGE:
openai file list [OPTIONS]
EXAMPLES:
openai file list --jq '.[].id'
openai file list --jq ".[] | select(.sizeInBytes > 100000) | .id"
OPTIONS:
-h, --help Prints help information
--jq [EXPRESSION] Filter JSON output using a jq expression
--json Output as JSON. Implied when using --jq
--monochrome Disable colors when rendering JSON to the
console
--range [EXPRESSION] C# range expression to flexibly slice results
--skip [SKIP] Number of items to skip from the results
--take [TAKE] Number of items to take from the results
-p, --purpose [PURPOSE] Purpose of the file (assistants,
assistants_output, batch, batch_output, evals,
fine-tune, fine-tune-results, user_data, vision)
Implements the Vector Stores API.
> openai vector --help
USAGE:
openai vector [OPTIONS] <COMMAND>
EXAMPLES:
openai vector create --name mystore --meta 'key1=value1' --meta 'key2=value'
openai vector create --name myfiles --file asdf123 --file qwer456
openai vector search mystore "what's the return policy on headphones?"
--score 0.7
openai vector search mystore "physical stores?" --filter region=us
openai vector search mystore "most popular stores?" -f region=us -f
popularity>=80
OPTIONS:
-h, --help Prints help information
COMMANDS:
create Creates a vector store
modify <STORE> Modify a vector store
delete <STORE> Delete a vector store by ID or name
list List vector stores
view <STORE> View a store by its ID or name
search <STORE> <QUERY> Performs semantic search against a vector store
file Vector store files operations
Supports semantic search including attribute filtering:
> openai vector search --help
DESCRIPTION:
Performs semantic search against a vector store
USAGE:
openai vector search <STORE> <QUERY> [OPTIONS]
EXAMPLES:
openai vector search mystore "what's the return policy on headphones?"
--score 0.7
openai vector search mystore "physical stores?" --filter region=us
openai vector search mystore "most popular stores?" -f region=us -f
popularity>=80
ARGUMENTS:
<STORE> The ID or name of the vector store
<QUERY> The query to search for
OPTIONS:
DEFAULT
-h, --help Prints help information
--jq [EXPRESSION] Filter JSON output using a jq expression
--json Output as JSON. Implied when using --jq
--monochrome Disable colors when rendering JSON to
the console
-f, --filter Vector file attributes to filter as KEY[
=|!=|>|>=|<|<=]VALUE
-r, --rewrite True Automatically rewrite your queries for
optimal performance
-s, --score <SCORE> 0.5 The minimum score to include in results
> openai vector file --help
DESCRIPTION:
Vector store files operations
USAGE:
openai vector file [OPTIONS] <COMMAND>
EXAMPLES:
openai file add mystore store.md -a region=us
openai file add mystore nypop.md -a region=us -a popularity=90
OPTIONS:
-h, --help Prints help information
COMMANDS:
add <STORE> <FILE_ID> Add file to vector store
delete <STORE> <FILE_ID> Remove file from vector store
list <STORE> List files associated with vector store
view <STORE> <FILE_ID> View file association to a vector store
> openai vector file add --help
DESCRIPTION:
Add file to vector store
USAGE:
openai vector file add <STORE> <FILE_ID> [OPTIONS]
EXAMPLES:
openai file add mystore store.md -a region=us
openai file add mystore nypop.md -a region=us -a popularity=90
ARGUMENTS:
<STORE> The ID or name of the vector store
<FILE_ID> File ID to add to the vector store
OPTIONS:
-h, --help Prints help information
--jq [EXPRESSION] Filter JSON output using a jq expression
--json Output as JSON. Implied when using --jq
--monochrome Disable colors when rendering JSON to the console
-a, --attribute Attributes to add to the vector file as KEY=VALUE
> openai vector file list --help
DESCRIPTION:
List files associated with vector store
USAGE:
openai vector file list <STORE> [OPTIONS]
ARGUMENTS:
<STORE> The ID or name of the vector store
OPTIONS:
DEFAULT
-h, --help Prints help information
--jq [EXPRESSION] Filter JSON output using a jq
expression
--json Output as JSON. Implied when using
--jq
--monochrome Disable colors when rendering JSON
to the console
--range [EXPRESSION] C# range expression to flexibly
slice results
--skip [SKIP] Number of items to skip from the
results
--take [TAKE] Number of items to take from the
results
-f, --filter completed Filter by status (in_progress,
completed, failed, cancelled)
List and view available models via the models API;
> openai model --help
USAGE:
openai model [OPTIONS] <COMMAND>
OPTIONS:
-h, --help Prints help information
COMMANDS:
list List available models
view <ID> View model details
You can support further development of this tool by sponsoring. The tool offers various commands to sync your sponsorship status, powered by SponsorLink.
> openai sponsor --help
USAGE:
openai sponsor [OPTIONS] <COMMAND>
OPTIONS:
-h, --help Prints help information
COMMANDS:
check Checks the current sponsorship status with devlooped, entirely
offline
config Manages sponsorlink configuration
view Validates and displays the sponsor manifest for devlooped, if
present
sync Synchronizes the sponsorship manifest for devlooped
> openai sponsor sync --help
DESCRIPTION:
Synchronizes the sponsorship manifest for devlooped
USAGE:
openai sponsor sync [OPTIONS]
OPTIONS:
-h, --help Prints help information
--autosync Enable or disable automatic synchronization of expired
manifests
-f, --force Force sync, regardless of expiration of manifests found
locally
-v, --validate Validate local manifests using the issuer public key
-u, --unattended Prevent interactive credentials refresh
--with-token Read GitHub authentication token from standard input for
sync