Complete reference for OpenAI's stateless APIs including Chat Completions, embeddings, images, audio, and moderation.
Works with
Supports GPT-5 series (with reasoning_effort control), GPT-4o multimodal, o3 reasoning models, and legacy GPT-4 variants; streaming, function calling, and structured JSON outputs included
Embeddings API for RAG with custom dimensions (256–3072), DALL-E 3 image generation, Whisper transcription, and TTS with 11 voices
Batch API for 50% cost savings on large-scale proce
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionopenai-apiExecute the skills CLI command in your project's root directory to begin installation:
Fetches openai-api from jezweb/claude-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate openai-api. Access via /openai-api in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
697
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
697
stars
Version: Production Ready ✅ Package: [email protected] Last Updated: 2026-01-20
✅ Production Ready:
npm install [email protected]
export OPENAI_API_KEY="sk-..."
Or create .env file:
OPENAI_API_KEY=sk-...
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);
const response = await fetch('https://api.openai.com/v1/chat/completions', {
method: 'POST',
headers: {
'Authorization': `Bearer ${env.OPENAI_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'gpt-5',
messages: [
{ role: 'user', content: 'What are the three laws of robotics?' }
],
}),
});
const data = await response.json();
console.log(data.choices[0].message.content);
Endpoint: POST /v1/chat/completions
The Chat Completions API is the core interface for interacting with OpenAI's language models. It supports conversational AI, text generation, function calling, structured outputs, and vision capabilities.
{
model: string, // Model to use (e.g., "gpt-5")
messages: Message[], // Conversation history
reasoning_effort?: string, // GPT-5 only: "minimal" | "low" | "medium" | "high"
verbosity?: string, // GPT-5 only: "low" | "medium" | "high"
temperature?: number, // NOT supported by GPT-5
max_tokens?: number, // Max tokens to generate
stream?: boolean, // Enable streaming
tools?: Tool[], // Function calling tools
}
{
id: string, // Unique completion ID
object: "chat.completion",
created: number, // Unix timestamp
model: string, // Model used
choices: [{
index: number,
message: {
role: "assistant",
content: string, // Generated text
tool_calls?: ToolCall[] // If function calling
},
finish_reason: string // "stop" | "length" | "tool_calls"
}],
usage: {
prompt_tokens: number,
completion_tokens: number,
total_tokens: number
}
}
Three roles: system (behavior), user (input), assistant (model responses).
Important: API is stateless - send full conversation history each request. For stateful conversations, use openai-responses skill.
GPT-5 models (released August 2025) introduce reasoning and verbosity controls.
Latest flagship model:
// GPT-5.2 with maximum reasoning
const completion = await openai.chat.completions.create({
model: 'gpt-5.2',
messages: [{ role: 'user', content: 'Solve this extremely complex problem...' }],
reasoning_effort: 'xhigh', // NEW: Beyond "high"
});
Warmer, more intelligent model:
BREAKING CHANGE: GPT-5.1/5.2 default to reasoning_effort: 'none' (vs GPT-5 defaulting to 'medium').
Dedicated reasoning models (separate from GPT-5):
| Model | Released | Purpose |
|---|---|---|
| o3 | Apr 16, 2025 | Successor to o1, advanced reasoning |
| o3-pro | Jun 10, 2025 | Extended compute version of o3 |
| o3-mini | Jan 31, 2025 | Smaller, faster o3 variant |
| o4-mini | Apr 16, 2025 | Fast, cost-efficient reasoning |
// O-series models
const completion = await openai.chat.completions.create({
model: 'o3', // or 'o3-mini', 'o4-mini'
messages: [{ role: 'user', content: 'Complex reasoning task...' }],
});
Note: O-series may be deprecated in favor of GPT-5 with reasoning_effort parameter.
Controls thinking depth (GPT-5/5.1/5.2):
Controls output detail (GPT-5 series):
NOT Supported:
temperature, top_p, logprobs parametersAlternatives: Use GPT-4o for temperature/top_p, or openai-responses skill for stateful reasoning
Enable with stream: true for token-by-token delivery.
Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
jezweb/claude-skills
jezweb/claude-skills
jwynia/agent-skills
mindrally/skills
kostja94/marketing-skills
github/awesome-copilot
Solid pick for teams standardizing on skills: openai-api is focused, and the summary matches what you get after install.
openai-api fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
Registry listing for openai-api matched our evaluation — installs cleanly and behaves as described in the markdown.
We added openai-api from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
Useful defaults in openai-api — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
openai-api reduced setup friction for our internal harness; good balance of opinion and flexibility.
openai-api is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
Registry listing for openai-api matched our evaluation — installs cleanly and behaves as described in the markdown.
openai-api fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
We added openai-api from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
showing 1-10 of 50