English
主导航

旧版 API

UI Kit 演示

UI Kit 演示

文档提示

在指南或参考文档中使用 DocsTip 展示有用的提示。

文档Markdown内容

文档Markdown内容

使用 Markdown 此处的文本内容用于验证样式和链接处理。

  • 条目一
  • 条目二

内部链接 and 外部链接.

内容模式切换

响应示例
curl https://api.openai.com/v1/responses \
  -H "Authorization: Bearer $OPENAI_API_KEY"

代码示例

示例
1
2
3
4
5
6
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

const response = await client.responses.create({
  model: "gpt-4.1-mini",
  input: "Say hello",
});
示例
1
2
3
4
5
6
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

const response = await client.responses.create({
  model: "gpt-4.1-mini",
  input: "Say hello",
});

你好

代码示例

示例
1
2
3
4
5
6
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

const response = await client.responses.create({
  model: "gpt-4.1-mini",
  input: "Say hello",
});
示例
1
2
3
4
5
6
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

const response = await client.responses.create({
  model: "gpt-4.1-mini",
  input: "Say hello",
});

代码对比

之前
1
curl https://api.openai.com/v1/responses
之后
1
curl https://api.openai.com/v1/responses

内容切换器

Node SDK
1
2
3
import OpenAI from "openai";

const client = new OpenAI();

深入解析

深入探讨
为什么流式传输很重要

延迟示例

网络
最终用户到 API 的延迟
服务器
处理提示 Token 的时间
服务器
采样/生成 Token 的时间
网络
API 到最终用户的延迟

波形组件

展开器

Image

OpenAI Open Graph

Icon

图标项

Realtime 快速入门
启动 Realtime 会话并检查事件。

图库文档

Input 1Input 2Input 3Input 4
Result

代码图库

图片图库

视频图库