


OpenAI API
The most widely-used LLM API powering thousands of apps
The OpenAI API provides access to the GPT-6 family (Astra, Sol and Luna), GPT-Image and Realtime audio models. It is the most mature LLM API with the largest third-party ecosystem and fine-tuning support.
Editor rating is our overall editorial judgment of the tool, out of 5. It is not a test score and not a user-review average. Ratings have not been re-scored since the tool was listed here. The reasons are in Best for and Pros & cons below.
Requires some technical comfort with API keys, command line, or coding. If you're new to AI, start with a chat-based tool first.
Best for
Pros & cons
✓ Pros
✗ What this won't do
Use cases
Building ChatGPT-like products
Voice-enabled AI assistants
Image generation in apps
Custom fine-tuned domain models
Create an API key
Sign in to the OpenAI platform and create a key on the API keys page. An API key is a secret password that lets your code use OpenAI's models.
Save the key and install
Store the key in an environment variable named OPENAI_API_KEY. Install the library with pip install openai for Python, or npm install openai for JavaScript.
Send your first request
Call the Responses API with the model gpt-6-astra and a short prompt, like the quickstart's one-sentence bedtime story about a unicorn. Print response.output_text to see the reply.
Keep the key out of code
Every OpenAI library reads OPENAI_API_KEY from your system on its own. Never paste the key into a file you share.
Compare alternatives
| Tool | Category | Editor rating | Pricing |
|---|---|---|---|
| OpenAI API (current) | LLM / Assistant | 4.7 | Pay-per-use from $0.10/M input tokens |
| Anthropic API | LLM / Assistant | 4.7 | Pay-per-use from $1/M input tokens |
| Google Gemini | LLM / Assistant | 4.6 | Free / $20 mo |
| Mistral AI | LLM / Assistant | 4.5 | Free (open) / API from $0.25/M tokens |