Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Openai Api Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-openai-api-knowledge-patch)
---
name: openai-api-knowledge-patch
description: OpenAI API
version: null
license: MIT
metadata:
author: Nevaberry
---
# OpenAI API Compatibility
Load this skill when migrating OpenAI API requests, maintaining conversation
state, configuring tools and schemas, or working with caching, service tiers,
managed agents, media, Realtime, and organization controls.
## Reference index
| Reference | Topics |
| --- | --- |
| [Endpoint state and lifecycle](references/endpoint-state-and-lifecycle.md) | Shutdowns, replacement models, stored state, reasoning replay, instructions, streaming SDKs, image and PDF inputs, media outputs, and video retirement |
| [Models and reasoning](references/models-and-reasoning.md) | Routing, token limits, prices, effort, Pro, specialized access, retention eligibility |
| [Prompt caching](references/prompt-caching.md) | Breakpoints, keys, retention, prefix reuse, token accounting, diagnostics |
| [Tools and structured output](references/tools-and-structured-output.md) | Strictness, namespaces, tool search, async calls, multi-agent beta, schemas, parsing, managed agents, sessions, sandboxes, and review |
| [Realtime and Live](references/realtime.md) | GA migration, translation, transcription, delegation, SIP, voices, standby |
| [Service tiers](references/service-tiers.md) | Fast, Flex, Ultrafast, background windows, residency, ramp limits, retries, organization controls, API keys, networking, billing, and safety |
## Shutdowns and migration priorities
The Assistants API shut down August 26, 2026. Move generation to Responses
and conversation state to the Conversations API.
Reusable prompt objects and the `v1/prompts` API shut down November 30, 2026;
move reusable prompt content into application code. Existing evals became
read-only October 31 ahead of the scheduled November 30 Evals shutdown,
including evaluation graders; Promptfoo is a documented migration option.
Agent Builder was scheduled to shut down November 30; ChatKit remains
available, and workflows can migrate to the Agents SDK or Workspace Agents.
For the December 1, 2026 image shutdown, replace `gpt-image-1-mini`,
`gpt-image-1.5`, and `chatgpt-image-latest` with `gpt-image-2`.
The lifecycle reference contains the full text, reasoning, audio, image,
fine-tuned, and transcription replacement mappings and their shutdown dates.
The Videos API and its listed Sora models shut down September 24, 2026;
the notice lists no replacement. Historical video operations are in the media
reference alongside that retirement notice.
## Request migration and defaults
Use `gpt-6.2-astra` or `gpt-6.2-sol` on Responses or Chat Completions;
both require Responses for tool calling. The November refresh of `chat-latest`
recommends those model IDs for production API requests.
For the current model migration, omit `temperature` and `top_p` from both
endpoints, and omit `logprobs` from Chat Completions. The separate migration
guidance in the model reference also identifies `top_logprobs` and
`message.output_text.logprobs` as fields to remove from migrated requests.
On a Responses function tool, omitting `strict` attempts strict mode. If the
schema cannot be made compatible, the API falls back to best-effort calling
and the resolved tool reports `strict: false`. Set `strict: false` explicitly
to preserve best-effort calling during migration.
Chat Completions stores responses by default for new accounts. Set
`store: false` to disable storage. Zero Data Retention organizations have
`store: false` enforced automatically.
## Conversation state and instructions
For stateless reasoning continuity, set `store: false` and replay every returned
reasoning item in the next request's `input`; items include `encrypted_content`
by default.
On `gpt-5.6`, with `reasoning.context: "all_turns"`, use `previous_response_id`
or replay all prior user inputs and response output items, retaining item types,
IDs, `call_id`, `caller`, and assistant `phase` values. `current_turn` limits
reuse to the current turn; `auto` or omission uses the reported model default.
In the current model migration, Responses drops earlier reasoning after history edits,
certain model changes including downgrades, or end-user or organization changes.
Keep earlier input unchanged when updating settings to preserve reasoning and
keep that input eligible for prompt caching.
For that migration, Responses appends top-level `instructions` after `input`. Put stable guidance
in a `developer` message as the first input item and use top-level instructions
for the current request. Resend top-level instructions on continuations:
the parent response's instructions are request-scoped.
Reuse a stored response ID in multiple `previous_response_id` requests to fork
from that turn. Persistent Responses WebSockets support incremental input and
mid-turn steering; steering preserves work completed before the update.
## Cache migration and accounting
Use `prompt_cache_options.ttl` instead of `prompt_cache_retention` on upgraded
routes, while scoping the newer options and breakpoints to those routes in
shared builders. Carry forward an existing `prompt_cache_key`.
Mark the content block ending a reusable prefix with `prompt_cache_breakpoint`.
`prompt_cache_options.mode: "explicit"` uses only marked boundaries; the default
`implicit` mode combines automatic caching with any marked boundaries.
Explicit mode without explicit breakpoints skips reads and avoids write charges.
On generation 5.6 and later, the default minimum lifetime is `"30m"`; a hit
refreshes retention without a new write charge. Responses also offers a 12-hour opt-in whose writes cost
2.5× the input token price. The caching reference separates legacy retention
behavior from the newer breakpoint behavior.
Keep requests sharing a prefix in the same processing region. Keep
`parallel_tool_calls`, `text.verbosity`, and the `tools` list stable for prefix
reuse. Restrict callable tools through `tool_choice` rather than changing the list.
Track both `cached_tokens` and `cache_write_tokens`. Subtract both from total
input tokens to calculate tokens charged at the ordinary input rate. Ordinary
cache writes cost 1.25× that rate; model-specific prices and longer-retention
write pricing are detailed in the references.
## Tool execution and structured output
Group related Responses functions in a `namespace` and set `defer_loading: true`
on functions to load through tool search. Tool search requires generation 5.4
or later and can emit `tool_search_call` and `tool_search_output` before a call.
Use `tool_choice.type: "allowed_tools"` with typed references in
`tool_choice.tools`. With `mode: "auto"`, the model may make zero or more calls
from that list. A restriction includes functions loaded through tool search.
Set `async: true` on function or custom tools for asynchronous calling. Track
pending work and return results as they become available with the original
`call_id`. Responses can continue generating while the client runs a tool.
Programmatic Tool Calling uses `programmatic_tool_calling` and `allowed_callers`
to let hosted JavaScript call eligible functions. Preserve both `call_id` and
`caller` when returning results. It supports Zero Data Retention and has no
additional container charge.
For the Responses multi-agent beta, send
`OpenAI-Beta: responses_multi_agent=v1` and configure `multi_agent.enabled`
and `multi_agent.max_concurrent_subagents`. Execute developer-defined calls
from every agent and retain the multi-agent items for replay and tracing.
For streamed function arguments, track calls by `output_index`. The
`response.function_call_arguments.done` event supplies the full JSON string
in `arguments`; `response.output_item.done` supplies the complete call in `item`.
Strict Structured Outputs schemas support up to 5,000 object properties and 10 nesting levels.
See the tools reference for all size limits, keyword restrictions, fine-tuned
model limitations, custom grammars, and SDK examples. Fine-tuned strict function
schemas are cached and ineligible for Zero Data Retention.
## Processing tiers and retries
Fast mode replaces Priority Processing; `service_tier: "priority"` requests
automatically use Fast. Read the returned `service_tier` to identify the
effective tier. Rapid Fast traffic growth can downgrade requests to Standard
speeds and rates with `service_tier: "default"`.
For HTTP `429` with `slow_down` or HTTP `503` with `server_is_overloaded`, wait
at least `Retry-After` when supplied; otherwise use exponential backoff.
Flex `429 Resource Unavailable` requests are unbilled. Retry Flex with backoff
if the workload can wait, or inherit the project default with `auto` or omission.
The Responses background-completion public beta offers two-hour windows at
30% below Standard token rates or eight-hour windows at 40% below Standard
for `gpt-6.2-astra`, `gpt-6.2-sol`, `gpt-6.1-terra`, and `gpt-6-luna`.
When migrating Flex requests to the current models, switch tiers; for
discounted long-running work, use a background window with Standard.
Flex is winding down and limited to models that already support it.
## Realtime and managed agents
For Realtime GA, remove `OpenAI-Beta: realtime=v1`, create ephemeral credentials
with `POST /v1/realtime/client_secrets`, and establish WebRTC through
`/v1/realtime/calls`. Set `session.type` and move output audio settings under
`session.audio.output`; the Realtime reference lists the output event names.
Continuous translation with `gpt-realtime-translate` begins with incoming
audio: omit `response.create` and user-turn commits. Live sessions can delegate
reasoning and tools to a backend while voice interaction continues.
The managed Agents API is a public beta with durable sessions, context
compaction, recovery, and hosted or connected sandboxes. A session tool update
replaces the full tool list: include every tool to retain. Functions and MCP
servers change on the next model call; built-in tools change by the next turn.
Background compaction defaults on and may increase token usage;
`compaction.async: false` makes it blocking. Time awareness is experimental
and off by default; enable it with `experimental.time_awareness: true`.
## Moderation and operational controls
A `moderation` object requests input and output moderation in Responses or
Chat Completions. Streamed output scores arrive only after the full output;
clients gating display on those scores must buffer generated text.
Synchronous safety checks may pause streams for several seconds or block or
refuse some cyber and biology requests. Allow for those gaps in stream timeouts.
Asynchronous checks on supported Responses requests may trigger alerts or
stop a conversation for review.
Organization or project hard monthly caps make affected requests return
HTTP `429` once tracked spend reaches the limit. Spend alerts can notify before
traffic stops. Administration references cover API-key policies, workload
identity, processing regions, allowlists, and usage reporting.