OpenAI developer platform
Developer quickstart
Set up your environment and make your first API request in minutes
5 min
1
2
3
4
5
6
7
8
import OpenAI from "openai";
const openai = new OpenAI();
const completion = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
{"role": "user", "content": "write a haiku about ai"}
]
});
Meet the models
Start building
Structured Outputs
Ensure model responses adhere to your supplied JSON schema
Realtime API
Build low-latency multimodal experiences
Assistants API
Build conversational assistants with tools and File Search
Async use cases
Batch requests for async, large-scale processing
Fine-tuning
Adapt a model to your specific use case with your data
Distillation
Evaluate and fine-tune models using production logs
Explore our guides
Prompt engineering
Get better results from LLMs
Production best practices
Transition from prototype to production
Safety best practices
Make sure your application is safe
Latency optimization
Improve latency across multiple use cases
Optimizing LLM accuracy
Maximize correctness and consistent behavior of LLMs