AI / Core OpenAI Codex Application Fundamentals Interview Questions
What is the OpenAI Responses API and how does it differ from the Chat Completions API?
The Responses API (/v1/responses), launched in March 2025, is OpenAI's recommended API primitive for new projects. It is a superset of the Chat Completions API, providing everything Chat Completions offers plus built-in agentic capabilities.
| Feature | Chat Completions | Responses API |
|---|---|---|
| Endpoint | /v1/chat/completions | /v1/responses |
| Status | Fully supported; not deprecated | Recommended for all new projects |
| Built-in tools | None (manual function calling only) | Web search, file search, computer use, code interpreter, remote MCPs |
| State management | Manual - must pass full history each turn | store: true persists state; previous_response_id chains turns |
| Output format | choices[].message.content | output array of typed Items |
| Reasoning models | Limited tool support | Full reasoning + tool support (e.g. GPT-5 series) |
| Prompt caching | Available | 40-80% improved cache utilisation vs Chat Completions |
| Performance | Baseline | 3% improvement on SWE-bench with same prompt (internal evals) |
# Responses API - Python from openai import OpenAI client = OpenAI() result = client.responses.create( model="gpt-5.5", input="Find the null pointer exception: ...your code here...", reasoning={"effort": "high"}, ) print(result.output_text) # Chaining turns with previous_response_id: followup = client.responses.create( model="gpt-5.5", input="Now fix it.", previous_response_id=result.id, )
The Responses API uses Items (a typed union of model actions) instead of Messages. Key advantages include stateful multi-turn interactions, better cache utilisation, and first-class support for reasoning models and built-in tools.
More Related questions...