Prompt Buddy logoPrompt Buddy

openai · OpenAI Platform Docs

Libraries OpenAI CLI

Guides the installation, authentication, and execution of API requests using the OpenAI command-line interface, including file handling and output formatting.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Libraries OpenAI CLI

Guides the installation, authentication, and execution of API requests using the OpenAI command-line interface, including file handling and output formatting.

When To Use

Use when you need to automate API requests via shell scripts, perform batch data extraction into JSONL, or interact with OpenAI models directly from a terminal environment.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/libraries-openai-cli-workflow-guide.mdA guide covering the installation, authentication, and use cases for the OpenAI command-line interface.Questions about a guide covering the installation, authentication, and use cases for the OpenAI command-line interface.
examples/libraries-openai-cli-openai-cli-brew-install-command.bashA bash command demonstrating how to install the OpenAI CLI using Homebrew.Exact payloads, commands, or snippets shown in A bash command demonstrating how to install the OpenAI CLI using Homebrew.
examples/libraries-openai-cli-openai-cli-go-install-command.bashA bash command to install the OpenAI CLI using the go install tool.Exact payloads, commands, or snippets shown in A bash command to install the OpenAI CLI using the go install tool.
examples/libraries-openai-cli-openai-cli-bash-environment-variable-setup.bashA bash script demonstrating how to export the OPENAI_API_KEY environment variable for use with the OpenAI CLI.Exact payloads, commands, or snippets shown in A bash script demonstrating how to export the OPENAIAPIKEY environment variable for use with the OpenAI CLI.
examples/libraries-openai-cli-openai-cli-responses-create.bashA bash command example demonstrating how to use the openai cli to create a response using a specific model and input text.Exact payloads, commands, or snippets shown in A bash command example demonstrating how to use the openai cli to create a response using a specific model and input...
examples/libraries-openai-cli-openai-cli-response.jsonA JSON object representing a sample API response from the OpenAI CLI including model details and usage statistics.Exact payloads, commands, or snippets shown in A JSON object representing a sample API response from the OpenAI CLI including model details and usage statistics.
examples/libraries-openai-cli-openai-cli-bash-transform-jq.bashA bash command using jq to transform the OpenAI CLI output by extracting the text content from message objects.Exact payloads, commands, or snippets shown in A bash command using jq to transform the OpenAI CLI output by extracting the text content from message objects.
examples/libraries-openai-cli-openai-cli-responses-create-2.bashA bash command demonstrating how to use the openai cli to create a response with a model, input file, and output transformation.Exact payloads, commands, or snippets shown in A bash command demonstrating how to use the openai cli to create a response with a model, input file, and output tran...
examples/libraries-openai-cli-openai-cli-installation-and-usage-guide.textA text-based guide detailing the installation steps and basic command usage for the OpenAI command-line interface.Exact payloads, commands, or snippets shown in A text-based guide detailing the installation steps and basic command usage for the OpenAI command-line interface.
examples/libraries-openai-cli-openai-cli-responses-create-yaml-transform.bashA bash command demonstrating how to use the openai cli to create a response and transform the output using a YAML input block.Exact payloads, commands, or snippets shown in A bash command demonstrating how to use the openai cli to create a response and transform the output using a YAML inp...
examples/libraries-openai-cli-openai-cli-image-generation-installation-guidance.textUpdated instructions and guidance for installing the OpenAI CLI and using image generation commands.Exact payloads, commands, or snippets shown in Updated instructions and guidance for installing the OpenAI CLI and using image generation commands.
examples/libraries-openai-cli-openai-cli-bash-summarize-note.bashA bash command sequence that reads a local markdown file and uses the OpenAI CLI to generate a one-sentence summary in YAML format.Exact payloads, commands, or snippets shown in A bash command sequence that reads a local markdown file and uses the OpenAI CLI to generate a one-sentence summary i...
examples/libraries-openai-cli-openai-cli-jsonschema-fact.jsonA JSON schema definition for a fact object containing person and topic properties.Exact payloads, commands, or snippets shown in A JSON schema definition for a fact object containing person and topic properties.
examples/libraries-openai-cli-openai-cli-responses-create-3.bashA bash command demonstrating how to use the openai cli to create responses with specific models, instructions, and output transformations.Exact payloads, commands, or snippets shown in A bash command demonstrating how to use the openai cli to create responses with specific models, instructions, and ou...
examples/libraries-openai-cli-openai-cli-json-payload.jsonA JSON object containing person and topic fields used as an example payload for the OpenAI CLI.Exact payloads, commands, or snippets shown in A JSON object containing person and topic fields used as an example payload for the OpenAI CLI.
examples/libraries-openai-cli-openai-cli-jsonschema-definition.jsonA JSON schema definition describing the structure for items containing titles, summaries, and evidence.Exact payloads, commands, or snippets shown in A JSON schema definition describing the structure for items containing titles, summaries, and evidence.
examples/libraries-openai-cli-openai-cli-bash-batch-process-records-jsonl.bashA bash script that iterates through markdown files, uses the OpenAI CLI to generate responses based on a schema, and appends the results to a JSONL file.Exact payloads, commands, or snippets shown in A bash script that iterates through markdown files, uses the OpenAI CLI to generate responses based on a schema, and...
examples/libraries-openai-cli-openai-cli-responses-create-yaml-transform-2.bashA bash command demonstrating how to use the openai cli to create a response with a yaml format and a jq-style transformation.Exact payloads, commands, or snippets shown in A bash command demonstrating how to use the openai cli to create a response with a yaml format and a jq-style transfo...
examples/libraries-openai-cli-openai-cli-libraries-documentation-overview.textA text-based overview of the available libraries and tools for the OpenAI CLI.Exact payloads, commands, or snippets shown in A text-based overview of the available libraries and tools for the OpenAI CLI.
examples/libraries-openai-cli-openai-cli-files-create-and-responses-create.bashA bash script demonstrating how to upload a file using the OpenAI CLI and subsequently use that file ID to generate a response with a specific transformation.Exact payloads, commands, or snippets shown in A bash script demonstrating how to upload a file using the OpenAI CLI and subsequently use that file ID to generate a...
examples/libraries-openai-cli-openai-cli-libraries-documentation.textA text-based overview of the OpenAI CLI libraries and their associated documentation content.Exact payloads, commands, or snippets shown in A text-based overview of the OpenAI CLI libraries and their associated documentation content.
examples/libraries-openai-cli-openai-cli-images-generate.bashA bash command demonstrating how to use the OpenAI CLI to generate an image and decode the base64 response into a PNG file.Exact payloads, commands, or snippets shown in A bash command demonstrating how to use the OpenAI CLI to generate an image and decode the base64 response into a PNG...
examples/libraries-openai-cli-openai-cli-wrote-hero-png.textA text representation of the command used to execute the wrote hero.png operation via the OpenAI CLI.Exact payloads, commands, or snippets shown in A text representation of the command used to execute the wrote hero.png operation via the OpenAI CLI.
examples/libraries-openai-cli-openai-cli-images-edit.bashA bash command demonstrating how to use the OpenAI CLI to edit an image using a prompt and save the output.Exact payloads, commands, or snippets shown in A bash command demonstrating how to use the OpenAI CLI to edit an image using a prompt and save the output.
examples/libraries-openai-cli-openai-cli-installation-guide.textA text-based guide outlining the steps to install the OpenAI command line interface.Exact payloads, commands, or snippets shown in A text-based guide outlining the steps to install the OpenAI command line interface.
examples/libraries-openai-cli-openai-cli-audio-speech-create.bashA bash command demonstrating how to use the OpenAI CLI to generate speech from text using the gpt-4o-mini-tts model.Exact payloads, commands, or snippets shown in A bash command demonstrating how to use the OpenAI CLI to generate speech from text using the gpt-4o-mini-tts model.
examples/libraries-openai-cli-openai-cli-speech-generation.textA text output showing the result of an OpenAI CLI command that generated an audio file named speech.mp3.Exact payloads, commands, or snippets shown in A text output showing the result of an OpenAI CLI command that generated an audio file named speech.mp3.
examples/libraries-openai-cli-openai-cli-bash-afplay-speech.bashA bash command demonstrating the use of the afplay utility to play an audio file.Exact payloads, commands, or snippets shown in A bash command demonstrating the use of the afplay utility to play an audio file.
examples/libraries-openai-cli-openai-cli-audio-speech-create-2.bashA bash command demonstrating how to use the OpenAI CLI to generate speech from text using the gpt-4o-mini-tts model.Exact payloads, commands, or snippets shown in A bash command demonstrating how to use the OpenAI CLI to generate speech from text using the gpt-4o-mini-tts model.
examples/libraries-openai-cli-openai-cli-audio-transcriptions-create.bashA bash command example demonstrating how to use the OpenAI CLI to create an audio transcription using the gpt-4o-transcribe model.Exact payloads, commands, or snippets shown in A bash command example demonstrating how to use the OpenAI CLI to create an audio transcription using the gpt-4o-tran...
examples/libraries-openai-cli-openai-cli-shell-script-usage.textA text example demonstrating how to invoke the OpenAI CLI within ordinary shell scripts to call the API.Exact payloads, commands, or snippets shown in A text example demonstrating how to invoke the OpenAI CLI within ordinary shell scripts to call the API.
examples/libraries-openai-cli-openai-cli-audio-transcriptions-create-2.bashA bash command example demonstrating how to use the OpenAI CLI to create an audio transcription using the whisper-1 model.Exact payloads, commands, or snippets shown in A bash command example demonstrating how to use the OpenAI CLI to create an audio transcription using the whisper-1 m...
examples/libraries-openai-cli-openai-cli-transcription-response.jsonA JSON object representing the response structure from an OpenAI CLI transcription task.Exact payloads, commands, or snippets shown in A JSON object representing the response structure from an OpenAI CLI transcription task.
examples/libraries-openai-cli-openai-cli-audio-transcriptions-create-3.bashA bash command example demonstrating how to use the OpenAI CLI to create an audio transcription with diarization.Exact payloads, commands, or snippets shown in A bash command example demonstrating how to use the OpenAI CLI to create an audio transcription with diarization.
examples/libraries-openai-cli-openai-cli-shell-script-api-call.jsonA JSON representation of an example showing how to invoke the OpenAI API using the OpenAI CLI within a shell script.Exact payloads, commands, or snippets shown in A JSON representation of an example showing how to invoke the OpenAI API using the OpenAI CLI within a shell script.
examples/libraries-openai-cli-openai-cli-project-and-service-account-creation.bashBash commands to create an OpenAI organization project and a service account using the OpenAI CLI.Exact payloads, commands, or snippets shown in Bash commands to create an OpenAI organization project and a service account using the OpenAI CLI.
examples/libraries-openai-cli-openai-cli-service-account-json-structure.jsonA JSON object representing the configuration and identity details for an OpenAI CLI service account.Exact payloads, commands, or snippets shown in A JSON object representing the configuration and identity details for an OpenAI CLI service account.

What This Skill Covers

  • Interact with the OpenAI API directly from your terminal with the openai command-line tool.
  • Main sections: Installation, Authentication, Use cases, CLI vs subagents for Codex, Global flags.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.openai.com/api/docs/libraries/openai-cli.md