OpenAI API: Keys, Models and Data Controls
Published Updated
The OpenAI API is an application programming interface that lets your software call OpenAI’s models. Your organisation pays for API usage separately from any ChatGPT subscription. Before you build, decide which system will hold the API key and where the model can process your data.
What the OpenAI API is and How It Differs From ChatGPT
A ChatGPT workspace gives staff a ready-made chat interface. Staff can share selected chats, and workspace admins manage member access and settings. With the OpenAI API, your software sends the model a request and decides what to do with the response. You control what staff see, which records accompany a request and whether an answer can trigger an action.
“ChatGPT API” and “GPT API” usually mean the OpenAI developer platform. A ChatGPT workspace subscription and an API organisation have separate billing settings. API charges depend on what your software uses. See OpenAI API pricing for which inputs, outputs and tools you pay for.
Creating and Protecting an OpenAI API Key
Create the credential in the project that will use it. You need to own the API organisation to create a project. Members can then create project-scoped API keys within their permissions.
- Sign in to the OpenAI API Platform. For a first account, complete the API organisation setup. Your organisation should appear in the organisation selector, with a Default project. If you’ve been invited to a company’s organisation, select that organisation.
- In the project selector, choose Create project. Enter the project name and review Data and Inference Residency before choosing Create. The project appears in the selector and you’re added as its owner.
- In organisation settings, select the new project and open API Keys. Select Create new secret key and restrict it to the permissions the application needs. Copy the secret when it appears. For a deployed application, use a project service account so it has its own credentials.
- Load the key into a development server from a secrets manager or server-side environment variable. Make a small test request with dummy text. You should receive a model response and see usage under the intended project if you have access to the usage dashboard.
A browser can expose any key delivered to it. A spreadsheet or shared chat can leave copies with anyone who has access or exports the content. Keep credentials on the server and let the browser call your application. If a test request fails, confirm that the server has the intended credential. Then verify that its permissions and the project’s model settings allow the call.
Before adding developers, assign Member to people who need to use project resources and Owner to those who manage access and settings. Under Limits, choose the models available to the project and set rate limits where needed. Add spend alerts for the people who can act on them. Alerts leave requests running. A separately enforced hard spend limit can stop requests after tracked spend crosses the threshold.
If a key leaks, revoke it in the project’s API Keys settings, issue a replacement and update the application’s secret. Review project usage from the earliest point the key could have been exposed. Ask the organisation owner to review it if your role can’t see the usage dashboard.
Choosing Among the Models the API Offers
Choose the model family by the job the application needs done. General-purpose reasoning models suit work such as reconciling conflicting policy clauses. Smaller models are usually faster and cheaper for routine work, such as classifying a message by intent.
Vector embedding models turn text into numbers for similarity search. Speech models can transcribe audio or generate speech. Image models can generate or edit images.
Run the same representative tasks through two or three candidates that support your required tools and deployment region. Include common requests and a few expensive mistakes, such as a policy question whose answer depends on an exception. Score correctness and record response time and cost per acceptable answer. The token calculator can help estimate the input size before you run those tests.
Core API Features Teams Build With
The Responses API generates answers and can use tools when a task needs information outside the prompt. Some tools run on OpenAI’s platform, while your application runs the functions you connect to your own systems.
| API capability | What it does | Hypothetical use |
|---|---|---|
| Text generation | Writes text from instructions and material you supply. | A logistics team turns a depot’s incident notes into a draft handover. |
| Structured Outputs | Fits a completed response to a supported schema. Your application still checks that the values are correct. | An insurer extracts policy numbers and incident types into fields for a claims queue. |
| Function calling | Requests a function your application has made available. Your code checks permissions and decides whether to run it. | A retailer fetches the current delivery estimate from its order system. |
| File Search | Retrieves relevant passages from files you’ve uploaded and indexed with OpenAI. | A utility retrieves a passage from its equipment manuals for a technician’s question. |
| Vector embeddings | Represent text numerically so your software can retrieve records by similarity. | A construction team finds past inspection notes about a recurring fault, even when crews use different terms for it. |
OpenAI’s Agents SDK can manage the loop between a model, its tools and agent handoffs inside your application. The Agents API is OpenAI’s managed option for running an agent and saving its progress. Keep the workflow in your own application when your business rules need to control each transition, such as requiring a supervisor’s approval before any update reaches a system of record. That approach can use the Responses API for individual model calls.
Rate limits control throughput. OpenAI can cap requests or tokens per minute, with limits that depend on the model, project and organisation. Your organisation moves up the usage tiers as total credit purchases reach OpenAI’s thresholds. Higher tiers generally have higher limits. Check Limits in the API Platform before sizing a workload that needs to handle many requests at once.
Data Use, Retention and Australian Data Residency
OpenAI says it uses API inputs and outputs for model training only if the customer explicitly opts in. By default, abuse-monitoring logs can contain prompts and responses and are kept for up to 30 days. OpenAI describes exceptions for legal requirements and preventing harm.
Application data follows different rules. By default, the Responses API stores response data for at least 30 days. Files and vector stores can persist until you delete them or a configured expiry applies.
Eligible customers can apply to OpenAI for Zero Data Retention. For supported requests, it keeps customer content out of abuse-monitoring logs, subject to documented exceptions. It also turns off response storage on the Responses API. Check each endpoint and feature separately, because some can still store application data.
Where OpenAI and Azure Process Prompts
OpenAI has Australian API data residency for eligible organisations. OpenAI directs organisations to its sales team for eligibility, and an organisation owner selects the region when creating a project. Zero Data Retention is a separate approval.
Australian residency covers storage at rest for supported customer content when a feature needs to store it. For in-country processing, send supported GPT-6 Luna requests on Standard pay-as-you-go to au.api.openai.com with the Australian project’s key. The Responses and Chat Completions APIs support text inputs and text output in this configuration. Image inputs require additional approval.
OpenAI’s documentation lists hosted tools as unavailable for Australian regional processing. Account and billing data fall outside the residency commitment and can be handled elsewhere.
For Azure OpenAI, choose a Standard/Regional deployment for an eligible model in an Australian location such as Australia East if you need prompts processed in Australia. Microsoft’s privacy documentation describes possible movement between regions within the selected geography. A Global deployment can process prompts overseas even if the Azure resource is in Australia. Compare the model and deployment type against your requirement, then trace where your own file stores and logs sit.
What to Settle Under the Privacy Act
For organisations covered by the Privacy Act 1988, the Australian Privacy Principles (APPs) apply when AI handles personal information. The Office of the Australian Information Commissioner’s AI guidance explains how the principles apply to the inputs you send and to outputs that contain personal information.
Check what your collection notice tells people under APP 5 and whether sending the data serves the purpose you collected it for or has another permitted basis under APP 6.
Work out whether the provider or its subcontractors receive personal information overseas. If that is a disclosure, APP 8 generally requires reasonable steps before disclosure, subject to exceptions. Take those steps to ensure the overseas recipient handles the information in line with the applicable APPs.
An Australian model endpoint addresses one part of that assessment. Trace what your application logs and where its connected tools send data. Check who can access the information for support.
Calling the OpenAI API From Your Own Systems
A production integration sits between your users, your organisation’s systems and the model. It checks what the signed-in user is allowed to see before it fetches records. The application sends the model the relevant passages and presents the answer for review when a person needs to decide what happens next. This is one way to implement retrieval-augmented generation, where the model answers from material fetched for each request.
A Hypothetical SharePoint Policy Assistant
- A staff member asks for a draft reply to a question about travel expenses. The application uses the staff member’s identity to search the SharePoint policy library.
- The application retrieves the current policy sections the staff member can read. It sends the question and relevant excerpts to the OpenAI API. If no accessible policy answers the question, it asks the staff member to refer the matter to the policy owner.
- The staff member receives a draft with links to the policy sections and reviews it before sending. The application logs the request ID, policy versions, model version and review outcome. Keep approved audit records in a restricted log and avoid copying full prompts or documents into it by default.
After launch, track usage cost alongside answer quality. Keep a fixed set of sample requests with expected answers and access checks. Include an expired policy and a document the test user lacks permission to read. When OpenAI announces a retirement or you change the model, run the same requests before switching traffic. Record who can approve the replacement and what result would stop the rollout.
Related reading
Token Calculator: Count Tokens and Model Costs
Paste a prompt or document to count its tokens, then see the cost per request and per month across current OpenAI, Claude and Gemini models.
OpenAI API Pricing: Models and Billing (2026)
How much will OpenAI’s API cost your project? Token rates by model, caching and batch discounts, billing and limits, and how Azure OpenAI pricing compares.
Azure OpenAI: Australian Regions and Setup
Your organisation runs on Microsoft Azure and wants GPT models. See how Azure OpenAI works, which deployments keep prompts in Australia and how to start.
What is RAG in AI? Pipelines, Uses and Limits
Retrieval-augmented generation lets an AI model answer from your own documents. A RAG pipeline has weak points, and agentic RAG helps with some of them.
embeddings
Embeddings is an Australian AI consultancy. We design, build and run AI systems inside the software, documents and data organisations already use, from offices in Perth and Melbourne.
About Embeddings