Skip to content
masterclass Buddy

AI Tools · Tool

OpenAI API

The OpenAI provider lets the AI SDK use OpenAI language, embedding, image, and transcription models. Use AI Gateway with a model string or connect directly through @ai-sdk/openai.

Last updated

Syntax

import { openai, createOpenAI } from "@ai-sdk/openai";
const model = openai("model-id");
const custom = createOpenAI({ baseURL, apiKey, headers });

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • createOpenAI
  • openai.chat
  • openai.transcription
  • generateText
  • transcribe
  • OpenAITranscriptionModelOptions
  • AI Gateway

Source: OpenAI | AI SDK. Checked 2026-11-03.