Skip to main content
Programmatic access to OpenAI’s models enables seamless integration of GPT-powered features into your applications. In this guide, we’ll cover how to install and use the official OpenAI SDKs for Python and Node.js, leverage the OpenAI CLI for quick API operations, and explore community-maintained libraries.

Official SDKs

For the latest SDKs, visit the OpenAI documentation under “Libraries”. Below is a quick overview:

Python SDK

Installation

This single package provides both:
  • The Python client library (import openai)
  • The openai CLI tool for tasks like generating completions or fine-tuning models
Never commit your OPENAI_API_KEY in plaintext. Always load it from an environment variable or a secrets manager.

Quickstart Example

Using the CLI

The openai CLI supports commands for completions, embeddings, file uploads, and fine-tuning. Run openai --help to explore all options.

Node.js SDK

Installation

Basic Usage (JavaScript)

For TypeScript examples and advanced configurations, see the Node.js SDK Guide.

Community Libraries

OpenAI’s documentation also links to community-maintained libraries across various languages. Use these with caution, as they are not officially supported:
The image shows a webpage from OpenAI's documentation, listing community libraries for various programming languages like C#, C++, Clojure, and Crystal. It includes links to GitHub repositories and a disclaimer about using these libraries at one's own risk.

Next Steps

Now that you have the SDKs installed and the CLI at your fingertips, you’re ready to configure your development environment and build your first Python application that calls the OpenAI API.

Watch Video