OpenAI API

Integrate OpenAI Chat Completions, Embeddings, Images, Audio, and Moderation APIs.

961|99|Updated Oct 20, 2025
One-click install
npx skills add https://github.com/jezweb/claude-skills --skill openai-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: OpenAI API
Source: https://github.com/jezweb/claude-skills/tree/main/skills/openai-api
Command: npx skills add https://github.com/jezweb/claude-skills --skill openai-api

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openai, and includes scripts (resource) and templates (resource) and references (resource) components.

What problem does it solves? This Skill provides a comprehensive, ready-to-use guide for integrating OpenAI's core APIs, eliminating the complexity of setup, error handling, and best practices. It helps you quickly build AI-powered features without extensive research or debugging, saving you time and reducing development friction.

Core Features & Use Cases

  • Full API Coverage: Master Chat Completions (GPT-5, GPT-4o), Embeddings, DALL-E 3 Image Generation, Whisper/TTS Audio, and Content Moderation.
  • Production-Ready Patterns: Implement streaming, function calling, structured outputs, and vision with robust error handling and rate limit management.
  • Multi-Platform Support: Leverage both Node.js SDK and fetch-based approaches for maximum compatibility, including Cloudflare Workers.
  • Use Case: Develop a multimodal AI assistant that can understand images, generate text, transcribe audio, and ensure content safety, all integrated seamlessly into your application.

Quick Start

1. Install SDK

npm install [email protected]

2. Set API Key

export OPENAI_API_KEY="sk-..."

3. Basic Chat Completion

import OpenAI from 'openai'; const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY }); const completion = await openai.chat.completions.create({ model: 'gpt-5', messages: [{ role: 'user', content: 'What are the three laws of robotics?' }], }); console.log(completion.choices[0].message.content);

Frequently Asked Questions about OpenAI API

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate OpenAI's Chat Completions API into my application?

Chat Completions API integration involves installing the OpenAI SDK, setting your API key, and calling the completions endpoint with model and message parameters. This Skill covers setup, streaming, function calling, and structured outputs for GPT-5 and GPT-4o models across Node.js and fetch-based environments.

Can I use OpenAI's API with Cloudflare Workers or edge runtimes?

Yes. This Skill provides fetch-based approaches for stateless operations in edge runtimes like Cloudflare Workers, enabling you to run OpenAI integrations without traditional server infrastructure while handling rate limits and error cases.

What's the best way to implement embeddings and RAG workflows with OpenAI?

Use OpenAI's Embeddings API to generate vector representations, then store and retrieve them for retrieval-augmented generation. This Skill covers token management, batch processing, and integrating embeddings into multi-step AI workflows with error handling.

How do I build a multimodal AI assistant using OpenAI's image, audio, and moderation APIs?

Multimodal integration combines Chat Completions with DALL-E 3 for image generation, Whisper and TTS for audio processing, and the Moderation API for content safety. This Skill provides production-ready patterns and error handling across all endpoints.

What are the limitations when using streaming responses with OpenAI's API?

Streaming with server-sent events (SSE) requires handling partial responses and connection management. This Skill addresses streaming constraints, token limits, rate limiting, and JSON-schema validation to ensure reliable production deployments.

Do I need the OpenAI SDK, or can I call the API directly with fetch?

Both approaches work. The SDK simplifies authentication and error handling, while fetch-based calls offer compatibility with edge runtimes. This Skill covers both methods, letting you choose based on your platform and deployment environment.