OpenAI 开发者平台
开发人员快速入门
在几分钟内设置您的环境并发出您的第一个 API 请求
5 分钟
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"}
]
});