Skip to content
BENIBIX Learn

OpenAI SDK

Development🧬 AI EngineeringLLM APIs

Also known as OpenAI Client Library, OpenAI Python Library, openai Python package, OpenAI Node SDK

OpenAI's own code kit. Your code calls its models with one short function.

Think of it like

It is like a remote made for one TV. It knows every button on that TV.

Example

Jack's help bot uses the openai package for Python. Each question goes out in one function call. The answer text comes back ready to show.

Why it matters

Many other model makers accept the same request shape. So the same library can often reach them too, once you change the base URL.

Definition

The OpenAI SDK is OpenAI's own code library for the OpenAI API. The main ones are for Python and for JavaScript with TypeScript. There are also kits for .NET, Java and Go. You make a client and call responses.create with a model and your input. The library adds your key, tries again on errors and can stream the reply.

Example code

python
from openai import OpenAI

client = OpenAI()  # reads OPENAI_API_KEY
response = client.responses.create(
    model="gpt-6-astra",
    input="Hello there",
)
print(response.output_text)
The client reads your key from the environment. One call sends the input and prints the answer.
Here the middle box is the OpenAI SDK. The box on the right is the OpenAI API.

Common mistake

Starting a new app on chat.completions because an old tutorial did. It still works, but OpenAI points new work to the Responses API.

Key takeaways

  1. 1
    Python and JavaScript. Plus .NET, Java and Go.
  2. 2
    Key from the environment. OPENAI_API_KEY by default.
  3. 3
    Base URL can change. Reach other servers that copy the format.