Ready to move beyond ChatGPT’s consumer model?
Playground (no code)
-
Sign in to the OpenAI developer platform and open Playground: https://platform.openai.com/chat/
-
Pick a model (start with a general one like GPT-5 class).
-
In the left panel, set:
-
System: rules and role (e.g., “You are a precise writing coach. Return only JSON.”)
-
User: the actual task and data.
-
(Optional) Examples: one tiny example of ideal input → output.
-
-
Temperature near 0.2–0.5 for accuracy; leave other defaults as is for now.
-
Click Run. If you like the setup, Save it as a preset so you can reuse and A/B test later.
Tip: Playground is meant for fast experimenting without code. When you are ready to automate, switch to the API.
API in 10 minutes (code knowledge needed)
1) Get an API key (and keep it secret)
-
Create a key in your API Keys page.
-
Store it in an environment variable (never hard-code or use it directly in a browser app). OpenAI Help Center
2) Choose an API
-
Responses API (newer, flexible, supports built-in tools). Recommended for new builds. OpenAI
-
Chat Completions API (widely used, simple chat “messages”). Still fully supported.
3) JavaScript (Node.js)
Install
Responses API (recommended)
(Responses API is the newer, unified interface for text, tools, and streaming.)
Chat Completions (messages with roles)
(“System/user/assistant” roles are the standard message structure in Chat Completions.) OpenAI Platform
4) Python
Install
Responses API
Chat Completions
5) Basics (same idea in Playground and API)
-
model: pick capability vs. cost/latency. Start strong, then optimize.
-
temperature: lower = more deterministic, higher = more creative.
-
max tokens / output tokens: cap the response length to avoid runaways. (See API reference.)
-
structure: ask for JSON/XML/CSV and validate before using downstream. (OpenAI supports “structured outputs” patterns.)
6) Safety and Setup Tips
-
Never expose your key in frontend code; route calls through your server.
-
If you hit “incorrect API key,” double-check the key and org settings.
-
You can assign key permissions and manage keys per project. OpenAI Help Center
Quick practice: run a format-locked check
Try this in Playground or Chat Completions:
System: “You are a strict JSON validator. Output only JSON.”
User: “List 3 breakfast ideas under 400 calories with a 1-sentence why.”
Expected:
If anything comes back with extra prose, tighten your System rules or lower temperature and re-run.