openai
Skill2 starsChanged 4 months agoMITView on GitHub
Use to build with OpenAI's Responses API for text, images, files, structured output, streaming, tools, and vector embeddings.
- Reads credentials
- Installs packages
3 other projects use a version of this.
Adopted by
Most recently taken up by
- JustinPerea/nebula-nodestheir own version, first seen Sep 12, 2026
- alanalvestech/hitanktheir own version, first seen Mar 5, 2026
- jcsaaddupuy/badrobotstheir own version, first seen Feb 26, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- alanalvestech/hitank★ 38same name
- JustinPerea/nebula-nodes★ 18same name
- jcsaaddupuy/badrobots★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- anthropicSkill
- clerkSkill
- cloudflare-workersSkill
- dockerSkill
- fly-ioSkill
- github-actionsSkill
- neonSkill
- netlifySkill
- nextjsSkill
- prismaSkill
- railwaySkill
- renderSkill
- resendSkill
- sentrySkill
- stripeSkill
- supabaseSkill
- tailwindcssSkill
- terraformSkill
- upstash-redisSkill
- vercelSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Use when: adding generation, extraction, classification, vision, document analysis, or tool-calling workflows.
- Distinctive: line 23
Use when: you need structured output or embeddings for search and recommendations.
- Distinctive: line 24
Don't use for: deterministic business rules that ordinary code can implement more cheaply and reliably.
- Distinctive: line 82
Use Structured Outputs instead of JSON mode when possible.
- Distinctive: line 137
Use the same embedding model and dimensions for documents and queries.
- Very specific: line 149
Never expose OPENAI_API_KEY in browser code, mobile apps, logs, or public environment variables.
- Distinctive: line 150
Treat model output and tool arguments as untrusted input: validate, authorize, and constrain every side effect.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
OpenAI API - Skillship
Generate and analyze text, images, and files through the Responses API, with schema-safe output, typed streams, callable tools, and embeddings for semantic search.
🧭 When to use this skill
- Use when: adding generation, extraction, classification, vision, document analysis, or tool-calling workflows.
- Use when: you need structured output or embeddings for search and recommendations.
- Don't use for: deterministic business rules that ordinary code can implement more cheaply and reliably.
⚡ Quickstart
1. Install
npm install openai2. Configure (server only)
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-5.6The SDK reads OPENAI_API_KEY automatically.
3. Call the Responses API
import "server-only";
import OpenAI from "openai";
const openai = new OpenAI();
const response = await openai.responses.create({
model: process.env.OPENAI_MODEL ?? "gpt-5.6",
instructions: "Answer accurately and say when you do not know.",
input: "Explain vector databases in two sentences.",
});
console.log(response.output_text);🧩 Common recipes
Recipe: Structured output with Zod
npm install zodimport OpenAI from "openai";
import { zodTextFormat } from "openai/helpers/zod";
import { z } from "zod";
const Event = z.object({
name: z.string(),
date: z.string(),
participants: z.array(z.string()),
});
const response = await openai.responses.parse({
model: process.env.OPENAI_MODEL ?? "gpt-5.6",
input: "Alice and Bob are attending the science fair on Friday.",
text: { format: zodTextFormat(Event, "event") },
});
if (!response.output_parsed) throw new Error("No structured output returned");
console.log(response.output_parsed);Use Structured Outputs instead of JSON mode when possible. Handle refusals and incomplete responses as separate outcomes rather than assuming every response matches the schema.
Recipe: Stream text deltas
const stream = await openai.responses.create({
model: process.env.OPENAI_MODEL ?? "gpt-5.6",
input: "Write a short launch announcement.",
stream: true,
});
for await (const event of stream) {
if (event.type === "response.output_text.delta") {
process.stdout.write(event.delta);
}
}Common lifecycle events are response.created, response.output_text.delta, response.completed, and error.
Recipe: Let the model request one of your functions
const response = await openai.responses.create({
model: process.env.OPENAI_MODEL ?? "gpt-5.6",
input: "What is the weather in Paris?",
tools: [{
type: "function",
name: "get_weather",
description: "Get the current weather for a city and country.",
strict: true,
parameters: {
type: "object",
properties: { location: { type: "string" } },
required: ["location"],
additionalProperties: false,
},
}],
});
const call = response.output.find((item) => item.type === "function_call");
if (call?.type === "function_call") {
const argumentsObject = JSON.parse(call.arguments);
// Validate argumentsObject, authorize the action, execute it, then return a function_call_output.
}Recipe: Create an embedding
const result = await openai.embeddings.create({
model: "text-embedding-3-small",
input: "Semantic search text",
encoding_format: "float",
});
const vector = result.data[0].embedding; // 1,536 values by defaultUse the same embedding model and dimensions for documents and queries. For large indexes, store vectors in a vector database and rank with cosine similarity.
🚀 Ship to production
- API keys stay server-side and are scoped/rotated through project settings.
- Model ID is configurable; pin a versioned model when reproducibility matters.
- Timeouts, retries with exponential backoff, and rate-limit handling are implemented.
- Token usage, latency, model errors, and request IDs are logged without sensitive prompts.
- Structured outputs handle refusal, incomplete, and error states explicitly.
- Evals cover representative inputs before prompt/model changes are released.
🔐 Security & secrets
- Never expose
OPENAI_API_KEYin browser code, mobile apps, logs, or public environment variables. - Treat model output and tool arguments as untrusted input: validate, authorize, and constrain every side effect.
- Apply moderation and human approval where user-generated or high-impact content requires it; streaming is harder to moderate before display.
🐛 Common errors & fixes
| Symptom | Likely cause | Fix |
401 Incorrect API key | Missing, revoked, or wrong-project key | Set the server env var and verify project access |
429 response | Rate or spend limit reached | Back off with jitter, reduce concurrency, and inspect limits |
| Parsed output is empty | Refusal or incomplete response | Inspect response status/content blocks before reading parsed data |
| Tool causes unsafe action | Arguments trusted without checks | Validate schema, authorize the user, and require confirmation |
| Vector search dimensions mismatch | Different models/dimensions used | Re-embed documents and queries with identical settings |
💰 Pricing gotchas
- Generation is billed by tokens and some built-in tools have separate usage charges. Embeddings are billed by input tokens; monitor both request volume and payload size.
📚 Sources
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

