
OpenAI API
OpenAI's API for GPT models
The OpenAI API provides access to the GPT-6 family (Astra, Sol and Luna), GPT-Image and Realtime audio models. Fine-tuning is closed to new users.
Last reviewed: · Reviewed from official documentation and product information.
Sources: Official site · Pricing
Updated : We removed claims about this tool that we could not source.
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
Large batch jobs at lower cost
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 | Pricing |
|---|---|---|
| OpenAI API (current) | LLM / Assistant | Pay-per-use from $0.10/M input tokens |
| Anthropic API | LLM / Assistant | Pay-per-use from $0.10/M input tokens (Haiku 5.5) |
| Google Gemini | LLM / Assistant | Free / from $4.99 mo (AI Plus) / $19.99 mo AI Pro |
| Mistral AI | LLM / Assistant | Free (open) / API $0.15/M input tokens (Mistral Small 4) |