openai-api
Build with OpenAI stateless APIs - Chat Completions (GPT-5.2, o3), Realtime voice, Batch API (50% savings), Embeddings, DALL-E 3, Whisper, and TTS. Prevents 16 documented errors. Use when: implementing GPT-5 chat, streaming, function calling, embeddings for RAG, or troubleshooting rate limits (429), API errors, TypeScript issues, model name errors.
npx skills add majiayu000/claude-skill-registry --skill openai-api-brendadeeznuts1111-tier-1380-omega --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Outlines how to interact with OpenAI stateless APIs such as Chat Completions, Embeddings, Images, Audio, and related features. Describes models in the GPT-5 and GPT-4o families, including streaming, function calling, structured outputs, and vision capabilities. Covers how to request and handle responses, including messages structure, streaming, tool calls, and JSON schemas for structured outputs. Includes guidance on environment setup and installation for the openai package.
How it works
Provides concrete code examples for:
- Creating chat completions with models (e.g., gpt-5, gpt-5.2, o3) using OpenAI SDK or fetch, including streaming and function calling workflows.
- Defining tools for function calling and handling tool_calls, then re-invoking the API with tool results until no tool_calls remain.
- Using Structured Outputs via JSON Schema to enforce response formats.
- Handling Vision (GPT-4o) with image input either via URL or base64 data.
- Accessing Embeddings API with models like text-embedding-3-small or -large, including batch processing and custom dimensions.
- Interacting with Images API for DALL-E 3 generation and image edits, including multipart/form-data transfer.
When to use it
Use when implementing GPT-5 chat, streaming, function calling, embeddings for RAG, or troubleshooting rate limits (429) and API errors, as well as TypeScript issues and model name errors.
What it can touch
- Node.js SDK (openai package) and fetch approaches are demonstrated.
- Tools for function calling are defined as JSON schemas and invoked via openai.chat.completions.create with a tools array.
- JSON schemas for Structured Outputs are demonstrated through response_format with json_schema.
- Image and audio endpoints (images/generations, images/edits, whisper) are described.
Caveats
- The guide references specific models and parameters (e.g., gpt-5.2, reasoning_effort values) and notes limitations (e.g., GPT-5 not supporting temperature, top_p). It does not provide guarantees of outcomes and relies on OpenAI API behavior as described.
- Some sections show examples that depend on environment setup and network access; ensure correct API keys and environment variables.
# OpenAI API - Complete Guide **Version**: Production Ready ✅ **Package**: openai@6.16.0 **Last Updated**: 2026-01-20 --- ## Status **✅ Production Ready**: - ✅ Chat Completions API (GPT-5, GPT-4o, GPT-4 Turbo) - ✅ Embeddings API (text-embedding-3-small, text-embedding-3-large) - ✅ Images API (DALL-E 3 generation + GPT-Image-1 editing) - ✅ Audio API (Whisper transcription + TTS with 11 voices) - ✅ Moderation API (11 safety categories) - ✅ Streaming patterns (SSE) - ✅ Function calling / Tools - ✅ Structured outputs (JSON schemas) - ✅ Vision (GPT-4o) - ✅ Both Node.js SDK and fetch approaches --- ## Table of Contents 1. [Quick Start](#quick-start) 2. [Chat Completions API](#chat-completions-api) 3. [GPT-5 Series Models](#gpt-5-series-models) 4. [Streaming Patterns](#streaming-patterns) 5. [Function Calling](#function-calling) 6. [Structured Outputs](#structured-outputs) 7. [Vision (GPT-4o)](#vision-gpt-4o) 8. [Embeddings API](#embeddings-api) 9. [Images API](#images-api) 10. [Audio API](#audio-api) 11. [Moderation API](#moderation-api) 12. [Error Handling](#error-handling) 13. [Rate Limits](#rate-limits) 14. [Common Mistakes & Gotchas](#common-mistakes--gotchas) 15. [TypeScript Gotchas
- Status
- Table of Contents
- Quick Start
- Installation
- Environment Setup
- First Chat Completion (Node.js SDK)
- First Chat Completion (Fetch - Cloudflare Workers)
- Chat Completions API
- Supported Models
- Basic Request Structure
- Response Structure
- Message Roles & Multi-turn Conversations
- GPT-5 Series Models
- GPT-5.2 (Released December 11, 2025)
npm install openai@6.16.0 export OPENAI_API_KEY="sk-..."
What does the openai-api skill do?
Build with OpenAI stateless APIs - Chat Completions (GPT-5.2, o3), Realtime voice, Batch API (50% savings), Embeddings, DALL-E 3, Whisper, and TTS. Prevents 16 documented errors. Use when: implementing GPT-5 chat, streaming, function calling, embeddings for RAG, or troubleshooting rate limits (429), API errors, TypeScript issues, model name errors.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill openai-api-brendadeeznuts1111-tier-1380-omega --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
