Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

openai-responses

БесплатноБез исполняемых скриптовНе проверен

Reference for OpenAI's Responses API (/v1/responses), the unified stateful API for agentic applications. Covers reasoning state preserved across turns…

jackspaceот jackspace★ 16 звёзд на GitHub6 установок в других каталогах

Об этом скилле

OpenAI Responses API

Status: Production Ready Last Updated: 2025-10-25 API Launch: March 2025 Dependencies: [email protected]+ (Node.js) or fetch API (Cloudflare Workers)


What Is the Responses API?

The Responses API (/v1/responses) is OpenAI's unified interface for building agentic applications, launched in March 2025. It fundamentally changes how you interact with OpenAI models by providing stateful conversations and a structured loop for reasoning and acting.

Key Innovation: Preserved Reasoning State

Unlike Chat Completions where reasoning is discarded between turns, Responses keeps the notebook open. The model's step-by-step thought processes survive into the next turn, improving performance by approximately 5% on TAUBench and enabling better multi-turn interactions.

Why Use Responses Over Chat Completions?

Feature Chat Completions Responses API Benefit
State Management Manual (you track history) Automatic (conversation IDs) Simpler code, less error-prone
Reasoning Dropped between turns Preserved across turns Better multi-turn performance
Tools Client-side round trips Server-side hosted Lower latency, simpler code
Output Format Single message Polymorphic (messages, reasoning, tool calls) Richer debugging, better UX
Cache Utilization Baseline 40-80% better Lower costs, faster responses
MCP Support Manual integration Built-in Easy external tool connections

Quick Start (5 Minutes)

1. Get API Key

# Sign up at https://platform.openai.com/
# Navigate to API Keys section
# Create new key and save securely
export OPENAI_API_KEY="sk-proj-..."

Why this matters:

  • API key required for all requests
  • Keep secure (never commit to git)
  • Use environment variables

2. Install SDK (Node.js)

npm install openai
import OpenAI from 'openai';

const openai = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY,
});

const response = await openai.responses.create({
  model: 'gpt-5',
  input: 'What are the 5 Ds of dodgeball?',
});

console.log(response.output_text);

CRITICAL:

  • Always use server-side (never expose API key in client code)
  • Model defaults to gpt-5 (can use gpt-5-mini, gpt-4o, etc.)
  • input can be string or array of messages

3. Or Use Direct API (Cloudflare Workers)

// No SDK needed - use fetch()
const response = await fetch('https://api.openai.com/v1/responses', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${env.OPENAI_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'gpt-5',
    input: 'Hello, world!',
  }),
});

const data = await response.json();
console.log(data.output_text);

Why fetch?

  • No dependencies in edge environments
  • Full control over request/response
  • Works in Cloudflare Workers, Deno, Bun

Responses vs Chat Completions: Complete Comparison

When to Use Each

Use Responses API when:

  • ✅ Building agentic applications (reasoning + actions)
  • ✅ Need preserved reasoning state across turns
  • ✅ Want built-in tools (Code Interpreter, File Search, Web Search)
  • ✅ Using MCP servers for external integrations
  • ✅ Implementing conversational AI with automatic state management
  • ✅ Background processing for long-running tasks
  • ✅ Need polymorphic outputs (messages, reasoning, tool calls)

Use Chat Completions when:

  • ✅ Simple one-off text generation
  • ✅ Fully stateless interactions (no conversation continuity needed)
  • ✅ Legacy integrations (existing Chat Completions code)
  • ✅ Very simple use cases without tools

Architecture Differences

Chat Completions Flow:

User Input → Model → Single Message → Done
(Reasoning discarded, state lost)

Responses API Flow:

User Input → Model (preserved reasoning) → Polymorphic Outputs
            ↓ (server-side tools)
    Tool Call → Tool Result → Model → Final Response
(Reasoning preserved, state maintained)

Performance Benefits

Cache Utilization:

  • Chat Completions: Baseline performance
  • Responses API: 40-80% better cache utilization
  • Result: Lower latency + reduced costs

Reasoning Performance:

  • Chat Completions: Reasoning dropped between turns
  • Responses API: Reasoning preserved across turns
  • Result: 5% better on TAUBench (GPT-5 with Responses vs Chat Completions)

Stateful Conversations

Automatic State Management

The Responses API can automatically manage conversation state using conversation IDs.

Creating a Conversation

// Create conversation with initial message
const conversation = await openai.conversations.create({
  metadata: { user_id: 'user_123' },
  items: [
    {
      type: 'message',
      role: 'user',
      content: 'Hello!',
    },
  ],
});

console.log(conversation.id); // "con
Полный SKILL.md на GitHub

Установить openai-responses в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

README.mdSKILL.json

FAQ

Что делает скилл openai-responses?

Reference for OpenAI's Responses API (/v1/responses), the unified stateful API for agentic applications. Covers reasoning state preserved across turns, conversation IDs and automatic state management, polymorphic outputs, built-in tools (Code Interpreter, File Search, Web Search, Image Generation), MCP server integration, background mode, and migration from Chat Completions. Includes both the Node.js openai SDK and direct fetch usage in Cloudflare Workers. Use when building agents that keep reasoning across turns, conversational AI with memory, tool- based or RAG applications, data analysis agents, or when calling openai.responses.create with gpt-5 models, connecting MCP servers, or porting existing Chat Completions code to the Responses API.

Как установить скилл openai-responses?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл openai-responses запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить openai-responses с