Skip to content
aicoolies logo
OpenAI CLI logo

OpenAI CLI

OpenAI's official command-line tool for calling the OpenAI REST API from your terminal and scripts

OpenAI CLI (openai) is OpenAI's official Apache-2.0 command-line tool for the OpenAI REST API. Commands mirror API resources, so you can create Responses, generate and edit images, upload and download files, submit and wait for Batch jobs, and query admin endpoints such as organization usage from a shell or script. Output can be readable text, JSON, JSONL or YAML with GJSON transforms. It is not a coding agent; for that OpenAI points to Codex CLI.

About OpenAI CLI

OpenAI CLI is the official command-line tool for the OpenAI REST API, published by OpenAI on GitHub under the Apache License 2.0. It lets you call the API from a terminal or shell script without writing an application. Commands follow the API's resource structure (openai <resource> [subresource] <command>), and built-in help works offline without an API key.

The README highlights a few everyday workflows: generating and editing images that are saved locally, uploading, retrieving and downloading files, submitting a JSONL batch and waiting for its results, and exporting API data for scripts. Output defaults to readable text even in pipes; you can switch to JSON, JSONL, YAML or raw output and extract fields with GJSON transforms. Admin endpoints, such as organization usage reports, use a separate admin API key, and the reference documents mTLS client certificates, custom headers and an OPENAI_UNTRUSTED_STDIN mode for piping untrusted input.

OpenAI positions the tool explicitly next to Codex CLI: use openai to call a specific API or script API operations, and use codex when you want a coding agent to read and edit code. On eligible interactive runs the CLI checks for updates (disable with OPENAI_CLI_NO_UPDATE_CHECK=1) and, on the first interactive run, saves image-picker Tab shortcuts for Bash, zsh and fish; the docs explain how to opt out and remove them.

The CLI itself is free. Every request uses your own OpenAI API key and is billed at standard OpenAI API rates, so cost depends entirely on the models and endpoints you call.

Pricing & Platform Specs

Pricing Summary

The CLI is free and open source under the Apache License 2.0. It calls the OpenAI API with your own API key (OPENAI_API_KEY, plus OPENAI_ADMIN_KEY for admin endpoints), so every request is billed at standard OpenAI API rates; see the OpenAI API pricing page.

full pricing breakdown →

Supported Platforms

Single Go binary for macOS, Linux and Windows (GitHub Releases), Homebrew (brew install openai/tools/openai) or go install (Go 1.26+); requires an OpenAI API key

Explore categories, tags & use cases

Google's beta command-line tool that lets coding agents and scripts call Gemini models, media generation and managed agents

Gemini API CLI (gemini-api) is Google's Apache-2.0, beta command-line tool for the Gemini Interactions API. One stateless Go binary lets Claude Code, Codex, Antigravity and other shell-capable agents generate text, images, speech, music and video, analyze PDFs, media and YouTube URLs, transcribe recordings, and launch background managed agents such as Deep Research. It offers --dry-run previews, JSON or TOON output and an agent mode. It is not a coding agent.

Open Source

Community experience

Sources & verification

Sources checked
Content verified

Verification dates are editorial checks. Routine CMS saves and automatic updatedAt timestamps do not advance them.

FAQ

What is OpenAI CLI?

OpenAI CLI (openai) is OpenAI's official Apache-2.0 command-line tool for the OpenAI REST API. Commands mirror API resources, so you can create Responses, generate and edit images, upload and download files, submit and wait for Batch jobs, and query admin endpoints such as organization usage from a shell or script. Output can be readable text, JSON, JSONL or YAML with GJSON transforms. It is not a coding agent; for that OpenAI points to Codex CLI.

Is OpenAI CLI free?

Yes — OpenAI CLI is open source and free to use. The CLI is free and open source under the Apache License 2.0. It calls the OpenAI API with your own API key (OPENAI_API_KEY, plus OPENAI_ADMIN_KEY for admin endpoints), so every request is billed at standard OpenAI API rates; see the OpenAI API pricing page.

Is OpenAI CLI open source?

Yes — OpenAI CLI is open source.

Is OpenAI CLI still maintained?

Yes — OpenAI CLI is active. Its listing was last verified on October 23, 2026.

What are the best OpenAI CLI alternatives?

The first editor-selected OpenAI CLI alternatives are Gemini API CLI.