Back to skills
SKILL.md
Openai Responses
ASecurity> **Verification Tier:** `code_example_tested` | **Last Verified:** 2026-11-18 > **Official Docs:** https://platform.openai.com/docs/api-reference/responses
- 13 stars
- 0 votes
- 0 copies
- 0 views
- Added December 2, 2026
Works with
Security analysis
92/100- Installs packages at runtime which could introduce malicious dependencies
- Installs packages at runtime which could introduce malicious dependencies
Pro scans all 2 files and shows the line behind each finding
npx -y skills add ashish7802/awesome-api-skills --skill openai-responses --agent claude-codeAre you the author of Openai Responses?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ashish7802-openai-responses)# OpenAI Responses API Skill
> **Verification Tier:** `code_example_tested` | **Last Verified:** 2026-11-18
> **Official Docs:** https://platform.openai.com/docs/api-reference/responses
## Overview
The OpenAI Responses API (`POST /v1/responses`) is OpenAI's unified interface combining text/multimodal generation, built-in tools (web search, file search, code interpreter, remote MCP servers), Structured Outputs (`text.format`), and optional server-side conversation chaining (`previous_response_id` or Conversations).
## Installation
```bash
npm install openai zod
pip install openai pydantic
```
## Authentication
Authenticate using a server-side Bearer token via `OPENAI_API_KEY`. Never expose API keys in browser bundles; proxy requests through your backend.
```bash
export OPENAI_API_KEY="sk-proj-..."
```
## Core Concepts
- **`input` vs `instructions`**: Use `instructions` for developer/system guidance and `input` for strings or structured multimodal message items.
- **`output_text` helper**: The official SDK aggregates assistant text output into `response.output_text` instead of traversing `choices[0].message.content`.
- **Structured Outputs (`text.format`)**: Pass a strict JSON Schema (`strict: true`) under `text.format` (NOT the legacy Chat Completions `response_format` field).
- **Stateful chaining**: Pass `previous_response_id` for multi-turn continuity or set `store: false` when zero server-side retention is required.
## Common Workflows
1. Initialize `new OpenAI({ apiKey: process.env.OPENAI_API_KEY, timeout: 30_000, maxRetries: 2 })`.
2. Call `client.responses.create({ model, instructions, input, text: { format: ... } })`.
3. Stream events with `stream: true` and handle `response.output_text.delta` and `response.completed`.
## Error Handling & Rate Limits
- Catch `OpenAI.APIError` and inspect `err.status` (`429` rate limit, `408`/`5xx` transient).
- Respect `retry-after` and `x-ratelimit-remaining-tokens` headers; use exponential backoff with jitter.
- Bound spending with `max_output_tokens` and explicit `AbortSignal.timeout()`.
## Security Best Practices
- Never concatenate untrusted user content into `instructions`.
- For Zero Data Retention (ZDR) / privacy-sensitive workloads, pass `store: false`.
- Validate all tool call arguments against strict schemas before executing side effects.
## AI Pitfalls
- Passing Chat Completions parameters (`messages`, `response_format`, `max_tokens`) to `client.responses.create()` instead of `input`, `text.format`, and `max_output_tokens`.
- Reading `response.choices[0].message.content` instead of `response.output_text` or iterating `response.output`.
- Forgetting `additionalProperties: false` on strict JSON Schemas.
## Production Checklist
- [ ] `OPENAI_API_KEY` stored strictly in server-side environment variables
- [ ] `max_output_tokens` and request timeout configured
- [ ] Retry/backoff logic handles HTTP `429` and `5xx`
- [ ] Strict JSON schema validation applied to structured outputs and tool arguments
## References
- [Responses API Reference](https://platform.openai.com/docs/api-reference/responses)
- [Structured Outputs Guide](https://platform.openai.com/docs/guides/structured-outputs)
## Related skills
- [`openai`](../openai/SKILL.md) — integrates with
- [`vercel-ai-sdk`](../vercel-ai-sdk/SKILL.md) — integrates with
- [`langfuse`](../langfuse/SKILL.md) — works well with
Files in this skill
- SKILL.md
- examples/quickstart.ts
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.