Free tools Windows power users keep installed
One-click scans. No signup required.
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
To use the ChatGPT API, create an API key in the OpenAI dashboard, keep it on a server, and send a request using an official SDK or HTTP. The official materials call it the OpenAI API and offer several API surfaces: Responses is the general starting point for model requests and tool workflows, while Realtime is designed for low-latency voice and audio sessions. This tutorial walks through a first request and the decisions to make before building on it.
What you need before your first request
- An OpenAI API key created in the OpenAI dashboard.
- A server-side environment where you can install a client library or make HTTPS requests.
- A model selected from the current model catalog based on your task, required capabilities, and budget.
An API key is a secret credential. Do not put it in browser JavaScript, a mobile app, a public repository, or any other code distributed to users. Those environments cannot reliably keep a key secret. Instead, have your application send requests to your server, and have that server call the API.
Make a first request with the official Python library
The official quickstart demonstrates using an environment variable for the key, creating a client, calling client.responses.create, and reading generated text. The example below follows that pattern. It reads the model name from an environment variable rather than assuming a particular model will remain available or appropriate.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute1. Set up the environment
Install the official Python package in your project environment:
#1 Best Overall
python -m pip install openai
Set the API key and the model you have chosen from the current model catalog as environment variables. For example, in a Unix-like shell:
export OPENAI_API_KEY="your_api_key"
export OPENAI_MODEL="your_selected_model"
Use your actual secret key and a model identifier listed in the current catalog. Avoid saving the key in source code or committing a local environment file that contains it.
Rank #2
2. Send a request
import os
from openai import OpenAI
client = OpenAI() # Reads OPENAI_API_KEY from the environment.
response = client.responses.create(
model=os.environ["OPENAI_MODEL"],
input="Explain what an API is in one sentence."
)
print(response.output_text)
The request sends a text input to the Responses API and prints the generated text. If the call succeeds, the terminal displays the model’s response. Keep the API call on the server side when you incorporate it into a web or mobile product.
Recommended Free Tools
Choose the API surface that fits the interaction
API surfaces are not interchangeable labels for the same workflow. Choose based on what your product needs to send, receive, and maintain between interactions.
| API surface | Use it when | Consider |
|---|---|---|
| Responses | You need general model requests, text, image or audio inputs, tool use, or stateful interactions. | It is the recommended starting point for direct model requests and many tool workflows. Check the endpoint and feature behavior for the interaction and state you need. |
| Realtime | Your product needs low-latency voice or audio sessions. | Choose it for a realtime interaction pattern rather than treating a series of ordinary requests as equivalent. |
| Administration | You need organization-management workflows. | This is for administration, not a substitute for an application’s model-request endpoint. |
For a conventional prompt-and-response feature, begin with Responses. The official quickstart also shows ways to expand a basic request with image and file inputs, built-in tools, streaming, and an agent example; each adds its own implementation and operational considerations.
Pick a model using current capabilities and costs
There is no permanently correct model choice for every application. Check the current official model catalog because model availability, defaults, and capabilities can change. Compare the options against the specific job rather than choosing by name alone.
- Inputs, outputs, and tools: Confirm the model supports the modalities and tool use your feature requires.
- Capability: Match the model’s capabilities to the quality and complexity your task needs.
- Interaction pattern and latency: Decide whether you need a single response, streamed output, stateful interaction, or a realtime session.
- Cost: Estimate expected input and output token usage, plus any applicable tool or other service charges.
- Operations and data needs: Account for rate limits, request logging, and any retention or regional requirements that apply to your application.
Revisit model selection as the product changes. A model suitable for a prototype may not be the right choice once you have real usage, latency targets, and quality requirements.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Estimate API cost before launch
The API surface itself is not separately priced. Usage is priced according to the selected model’s input and output rates, and tools or other services may add charges. Rates and promotions can change, so use the live official pricing page when estimating a project; do not rely on an undated token-price figure.
Best Value
- Choose a model from the current catalog and confirm its current pricing.
- Estimate how much input your application sends and how much output it expects per request.
- Estimate the number of requests over your intended billing period.
- Add any applicable tool or other service charges, then review actual usage after deployment.
Your estimate depends on your prompts, outputs, model choice, request volume, and feature use. A useful budget therefore starts with the way your application will actually behave, not just a headline rate.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Harden the integration for production
A successful test request is only the start. Before exposing a feature to users, decide how your server will handle failures, traffic limits, and support investigations.
- Protect credentials: Load the key from a server-side environment variable or a key-management service. Restrict access to the secret and rotate it if it is exposed.
- Handle errors and rate limits: Plan for unsuccessful requests and rate-limit responses instead of assuming every call succeeds. Use the current API guidance for the error and limit behavior relevant to your account and endpoint.
- Log request IDs: Capture request IDs where available so a specific API request can be identified when troubleshooting. Avoid putting secrets in logs.
- Control traffic: Keep API calls behind your own server so you can apply application-level checks and manage how your users consume the feature.
These practices help separate user-facing application behavior from API availability and make it easier to investigate a particular failed request.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesUnderstand data use, retention, and application state
OpenAI says API data is not used to train or improve its models unless the customer opts in. That does not mean no data is stored. Abuse-monitoring logs may contain content and are retained for up to 30 days by default, subject to exceptions. Application state depends on the endpoint, feature, and settings in use.
Before sending user or sensitive data, check the current data-controls guidance and the behavior documented for the specific endpoint and feature you use. Do not assume that the training-use policy determines how long data is retained or whether an interaction has application state; those are separate questions.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

