[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79AGH7WFMPX2GC5CCBC0EFY":3,"skill-same:01M79AGH7WFMPX2GC5CCBC0EFY":147},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":14,"repositoryHtmlUrl":50,"repositoryHomepageUrl":6,"ownerHtmlUrl":51,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":52,"install":53,"resources":66},"01M79AGH7WFMPX2GC5CCBC0EFY","openai-responses",null,"OpenAI Responses API for stateful agentic applications with reasoning preservation. Use for MCP integration, built-in tools, background processing, or migrating from Chat Completions.","Elogic360\u002Fsoftware-factory","Elogic360","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F156535519?v=4","01M74NH3F0RB13PWB7JZDE2V80","elogic360","01M74NH3FPC65082MDZVMFHDM3",0,"MIT","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: openai-responses\ndescription: \"OpenAI Responses API for stateful agentic applications with reasoning preservation. Use for MCP integration, built-in tools, background processing, or migrating from Chat Completions.\"\nlicense: MIT\nmetadata:\n  version: \"2.0.0\"\n  last_verified: \"2025-11-18\"\n  api_launch: \"March 2025\"\n  sdk_version: \"openai@5.19.1+\"\n  templates_included: 10\n  references_included: 8\n  keywords:\n    - responses api\n    - openai responses\n    - stateful openai\n    - openai mcp\n    - code interpreter openai\n    - file search openai\n    - web search openai\n    - image generation openai\n    - reasoning preservation\n    - agentic workflows\n    - conversation state\n    - background mode\n    - chat completions migration\n    - gpt-5\n    - polymorphic outputs\n---\n# OpenAI Responses API\n\n**Status**: Production Ready | **API Launch**: March 2025 | **SDK**: openai@5.19.1+\n\n---\n\n## Quick Start (5 Minutes)\n\n### Node.js\n\n```typescript\nimport OpenAI from 'openai';\n\nconst openai = new OpenAI({\n  apiKey: process.env.OPENAI_API_KEY,\n});\n\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'What are the 5 Ds of dodgeball?',\n});\n\nconsole.log(response.output_text);\n```\n\n### Cloudflare Workers\n\n```typescript\nconst response = await fetch('https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fresponses', {\n  method: 'POST',\n  headers: {\n    'Authorization': `Bearer ${env.OPENAI_API_KEY}`,\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    model: 'gpt-5',\n    input: 'Hello, world!',\n  }),\n});\n\nconst data = await response.json();\nconsole.log(data.output_text);\n```\n\n**Load `references\u002Fsetup-guide.md` for complete setup with stateful conversations and built-in tools.**\n\n---\n\n## What Is the Responses API?\n\nThe Responses API (`\u002Fv1\u002Fresponses`) is OpenAI's unified interface for agentic applications launched March 2025. **Key Innovation**: Preserved reasoning state across turns (unlike Chat Completions which discards it), improving multi-turn performance by ~5% on TAUBench.\n\n**Why Use Responses Over Chat Completions?** Automatic state management, preserved reasoning, server-side tools, 40-80% better cache utilization, and built-in MCP support.\n\n**Load `references\u002Fresponses-vs-chat-completions.md` for complete comparison and decision guide.**\n\n---\n\n## Top 3 Critical Rules\n\n### Always Do ✅\n\n1. **Store conversation_id** - Preserve state between turns (most critical)\n2. **Use environment variables** for API keys (NEVER hardcode)\n3. **Handle polymorphic outputs** - Check `output.type` (message, reasoning, function_call)\n\n### Never Do ❌\n\n1. **Never ignore conversation_id** - State will be lost\n2. **Never assume single output type** - Always check `output.type`\n3. **Never mix Chat Completions and Responses** in same conversation\n\n**Load `references\u002Fsetup-guide.md` for complete rules and best practices.**\n\n---\n\n## Top 5 Use Cases\n\n### Use Case 1: Stateful Conversation\n\n```typescript\n\u002F\u002F First turn\nconst response1 = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'My favorite color is blue.',\n});\n\nconst conversationId = response1.conversation_id;\n\n\u002F\u002F Second turn - model remembers\nconst response2 = await openai.responses.create({\n  model: 'gpt-5',\n  conversation_id: conversationId,\n  input: 'What is my favorite color?',\n});\n\u002F\u002F Output: \"Your favorite color is blue.\"\n```\n\n**Load**: `references\u002Fstateful-conversations.md` + `templates\u002Fstateful-conversation.ts`\n\n---\n\n### Use Case 2: Web Search Agent\n\n```typescript\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Search the web for latest AI news.',\n  tools: {\n    web_search: { enabled: true },\n  },\n});\n```\n\n**Load**: `references\u002Fbuilt-in-tools-guide.md` + `templates\u002Fweb-search.ts`\n\n---\n\n### Use Case 3: Code Interpreter\n\n```typescript\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Calculate the sum of squares from 1 to 100.',\n  tools: {\n    code_interpreter: { enabled: true },\n  },\n});\n```\n\n**Load**: `references\u002Fbuilt-in-tools-guide.md` + `templates\u002Fcode-interpreter.ts`\n\n---\n\n### Use Case 4: File Search (RAG)\n\n```typescript\n\u002F\u002F Upload file\nconst file = await openai.files.create({\n  file: fs.createReadStream('document.pdf'),\n  purpose: 'user_data',\n});\n\n\u002F\u002F Search file\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Summarize key points from the uploaded document.',\n  tools: {\n    file_search: {\n      enabled: true,\n      file_ids: [file.id],\n    },\n  },\n});\n```\n\n**Load**: `references\u002Fbuilt-in-tools-guide.md` + `templates\u002Ffile-search.ts`\n\n---\n\n### Use Case 5: MCP Server Integration\n\n```typescript\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Get weather for San Francisco.',\n  tools: {\n    mcp_servers: [\n      {\n        url: 'https:\u002F\u002Fweather-mcp.example.com',\n        tool_choice: 'auto',\n      },\n    ],\n  },\n});\n```\n\n**Load**: `references\u002Fmcp-integration-guide.md` + `templates\u002Fmcp-integration.ts`\n\n---\n\n## Built-in Tools\n\nAll tools run server-side: **Code Interpreter** (Python execution), **File Search** (RAG), **Web Search** (real-time), **Image Generation** (DALL-E).\n\nEnable explicitly:\n\n```typescript\ntools: {\n  code_interpreter: { enabled: true },\n  file_search: { enabled: true, file_ids: ['file-123'] },\n  web_search: { enabled: true },\n  image_generation: { enabled: true },\n}\n```\n\n**Load `references\u002Fbuilt-in-tools-guide.md` for complete guide with examples and configuration options.**\n\n---\n\n## Stateful Conversations\n\nAutomatic state management with conversation IDs eliminates manual message tracking, preserves reasoning, and improves cache utilization by 40-80%.\n\n```typescript\n\u002F\u002F Create conversation\nconst response1 = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Remember: my name is Alice.',\n});\n\n\u002F\u002F Continue conversation\nconst response2 = await openai.responses.create({\n  model: 'gpt-5',\n  conversation_id: response1.conversation_id,\n  input: 'What is my name?',\n});\n```\n\n**Load `references\u002Fstateful-conversations.md` for persistence patterns (Node.js\u002FRedis\u002FKV) and lifecycle management.**\n\n---\n\n## Migration from Chat Completions\n\nQuick changes: `messages` → `input`, `system` role → `developer`, `choices[0].message.content` → `output_text`, `\u002Fv1\u002Fchat\u002Fcompletions` → `\u002Fv1\u002Fresponses`.\n\n**Before (Chat Completions):**\n\n```typescript\nconst messages = [{ role: 'user', content: 'Hello' }];\nconst response = await openai.chat.completions.create({\n  model: 'gpt-4o',\n  messages: messages,\n});\nmessages.push(response.choices[0].message); \u002F\u002F Manual history\n```\n\n**After (Responses API):**\n\n```typescript\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Hello',\n});\n\nconst response2 = await openai.responses.create({\n  model: 'gpt-5',\n  conversation_id: response.conversation_id, \u002F\u002F Automatic state\n  input: 'Follow-up question',\n});\n```\n\n**Load `references\u002Fmigration-guide.md` for complete migration checklist with tool migration patterns.**\n\n---\n\n## Polymorphic Outputs\n\nResponses can return multiple output types (message, reasoning, function_call, image). Handle each type or use `output_text` convenience property.\n\n```typescript\nfor (const output of response.output) {\n  if (output.type === 'message') {\n    console.log('Message:', output.content);\n  } else if (output.type === 'reasoning') {\n    console.log('Reasoning:', output.summary);\n  } else if (output.type === 'function_call') {\n    console.log('Function:', output.name, output.arguments);\n  }\n}\n\n\u002F\u002F Or use convenience property\nconsole.log(response.output_text);\n```\n\n**Load `references\u002Freasoning-preservation.md` for reasoning output details and debugging patterns.**\n\n---\n\n## Background Mode\n\nFor long-running tasks (>60 seconds), use `background: true` to run asynchronously and poll for completion.\n\n```typescript\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Analyze this 50-page document.',\n  background: true,\n});\n\n\u002F\u002F Poll for completion\nconst completed = await openai.responses.retrieve(response.id);\n```\n\n**Load `templates\u002Fbackground-mode.ts` for complete polling pattern with exponential backoff.**\n\n---\n\n## Top 3 Errors & Solutions\n\n### Error 1: Session State Not Persisting\n\n**Symptom**: Model doesn't remember previous turns.\n\n**Cause**: Not using conversation IDs or creating new conversation each time.\n\n**Solution**:\n\n```typescript\n\u002F\u002F ✅ GOOD: Reuse conversation ID\nconst conv = await openai.conversations.create();\nconst response1 = await openai.responses.create({\n  model: 'gpt-5',\n  conversation: conv.id, \u002F\u002F Same ID\n  input: 'Question 1',\n});\nconst response2 = await openai.responses.create({\n  model: 'gpt-5',\n  conversation: conv.id, \u002F\u002F Same ID - remembers previous\n  input: 'Question 2',\n});\n```\n\n---\n\n### Error 2: MCP Server Connection Failed\n\n**Cause**: Invalid server URL, missing\u002Fexpired authorization token.\n\n**Solution**:\n\n```typescript\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Test MCP',\n  tools: [\n    {\n      type: 'mcp',\n      server_url: 'https:\u002F\u002Fmcp.stripe.com', \u002F\u002F ✅ Full HTTPS URL\n      authorization: process.env.STRIPE_OAUTH_TOKEN, \u002F\u002F ✅ Valid token\n    },\n  ],\n});\n```\n\n**Prevention**: Use environment variables for secrets, implement token refresh logic, add retry with exponential backoff.\n\n---\n\n### Error 3: Code Interpreter Timeout\n\n**Cause**: Code runs longer than 30 seconds (standard mode limit).\n\n**Solution**:\n\n```typescript\n\u002F\u002F ✅ GOOD: Use background mode for long tasks\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Process this massive dataset',\n  background: true, \u002F\u002F ✅ Up to 10 minutes\n  tools: [{ type: 'code_interpreter' }],\n});\n\n\u002F\u002F Poll for results\nlet result = await openai.responses.retrieve(response.id);\nwhile (result.status === 'in_progress') {\n  await new Promise(r => setTimeout(r, 5000));\n  result = await openai.responses.retrieve(response.id);\n}\n```\n\n**Load `references\u002Ftop-errors.md` for all 8 errors with detailed solutions and prevention strategies.**\n\n---\n\n## When to Load References\n\n### Load `references\u002Fsetup-guide.md` when:\n- First-time Responses API user needing complete Node.js or Cloudflare Workers setup\n- Want production deployment checklist with environment-specific best practices\n- Troubleshooting setup issues or implementing streaming\u002Fbackground patterns\n\n### Load `references\u002Fresponses-vs-chat-completions.md` when:\n- Deciding between Responses and Chat Completions APIs\n- Understanding performance benchmarks (TAUBench results, cache utilization)\n- Evaluating migration effort or comparing cost structures\n\n### Load `references\u002Fmigration-guide.md` when:\n- Migrating from Chat Completions API with step-by-step checklist\n- Need code comparison examples (before\u002Fafter patterns)\n- Migrating tools from custom functions to built-in\u002FMCP\n\n### Load `references\u002Fbuilt-in-tools-guide.md` when:\n- Using Code Interpreter, File Search, Web Search, or Image Generation\n- Need tool configuration options, combining multiple tools, or troubleshooting\n\n### Load `references\u002Fmcp-integration-guide.md` when:\n- Integrating external MCP servers or building custom MCP tools\n- Need MCP configuration examples or authentication patterns\n\n### Load `references\u002Fstateful-conversations.md` when:\n- Implementing conversation persistence with KV\u002FRedis\u002Fdatabase\n- Need conversation lifecycle management or metadata tracking patterns\n\n### Load `references\u002Freasoning-preservation.md` when:\n- Want to access model reasoning for debugging or transparency\n- Building auditable AI systems or need reasoning output examples\n\n### Load `references\u002Ftop-errors.md` when:\n- Encountering API errors (8 common errors covered with solutions)\n- Need error code reference, prevention strategies, or error handling patterns\n\n---\n\n## Production Checklist\n\nBefore deploying:\n\n- [ ] API key stored securely (environment variable or secret)\n- [ ] Error handling implemented (401, 429, 400, 500)\n- [ ] Rate limiting handled (exponential backoff)\n- [ ] Conversation IDs persisted (database\u002FKV)\n- [ ] Streaming enabled for long responses\n- [ ] Tools enabled explicitly\n- [ ] Polymorphic output handling\n\n**Load `references\u002Fsetup-guide.md` for complete production checklist with platform-specific considerations.**\n\n---\n\n## Related Skills\n\n- **openai-api** - Classic Chat Completions API\n- **openai-agents** - OpenAI Agents SDK (wrapper for Responses)\n- **claude-api** - Claude API for comparison\n- **ai-sdk-core** - Vercel AI SDK (supports Responses)\n\n---\n\n## Official Documentation\n\n- **Responses API**: https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fapi-reference\u002Fresponses\n- **Migration Guide**: https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fresponses-migration\n- **Built-in Tools**: https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fresponses-tools\n- **MCP Integration**: https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fmcp\n\n---\n\n**Questions? Issues?**\n\n1. Check `references\u002Ftop-errors.md` for error solutions\n2. Review `references\u002Fsetup-guide.md` for complete setup\n3. See `references\u002Fmigration-guide.md` for Chat Completions migration\n4. Load templates from `templates\u002F` for working examples\n","# OpenAI Responses API\n\n**Status**: Production Ready | **API Launch**: March 2025 | **SDK**: openai@5.19.1+\n\n---\n\n## Quick Start (5 Minutes)\n\n### Node.js\n\n```typescript\nimport OpenAI from 'openai';\n\nconst openai = new OpenAI({\n  apiKey: process.env.OPENAI_API_KEY,\n});\n\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'What are the 5 Ds of dodgeball?',\n});\n\nconsole.log(response.output_text);\n```\n\n### Cloudflare Workers\n\n```typescript\nconst response = await fetch('https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fresponses', {\n  method: 'POST',\n  headers: {\n    'Authorization': `Bearer ${env.OPENAI_API_KEY}`,\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    model: 'gpt-5',\n    input: 'Hello, world!',\n  }),\n});\n\nconst data = await response.json();\nconsole.log(data.output_text);\n```\n\n**Load `references\u002Fsetup-guide.md` for complete setup with stateful conversations and built-in tools.**\n\n---\n\n## What Is the Responses API?\n\nThe Responses API (`\u002Fv1\u002Fresponses`) is OpenAI's unified interface for agentic applications launched March 2025. **Key Innovation**: Preserved reasoning state across turns (unlike Chat Completions which discards it), improving multi-turn performance by ~5% on TAUBench.\n\n**Why Use Responses Over Chat Completions?** Automatic state management, preserved reasoning, server-side tools, 40-80% better cache utilization, and built-in MCP support.\n\n**Load `references\u002Fresponses-vs-chat-completions.md` for complete comparison and decision guide.**\n\n---\n\n## Top 3 Critical Rules\n\n### Always Do ✅\n\n1. **Store conversation_id** - Preserve state between turns (most critical)\n2. **Use environment variables** for API keys (NEVER hardcode)\n3. **Handle polymorphic outputs** - Check `output.type` (message, reasoning, function_call)\n\n### Never Do ❌\n\n1. **Never ignore conversation_id** - State will be lost\n2. **Never assume single output type** - Always check `output.type`\n3. **Never mix Chat Completions and Responses** in same conversation\n\n**Load `references\u002Fsetup-guide.md` for complete rules and best practices.**\n\n---\n\n## Top 5 Use Cases\n\n### Use Case 1: Stateful Conversation\n\n```typescript\n\u002F\u002F First turn\nconst response1 = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'My favorite color is blue.',\n});\n\nconst conversationId = response1.conversation_id;\n\n\u002F\u002F Second turn - model remembers\nconst response2 = await openai.responses.create({\n  model: 'gpt-5',\n  conversation_id: conversationId,\n  input: 'What is my favorite color?',\n});\n\u002F\u002F Output: \"Your favorite color is blue.\"\n```\n\n**Load**: `references\u002Fstateful-conversations.md` + `templates\u002Fstateful-conversation.ts`\n\n---\n\n### Use Case 2: Web Search Agent\n\n```typescript\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Search the web for latest AI news.',\n  tools: {\n    web_search: { enabled: true },\n  },\n});\n```\n\n**Load**: `references\u002Fbuilt-in-tools-guide.md` + `templates\u002Fweb-search.ts`\n\n---\n\n### Use Case 3: Code Interpreter\n\n```typescript\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Calculate the sum of squares from 1 to 100.',\n  tools: {\n    code_interpreter: { enabled: true },\n  },\n});\n```\n\n**Load**: `references\u002Fbuilt-in-tools-guide.md` + `templates\u002Fcode-interpreter.ts`\n\n---\n\n### Use Case 4: File Search (RAG)\n\n```typescript\n\u002F\u002F Upload file\nconst file = await openai.files.create({\n  file: fs.createReadStream('document.pdf'),\n  purpose: 'user_data',\n});\n\n\u002F\u002F Search file\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Summarize key points from the uploaded document.',\n  tools: {\n    file_search: {\n      enabled: true,\n      file_ids: [file.id],\n    },\n  },\n});\n```\n\n**Load**: `references\u002Fbuilt-in-tools-guide.md` + `templates\u002Ffile-search.ts`\n\n---\n\n### Use Case 5: MCP Server Integration\n\n```typescript\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Get weather for San Francisco.',\n  tools: {\n    mcp_servers: [\n      {\n        url: 'https:\u002F\u002Fweather-mcp.example.com',\n        tool_choice: 'auto',\n      },\n    ],\n  },\n});\n```\n\n**Load**: `references\u002Fmcp-integration-guide.md` + `templates\u002Fmcp-integration.ts`\n\n---\n\n## Built-in Tools\n\nAll tools run server-side: **Code Interpreter** (Python execution), **File Search** (RAG), **Web Search** (real-time), **Image Generation** (DALL-E).\n\nEnable explicitly:\n\n```typescript\ntools: {\n  code_interpreter: { enabled: true },\n  file_search: { enabled: true, file_ids: ['file-123'] },\n  web_search: { enabled: true },\n  image_generation: { enabled: true },\n}\n```\n\n**Load `references\u002Fbuilt-in-tools-guide.md` for complete guide with examples and configuration options.**\n\n---\n\n## Stateful Conversations\n\nAutomatic state management with conversation IDs eliminates manual message tracking, preserves reasoning, and improves cache utilization by 40-80%.\n\n```typescript\n\u002F\u002F Create conversation\nconst response1 = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Remember: my name is Alice.',\n});\n\n\u002F\u002F Continue conversation\nconst response2 = await openai.responses.create({\n  model: 'gpt-5',\n  conversation_id: response1.conversation_id,\n  input: 'What is my name?',\n});\n```\n\n**Load `references\u002Fstateful-conversations.md` for persistence patterns (Node.js\u002FRedis\u002FKV) and lifecycle management.**\n\n---\n\n## Migration from Chat Completions\n\nQuick changes: `messages` → `input`, `system` role → `developer`, `choices[0].message.content` → `output_text`, `\u002Fv1\u002Fchat\u002Fcompletions` → `\u002Fv1\u002Fresponses`.\n\n**Before (Chat Completions):**\n\n```typescript\nconst messages = [{ role: 'user', content: 'Hello' }];\nconst response = await openai.chat.completions.create({\n  model: 'gpt-4o',\n  messages: messages,\n});\nmessages.push(response.choices[0].message); \u002F\u002F Manual history\n```\n\n**After (Responses API):**\n\n```typescript\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Hello',\n});\n\nconst response2 = await openai.responses.create({\n  model: 'gpt-5',\n  conversation_id: response.conversation_id, \u002F\u002F Automatic state\n  input: 'Follow-up question',\n});\n```\n\n**Load `references\u002Fmigration-guide.md` for complete migration checklist with tool migration patterns.**\n\n---\n\n## Polymorphic Outputs\n\nResponses can return multiple output types (message, reasoning, function_call, image). Handle each type or use `output_text` convenience property.\n\n```typescript\nfor (const output of response.output) {\n  if (output.type === 'message') {\n    console.log('Message:', output.content);\n  } else if (output.type === 'reasoning') {\n    console.log('Reasoning:', output.summary);\n  } else if (output.type === 'function_call') {\n    console.log('Function:', output.name, output.arguments);\n  }\n}\n\n\u002F\u002F Or use convenience property\nconsole.log(response.output_text);\n```\n\n**Load `references\u002Freasoning-preservation.md` for reasoning output details and debugging patterns.**\n\n---\n\n## Background Mode\n\nFor long-running tasks (>60 seconds), use `background: true` to run asynchronously and poll for completion.\n\n```typescript\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Analyze this 50-page document.',\n  background: true,\n});\n\n\u002F\u002F Poll for completion\nconst completed = await openai.responses.retrieve(response.id);\n```\n\n**Load `templates\u002Fbackground-mode.ts` for complete polling pattern with exponential backoff.**\n\n---\n\n## Top 3 Errors & Solutions\n\n### Error 1: Session State Not Persisting\n\n**Symptom**: Model doesn't remember previous turns.\n\n**Cause**: Not using conversation IDs or creating new conversation each time.\n\n**Solution**:\n\n```typescript\n\u002F\u002F ✅ GOOD: Reuse conversation ID\nconst conv = await openai.conversations.create();\nconst response1 = await openai.responses.create({\n  model: 'gpt-5',\n  conversation: conv.id, \u002F\u002F Same ID\n  input: 'Question 1',\n});\nconst response2 = await openai.responses.create({\n  model: 'gpt-5',\n  conversation: conv.id, \u002F\u002F Same ID - remembers previous\n  input: 'Question 2',\n});\n```\n\n---\n\n### Error 2: MCP Server Connection Failed\n\n**Cause**: Invalid server URL, missing\u002Fexpired authorization token.\n\n**Solution**:\n\n```typescript\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Test MCP',\n  tools: [\n    {\n      type: 'mcp',\n      server_url: 'https:\u002F\u002Fmcp.stripe.com', \u002F\u002F ✅ Full HTTPS URL\n      authorization: process.env.STRIPE_OAUTH_TOKEN, \u002F\u002F ✅ Valid token\n    },\n  ],\n});\n```\n\n**Prevention**: Use environment variables for secrets, implement token refresh logic, add retry with exponential backoff.\n\n---\n\n### Error 3: Code Interpreter Timeout\n\n**Cause**: Code runs longer than 30 seconds (standard mode limit).\n\n**Solution**:\n\n```typescript\n\u002F\u002F ✅ GOOD: Use background mode for long tasks\nconst response = await openai.responses.create({\n  model: 'gpt-5',\n  input: 'Process this massive dataset',\n  background: true, \u002F\u002F ✅ Up to 10 minutes\n  tools: [{ type: 'code_interpreter' }],\n});\n\n\u002F\u002F Poll for results\nlet result = await openai.responses.retrieve(response.id);\nwhile (result.status === 'in_progress') {\n  await new Promise(r => setTimeout(r, 5000));\n  result = await openai.responses.retrieve(response.id);\n}\n```\n\n**Load `references\u002Ftop-errors.md` for all 8 errors with detailed solutions and prevention strategies.**\n\n---\n\n## When to Load References\n\n### Load `references\u002Fsetup-guide.md` when:\n- First-time Responses API user needing complete Node.js or Cloudflare Workers setup\n- Want production deployment checklist with environment-specific best practices\n- Troubleshooting setup issues or implementing streaming\u002Fbackground patterns\n\n### Load `references\u002Fresponses-vs-chat-completions.md` when:\n- Deciding between Responses and Chat Completions APIs\n- Understanding performance benchmarks (TAUBench results, cache utilization)\n- Evaluating migration effort or comparing cost structures\n\n### Load `references\u002Fmigration-guide.md` when:\n- Migrating from Chat Completions API with step-by-step checklist\n- Need code comparison examples (before\u002Fafter patterns)\n- Migrating tools from custom functions to built-in\u002FMCP\n\n### Load `references\u002Fbuilt-in-tools-guide.md` when:\n- Using Code Interpreter, File Search, Web Search, or Image Generation\n- Need tool configuration options, combining multiple tools, or troubleshooting\n\n### Load `references\u002Fmcp-integration-guide.md` when:\n- Integrating external MCP servers or building custom MCP tools\n- Need MCP configuration examples or authentication patterns\n\n### Load `references\u002Fstateful-conversations.md` when:\n- Implementing conversation persistence with KV\u002FRedis\u002Fdatabase\n- Need conversation lifecycle management or metadata tracking patterns\n\n### Load `references\u002Freasoning-preservation.md` when:\n- Want to access model reasoning for debugging or transparency\n- Building auditable AI systems or need reasoning output examples\n\n### Load `references\u002Ftop-errors.md` when:\n- Encountering API errors (8 common errors covered with solutions)\n- Need error code reference, prevention strategies, or error handling patterns\n\n---\n\n## Production Checklist\n\nBefore deploying:\n\n- [ ] API key stored securely (environment variable or secret)\n- [ ] Error handling implemented (401, 429, 400, 500)\n- [ ] Rate limiting handled (exponential backoff)\n- [ ] Conversation IDs persisted (database\u002FKV)\n- [ ] Streaming enabled for long responses\n- [ ] Tools enabled explicitly\n- [ ] Polymorphic output handling\n\n**Load `references\u002Fsetup-guide.md` for complete production checklist with platform-specific considerations.**\n\n---\n\n## Related Skills\n\n- **openai-api** - Classic Chat Completions API\n- **openai-agents** - OpenAI Agents SDK (wrapper for Responses)\n- **claude-api** - Claude API for comparison\n- **ai-sdk-core** - Vercel AI SDK (supports Responses)\n\n---\n\n## Official Documentation\n\n- **Responses API**: https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fapi-reference\u002Fresponses\n- **Migration Guide**: https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fresponses-migration\n- **Built-in Tools**: https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fresponses-tools\n- **MCP Integration**: https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fmcp\n\n---\n\n**Questions? Issues?**\n\n1. Check `references\u002Ftop-errors.md` for error solutions\n2. Review `references\u002Fsetup-guide.md` for complete setup\n3. See `references\u002Fmigration-guide.md` for Chat Completions migration\n4. Load templates from `templates\u002F` for working examples\n",{"name":5,"license":15,"metadata":24,"description":7},{"version":25,"keywords":26,"api_launch":42,"sdk_version":43,"last_verified":44,"templates_included":45,"references_included":46},"2.0.0",[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"responses api","openai responses","stateful openai","openai mcp","code interpreter openai","file search openai","web search openai","image generation openai","reasoning preservation","agentic workflows","conversation state","background mode","chat completions migration","gpt-5","polymorphic outputs","March 2025","openai@5.19.1+","2025-11-18",10,8,"main","c475fc64e94e803b50d14a791dfee8853fbb2c5c","integrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory","https:\u002F\u002Fgithub.com\u002FElogic360","2026-11-08 22:21:22",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add Elogic360\u002Fsoftware-factory --skill openai-responses",{"tool":59,"command":60},"bunx","bunx skills add Elogic360\u002Fsoftware-factory --skill openai-responses",{"tool":62,"command":63},"pnpm","pnpm dlx skills add Elogic360\u002Fsoftware-factory --skill openai-responses","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002FSKILL.md",true,[67,73,77,81,85,89,93,97,101,107,111,115,119,123,127,131,135,139,143],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fbuilt-in-tools-guide.md","REFERENCE","参考文档",2699,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Freferences\u002Fbuilt-in-tools-guide.md",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fmcp-integration-guide.md",2505,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Freferences\u002Fmcp-integration-guide.md",{"path":78,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Fmigration-guide.md",4774,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Freferences\u002Fmigration-guide.md",{"path":82,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Freasoning-preservation.md",1586,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Freferences\u002Freasoning-preservation.md",{"path":86,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fresponses-vs-chat-completions.md",11754,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Freferences\u002Fresponses-vs-chat-completions.md",{"path":90,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fsetup-guide.md",10786,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Freferences\u002Fsetup-guide.md",{"path":94,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Fstateful-conversations.md",1695,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Freferences\u002Fstateful-conversations.md",{"path":98,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":99,"sourceHtmlUrl":100},"references\u002Ftop-errors.md",11342,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Freferences\u002Ftop-errors.md",{"path":102,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":105,"sourceHtmlUrl":106},"scripts\u002Fcheck-versions.sh","SCRIPT","脚本",2905,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Fscripts\u002Fcheck-versions.sh",{"path":108,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":109,"sourceHtmlUrl":110},"templates\u002Fbackground-mode.ts",7910,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Ftemplates\u002Fbackground-mode.ts",{"path":112,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":113,"sourceHtmlUrl":114},"templates\u002Fbasic-response.ts",1625,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Ftemplates\u002Fbasic-response.ts",{"path":116,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":117,"sourceHtmlUrl":118},"templates\u002Fcloudflare-worker.ts",8794,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Ftemplates\u002Fcloudflare-worker.ts",{"path":120,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":121,"sourceHtmlUrl":122},"templates\u002Fcode-interpreter.ts",6088,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Ftemplates\u002Fcode-interpreter.ts",{"path":124,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":125,"sourceHtmlUrl":126},"templates\u002Ffile-search.ts",7324,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Ftemplates\u002Ffile-search.ts",{"path":128,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":129,"sourceHtmlUrl":130},"templates\u002Fimage-generation.ts",7025,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Ftemplates\u002Fimage-generation.ts",{"path":132,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":133,"sourceHtmlUrl":134},"templates\u002Fmcp-integration.ts",5428,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Ftemplates\u002Fmcp-integration.ts",{"path":136,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":137,"sourceHtmlUrl":138},"templates\u002Fpackage.json",886,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Ftemplates\u002Fpackage.json",{"path":140,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":141,"sourceHtmlUrl":142},"templates\u002Fstateful-conversation.ts",3126,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Ftemplates\u002Fstateful-conversation.ts",{"path":144,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":145,"sourceHtmlUrl":146},"templates\u002Fweb-search.ts",5271,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fopenai-responses\u002Fskills\u002Fopenai-responses\u002Ftemplates\u002Fweb-search.ts",[148,156,163,170,177,184],{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":152,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":155,"publishedAt":19},"01M79G206MT3J6S0GY3C45P2KV","vss-summarize-video","Use to summarize a recorded video via the LVS summarization microservice (HITL-gated) with a VLM fallback. Not for report generation or live RTSP captioning.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-summarize-video\u002FSKILL.md",[],[],{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":152,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":19},"01M79G1WN63PGRE8CKD47WEBQ5","vss-setup-video-analytics-api","Use to deploy the vss-video-analytics-api REST service standalone (config-source, data-log bind, Elasticsearch, optional Kafka). Not for full warehouse deploy.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-setup-video-analytics-api\u002FSKILL.md",[],[],{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":152,"licenseFileUrl":6,"sourceHtmlUrl":167,"categories":168,"keywords":169,"publishedAt":19},"01M79G1S9F7VY3EF6H53PRP5AN","vss-setup-behavior-analytics","Use to deploy the vss-behavior-analytics service standalone (entrypoint, config-source, optional calibration). Not for the full warehouse deploy.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-setup-behavior-analytics\u002FSKILL.md",[],[],{"skillNo":171,"name":172,"nameZh":6,"description":173,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":152,"licenseFileUrl":6,"sourceHtmlUrl":174,"categories":175,"keywords":176,"publishedAt":19},"01M79G1N1S1Y27PFZPYMNK1MTQ","vss-search-archive","Use this skill to run top-level VSS fusion search on archived video, or to ingest video files \u002F RTSP streams for search. Do NOT use for ad-hoc visual Q&A (use vss-ask-video), live captioning (use vss-deploy-dense-captioning), or video summarization and reports (use vss-summarize-video).","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-search-archive\u002FSKILL.md",[],[],{"skillNo":178,"name":179,"nameZh":6,"description":180,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":152,"licenseFileUrl":6,"sourceHtmlUrl":181,"categories":182,"keywords":183,"publishedAt":19},"01M79G1H6WN0Q6C0VCAXCZX6B7","vss-query-analytics","Use this skill when reading video-analytics metrics, incidents, alerts, and sensor data via the VA-MCP server (port 9901). Not for live VLM or incident-range narrative reports.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-query-analytics\u002FSKILL.md",[],[],{"skillNo":185,"name":186,"nameZh":6,"description":187,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":152,"licenseFileUrl":6,"sourceHtmlUrl":188,"categories":189,"keywords":190,"publishedAt":19},"01M79G1DYPNXQS7QHZ0AAF5FX5","vss-manage-video-io-storage","Use to call the VIOS REST API (sensor list, timelines, clip extraction, snapshots, add\u002Fdelete sensors and streams). Not for VLM inference or search.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-manage-video-io-storage\u002FSKILL.md",[],[]]