OpenAI developer platform
Developer quickstart
Make your first API request in minutes. Learn the basics of the OpenAI platform.
5 min
1
2
3
4
5
6
7
8
9
10
11
12
import OpenAI from "openai";
const client = new OpenAI();
const completion = await client.chat.completions.create({
model: "gpt-4o",
messages: [{
role: "user",
content: "Write a one-sentence bedtime story about a unicorn.",
}],
});
console.log(completion.choices[0].message.content);
Browse models
View allStart building
Read and generate text
Use the API to prompt a model and generate text
Use a model's vision feature
Allow models to see and analyze images in your application
Generate images as output
Create artistic or design applications with DALLĀ·E
Build apps with audio
Analyze, transcribe, and generate audio with API endpoints
Build agentic applications
Use the API to build agents that use tools and computers
Achieve complex tasks with reasoning
Use reasoning models to carry out complex tasks
Get structured data from models
Use Structured Outputs to get model responses that adhere to a JSON schema
Tailor to your use case
Adjust our models to perform specifically for your use case with fine-tuning, evals, and distillation