Return a checked artifact with the OpenAI API
OpenAI API
This page covers tools outside your selection. You can still read it. Find matching guides
Use a closed output schema, validate completion and evidence, and keep model output separate from pipeline authority.
Use a direct model call when a stage only needs to transform supplied evidence into a structured result. Your program supplies the input, validates the answer, and decides what happens next.
This is different from starting Codex with its repository tools and instruction handling. Choose the agent interface when that is the behavior the task needs.
Define an inspectable result
For reviewing the retry fixture, a useful result is:
{
"verdict": "pass",
"findings": [],
"limitations": ["No network retry was executed."]
}
Use the closed review schema in the reference package. It permits findings with file, line, severity, explanation and a proposed check. It has no field for granting permissions or selecting a new recipient.
In the Responses API, configure a supported structured-output JSON schema through the documented text-format options. Select an explicit available model, an output limit, and an intentional processing tier. Follow the current structured-output reference for the exact SDK or REST form.
Validate transport, structure, and meaning
Require a successful HTTP request and a completed response. Handle refusals, incomplete output, and API errors explicitly. Then parse the final text and validate it against the task schema.
The package's normalize("openai-api", rawResponse) supports a completed Responses envelope. The coordinator separately checks the task schema, evidence paths, and acceptance conditions. It never interprets model output as executable pipeline configuration.
A schema helps constrain the shape of a result. A claim about a file still needs to match that file, and a proposed fix still needs to pass the agreed behavior check.
Keep the request bounded
Supply the smallest sufficient evidence packet with revision and source pointers. Use a request timeout, an output limit, bounded retries, and an approved model/recipient profile in the calling program.
Keep credentials in the request client's protected environment. Do not attach them to the evidence packet or expose them to repository test commands. Configure the API project and usage controls separately from ChatGPT access.
The reference package includes response normalization, import validation and optional supervised API execution. Its configured Responses client sends a bounded request to the fixed public endpoint and records transport outcomes. Unknown completion requires reconciliation.
The local HTTP tests use a synthetic key. A production caller still needs credentialed integration evidence and account-level usage controls.
What goes wrong
A successful HTTP status can still contain a refusal or incomplete model result. JSON-mode transport alone does not validate your task's semantics. Retrying a bad request indefinitely repeats the same failure and consumes resources. Passing a schema from model output lets the model redefine success.
How to check
Run the reference tests. A completed synthetic response must produce the expected review object. A response with incomplete status or a refusal must fail before downstream dispatch.
For a live trial, use the synthetic retry packet, inspect the actual returned usage and model identity, and run the same evidence checks. Label that trial separately from offline parser tests and compare it with your existing workflow.
Sources
- OpenAI: structured model outputs Tier 1 2026-09-08
- OpenAI: Responses API Tier 1 2026-09-08
- OpenAI: API pricing Tier 1 2026-09-08
Something wrong with this page?
Say what you expected and what you got. That is usually the shortest route to a correction, and it goes on the public issue tracker so the fix is visible.