VOOZH about

URL: https://developers.openai.com/api/docs/quickstart

⇱ Developer quickstart | OpenAI API


Search the API docs

Primary navigation

Evaluation

Legacy APIs

The OpenAI API provides a simple interface to state-of-the-art AI models for text generation, natural language processing, computer vision, and more. Get started by creating an API Key and running your first API call. Discover how to generate text, analyze images, build agents, and more.

Create and export an API key

Before you begin, create an API key in the dashboard, which you’ll use to securely access the API. Store the key in a safe location, like a .zshrc file or another text file on your computer. Once you’ve generated an API key, export it as an environment variable in your terminal.

macOS / Linux
Windows

OpenAI SDKs are configured to automatically read your API key from the system environment.

Install the OpenAI SDK and Run an API Call

JavaScript

To use the OpenAI API in server-side JavaScript environments like Node.js, Deno, or Bun, you can use the official OpenAI SDK for TypeScript and JavaScript. Get started by installing the SDK using npm or your preferred package manager:

With the OpenAI SDK installed, create a file called example.mjs and copy the example code into it:

Execute the code with node example.mjs (or the equivalent command for Deno or Bun). In a few moments, you should see the output of your API request.

Learn more on GitHub

Discover more SDK capabilities and options on the library’s GitHub README.

Python

To use the OpenAI API in Python, you can use the official OpenAI SDK for Python. Get started by installing the SDK using pip:

With the OpenAI SDK installed, create a file called example.py and copy the example code into it:

Execute the code with python example.py. In a few moments, you should see the output of your API request.

Learn more on GitHub

Discover more SDK capabilities and options on the library’s GitHub README.

.NET

In collaboration with Microsoft, OpenAI provides an officially supported API client for C#. You can install it with the .NET CLI from NuGet.

dotnet add package OpenAI

A simple API request to the Responses API would look like this:

Java

OpenAI provides an API helper for the Java programming language, currently in beta. You can include the Maven dependency using the following configuration:

<dependency>
 <groupId>com.openai</groupId>
 <artifactId>openai-java</artifactId>
 <version>4.0.0</version>
</dependency>

A simple API request to Responses API would look like this:

To learn more about using the OpenAI API in Java, check out the GitHub repo linked below!

Learn more on GitHub

Discover more SDK capabilities and options on the library’s GitHub README.

Go

OpenAI provides an API helper for the Go programming language, currently in beta. You can import the library using the code below:

import (
 "github.com/openai/openai-go" // imported as openai
)

A simple API request to the Responses API would look like this:

To learn more about using the OpenAI API in Go, check out the GitHub repo linked below!

Learn more on GitHub

Discover more SDK capabilities and options on the library’s GitHub README.

Responses starter app

Start building with the Responses API.

Text generation and prompting

Learn more about prompting, message roles, and building conversational apps.

Add credits to keep building

Congrats on running a free test API request! Start building real applications with higher limits and use our models to generate text, audio, images, videos and more.

Explore tools and docs designed to help you ship faster:

Chat Playground

Build & test conversational prompts and embed them in your app.

Build agents

Use the Agents SDK to build, run, and observe agent workflows.

Analyze images and files

Send image URLs, uploaded files, or PDF documents directly to the model to extract text, classify content, or detect visual elements.

Image URL
File URL
Upload file
Image inputs guide

Learn to use image inputs to the model and extract meaning from images.

File inputs guide

Learn to use file inputs to the model and extract meaning from documents.

Extend the model with tools

Give the model access to external data and functions by attaching tools. Use built-in tools like web search or file search, or define your own for calling APIs, running code, or integrating with third-party systems.

Web search
File search
Code Interpreter
Function calling
Remote MCP
Use built-in tools

Learn about powerful built-in tools like web search and file search.

Function calling guide

Learn to enable the model to call your own custom code.

Stream responses and build realtime apps

Use server‑sent streaming events to show results as they’re generated, or the Realtime API for interactive voice and multimodal apps.

Use streaming events

Use server-sent events to stream model responses to users fast.

Get started with the Realtime API

Use WebRTC or WebSockets for super fast speech-to-speech AI apps.

Build agents

Use the OpenAI platform to build agents capable of taking action—like controlling computers—on behalf of your users. Use the Agents SDK to create orchestration logic on the backend.

Build agents that can take action

Learn how to use the OpenAI platform to build powerful, capable AI agents.

Loading docs agent...