
ChatGPT is how most people meet OpenAI's models. Software teams meet them somewhere else: in the OpenAI API, where a few lines of code send a request and get back text, structured data, an image or speech. That is what puts a model inside a support tool, a document workflow or a product feature, under your own interface and your own rules.
This article looks at the OpenAI API from a developer's side: what it is, how requests and models work, what it is used for, when another provider or a self-hosted model fits better, and how it compares with the alternatives.
What is the OpenAI API?
The OpenAI API is a cloud interface that gives software programmatic access to OpenAI's models for text, reasoning, code, images, audio and real-time voice. Your application authenticates with an API key, sends a request over HTTPS, and pays per token processed rather than per user seat.
OpenAI announced the API on 11 June 2020 as a private beta with a general-purpose "text in, text out" interface running GPT-3 models. Early participants named in the announcement included Algolia, Quizlet and Reddit. In March 2023 the model behind ChatGPT, gpt-3.5-turbo, and the Whisper speech-to-text model came to the API, which made chat-style applications cheap enough to build at scale.
The model line-up changes quickly, so check the official models page before you choose. OpenAI currently recommends GPT-6 Astra, its most capable model, as the starting point for complex reasoning and coding. GPT-6.1 Sol offers near-Astra performance at lower cost, GPT-6.1 Terra is a fast model for visual reasoning, computer use and writing, and GPT-6 Luna is the most efficient option for focused, high-volume tasks. Separate model families cover image generation (GPT-Image), real-time voice (GPT-Realtime) and transcription. In August 2025 OpenAI also released open-weight models, gpt-oss-120b and gpt-oss-20b, under the Apache 2.0 licence; those you download and run yourself.
How the OpenAI API works
Requests, tokens and context. Text is split into tokens, and both input and output tokens are billed. Each model has a context window, the amount of text it can consider in one request, so long documents are either sent whole to a large-context model or retrieved in relevant pieces.
The Responses API. For new work, OpenAI recommends the Responses API. One request can combine instructions, conversation state, files and tools, and the model can call several tools before answering. The older Chat Completions API is still available; the Assistants API has been retired in favour of Responses.
Tools. With function calling, you describe your own functions and the model decides when to call them with structured arguments. Built-in tools add web search, file search over uploaded documents, a code interpreter, image generation and computer use, and the API can connect to remote MCP servers.
Structured outputs. A response can be forced to match a JSON schema, which turns the model into a dependable step in a pipeline instead of a source of free text you have to parse.
Other endpoints. Embeddings turn text into vectors for search and retrieval-augmented generation (RAG). The Realtime API handles low-latency voice over WebRTC or WebSockets. The Batch API runs large asynchronous jobs at lower cost, and fine-tuning and evals adapt and measure models on your own data.
Data handling. By default, data sent to the API is not used to train OpenAI's models. Abuse-monitoring logs are kept for up to 30 days unless an approved zero-data-retention arrangement applies, and data residency can be set per project in a list of regions, including Europe.
Key features
- A wide model range, from the flagship GPT-6 Astra to efficient models for high volume.
- Multimodal input and output: text, images, audio and real-time voice.
- Function calling and structured outputs for agents and reliable integrations.
- Built-in tools such as web search, file search and code interpreter.
- Official SDKs for Python and JavaScript/TypeScript, plus an Agents SDK for multi-step agents.
- Batch processing, prompt caching and fine-tuning for cost and quality control.
- Enterprise data controls: no training on API data by default, retention options and data residency.
Where the OpenAI API is used
- Customer support assistants that answer from a knowledge base and hand over to a person.
- Document workflows: extracting fields from contracts and invoices, summarising reports, classifying tickets.
- Search and RAG over company documents, with embeddings and file search.
- Agents that call internal APIs to look up orders, update records or prepare drafts for approval.
- Voice interfaces, from call-centre assistants to in-app voice commands.
- Developer tools and code generation inside products and internal platforms.
When to choose the OpenAI API, and when not to
Choose the OpenAI API when:
- You need strong general-purpose models without running GPU infrastructure.
- The product combines text, images and voice, and you want one provider for all of them.
- Time to market matters more than owning the model.
- Your data policy allows a cloud provider with the retention and residency controls described above.
Look elsewhere when:
- Data may not leave your own infrastructure. Self-hosted open models, served with vLLM or explored with Ollama, keep it in-house.
- Volume is very high and the task is narrow. A smaller open model, fine-tuned and self-hosted, can be cheaper per request.
- You need a specific strength another provider leads on, or want two providers for resilience. Anthropic Claude and Google Gemini are the usual alternatives.
- Your organisation buys cloud services through Microsoft. The same OpenAI models are also offered on Microsoft Azure, inside Azure's billing and compliance boundary.
The OpenAI API and its alternatives
| Option | Models | Hosting | Best fit |
|---|---|---|---|
| OpenAI API | GPT-6 family, image, realtime, transcription | OpenAI cloud | Broad multimodal products, fast start |
| Anthropic API | Claude models | Anthropic cloud and major clouds | Long documents, coding and agent work |
| Google Gemini API | Gemini models | Google Cloud | Google Cloud users, very long context |
| Microsoft Azure | OpenAI models and others | Azure | Microsoft-centred enterprises |
| Self-hosted open models | Llama, Gemma, Qwen, gpt-oss | Your own servers | Strict data control, high-volume narrow tasks |
In practice, many products are written so the provider can change. Frameworks such as LangChain and LlamaIndex hide provider differences, and automation tools such as n8n connect to several providers. We compare the three main providers for enterprise use in OpenAI vs Anthropic vs Google: enterprise LLM provider comparison, and the cost side in LLM cost optimization: 7 patterns.
How we use the OpenAI API at Internative
We use OpenAI to build AI-powered software products, intelligent assistants and automation systems. Its mature APIs and multimodal models let us deliver production-grade AI solutions quickly for clients around the world.
If you want to add AI to an existing product or process, our AI integration and automation team can help you decide where the OpenAI API fits and where another model is the better call.
Frequently asked questions
What is the difference between OpenAI and ChatGPT?
OpenAI is the company that develops the models. ChatGPT is its consumer and business chat application. The OpenAI API is the developer product: the same family of models, accessed from your own code and billed by usage instead of by subscription.
Is the OpenAI API free?
No. The API is billed per token, at rates that differ by model, and you need an account with billing set up. Using it is separate from a ChatGPT subscription: a ChatGPT plan does not include API usage.
How do I get an OpenAI API key?
Create an account on the OpenAI developer platform, set up billing, and generate a key in the API keys section of a project. Keep the key on your server, never in browser or mobile code, and rotate it if it leaks.
Does OpenAI train on data sent through the API?
Not by default. OpenAI states that API data is not used to train its models unless you opt in. Abuse-monitoring logs are retained for up to 30 days, and eligible customers can apply for zero data retention.
Who owns OpenAI?
OpenAI is a US company. Since its 2025 recapitalisation, the for-profit OpenAI Group PBC is controlled by the nonprofit OpenAI Foundation, and Microsoft holds a large minority stake.
Keep reading
The articles that follow this one.



