For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending
.md to the page URL.
Search the API docs
Suggested
Primary navigation
Suggested
Get started
Core concepts
SDKs and CLI
Legacy APIs
-
Agent Builder
-
Assistants API
Choose a model
Text and code
Prompting
Reasoning
Realtime and audio
Specialized models
Agents API
- Overview
- Quickstart
- Architecture
- Configuring Agents
-
Environments and sandboxes
-
Tools and integrations
- Multi-agent
- Observability and usage
- Tracing
- Errors and recovery
- API reference
- Bedrock Managed Agents
Agents SDK
Search and retrieval
Connect tools and data
Build tool workflows
Computer and code
Media
GPT-Live
Realtime API
Build with voice
Performance and quality
Evaluation
Cost and throughput
Safety and governance
Infrastructure and access
Operations
Core concepts
Build
Test and publish
Conversion specs
Guides
Identity
Guides
Advertiser API
API Reference
Explore
Available on
Releases
Workflows
Capabilities
ChatGPT Space
Reference
Customization
Extend ChatGPT and Codex
Linux
Windows
Development workflows
Extend and automate
Environments
Codex Cloud
Build with Codex
Third-party integrations
Permissions
Codex Security
- Overview
-
Codex Security Cloud
-
Codex Security CLI
- Codex Security SDK
Cyber safety
Getting started
Feature Configuration
Identity and access
Deployment and configuration
ChatGPT Work
Collaboration and sharing
Plugins and connections
Usage and analytics
Security and compliance
Recent
Topics
Contribute
API Platform
Developer quickstart
Make your first API request in minutes. Learn the basics of the OpenAI platform.
JavaScript
1
2
3
4
5
6
7curl https://api.openai.com/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-6-astra",
"input": "Write a short bedtime story about a unicorn."
}'1
2
3
4
5
6
7
8
9import OpenAI from "openai";
const client = new OpenAI();
const response = await client.responses.create({
model: "gpt-6-astra",
input: "Write a short bedtime story about a unicorn.",
});
console.log(response.output_text);1
2
3
4
5
6
7from openai import OpenAI
client = OpenAI()
response = client.responses.create(model="gpt-6-astra", input="Write a short bedtime story about a unicorn.")
print(response.output_text)1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/responses"
)
func main() {
client := openai.NewClient()
response, err := client.Responses.New(context.Background(), responses.ResponseNewParams{
Model: "gpt-6-astra",
Input: responses.ResponseNewParamsInputUnion{
OfString: openai.String("Write a short bedtime story about a unicorn."),
},
})
if err != nil {
panic(err)
}
fmt.Println(response.OutputText())
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.responses.Response;
import com.openai.models.responses.ResponseCreateParams;
public class PlatformOverviewExample {
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
ResponseCreateParams params =
ResponseCreateParams.builder().model("gpt-6-astra").input("Write a short bedtime story about a unicorn.").build();
Response response = client.responses().create(params);
response.output().stream()
.flatMap(item -> item.message().stream())
.flatMap(message -> message.content().stream())
.flatMap(content -> content.outputText().stream())
.forEach(outputText -> System.out.println(outputText.text()));
}
}1
2
3
4
5
6
7
8
9
10
11
12using OpenAI.Responses;
#pragma warning disable OPENAI001
string key = Environment.GetEnvironmentVariable("OPENAI_API_KEY")!;
ResponsesClient client = new(key);
ResponseResult response = await client.CreateResponseAsync(
"gpt-6-astra",
"Write a short bedtime story about a unicorn."
);
Console.WriteLine(response.GetOutputText());1
2
3
4
5
6
7
8
9
10require "openai"
openai = OpenAI::Client.new
response = openai.responses.create(
model: "gpt-6-astra",
input: "Write a short bedtime story about a unicorn."
)
puts(response.output_text)1
2
3
4
5openai responses create \
--model gpt-6-astra \
--input "Write a short bedtime story about a unicorn." \
--raw-output \
--transform 'output.#(type=="message").content.0.text'Build paths
Models
Start with GPT-6 Astra for complex reasoning and coding, choose GPT-6.1 Sol to balance intelligence and cost, or use GPT-6 Luna for cost-sensitive, high-volume workloads.
Start building
Read and generate text
Use the API to prompt a model and generate text
Use a model's vision capabilities
Allow models to see and analyze images in your application
Generate images as output
Create images with GPT Image 2
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
Docs agent
Loading docs agent...
