Role deprecation: system → developer
OpenAI renamed the system-instruction role for its o-series reasoning models:
system— original role, works on all models. On o1-2024-12-17 and later o-series models, OpenAI maps it todevelopersilently. Note: o1-preview and o1-mini support neither role.developer— preferred for o1-2024-12-17 and later. Accepted on GPT-4o too, butsystemis still more widely compatible across integrations.
Coolhand captures both as the System Prompt field. No action needed for existing integrations — both roles land in the same place.
Structured outputs
OpenAI offers two JSON output modes:
- Structured Outputs (
response_format: { type: "json_schema", json_schema: ... }) — strict schema enforcement with no extra fields or omissions. Requiresgpt-4o-2024-08-06,gpt-4o-mini, or later models. - JSON Mode (
response_format: { type: "json_object" }) — guarantees valid JSON but does not enforce a schema. Compatible with older models includinggpt-3.5-turbo-1106andgpt-4-*, but the model may produce any JSON structure.
Use Structured Outputs when schema adherence matters. JSON Mode is a fallback for older deployments that don't support schema constraints.
Docs: https://platform.openai.com/docs/guides/structured-outputs
Caching
Automatic — no explicit API required. OpenAI caches the longest stable prefix of your prompt.
- Minimum prefix: 1,024 tokens
- TTL: typically 5–10 minutes of inactivity; up to 1 hour maximum (treat as short-lived — a prompt inactive for 10 minutes may already be evicted)
- Invalidation: any change to the cached prefix breaks the cache
- Scope: per organization and per model version — different organizations or model versions do not share a cache
To maximize hit rate: put your entire system prompt first, followed by any stable context, and keep all variable content at the end of the prompt (or in the user turn). A single token change anywhere before the variable content resets the cache prefix.
Coolhand captures cache hits as Cached Input Tokens. Cache creation tokens are not reported by OpenAI (no separate creation event).
Batch processing
The OpenAI Batch API processes up to 50,000 requests from a JSONL file asynchronously, returning results within 24 hours at 50% of standard per-token pricing. Suitable for any workload that doesn't require real-time responses: evals, document processing, bulk classification.
- Submit a JSONL file via the Files API, then create a batch job referencing the file ID
- Poll the batch job status; download the output JSONL when complete
- Each line in the input/output maps via a
custom_idyou supply
Docs: https://platform.openai.com/docs/guides/batch
Non-standard token fields
| Field | When present |
|---|---|
| Reasoning Tokens | o-series models only — internal chain-of-thought tokens, billed as output |
| Audio Input Tokens | Multimodal requests that include audio input |
Latency
Three-tier fallback in order of preference:
- Assistants API runs — wall-clock time derived from
completed_at - started_attimestamps in the run object. Note: the Assistants API is deprecated and scheduled for sunset on 2026-08-26; the Responses API is now the recommended path for stateful workflows. - Chat Completions —
openai-processing-msresponse header (server-side processing time, does not include network transit) - Fallback — collector-provided
duration_mswhen the header is absent (wall-clock)
Most requests use tier 2.