GPT-4o API 接入

GPT-4o 适合通用对话、多模态应用、内容生成、工具调用和生产级 AI 功能。通过 青柠AI 的 OpenAI 网关,你可以继续使用 OpenAI SDK。

Base URL


https://openai.callaiapi.com/v1

模型 ID


gpt-4o

示例


import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "csk-your-api-key",
  baseURL: "https://openai.callaiapi.com/v1",
});

const response = await client.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "写一个营销页面标题" }],
});

相关页面