Skip to main content
← Guides

API contract

Prompts & workflows · Prompt case

Output request/response schemas and an error table; mark undefined items unknown.

Prompt effect has not been tested.

A prompt is a re-runnable template, not a promise of results. Changing the model, version or input can change the outcome. Use the checkpoints on this page to verify it yourself, and treat the official sources as evidence of mechanism rather than a guarantee of effect.

Task and inputs

Output request/response schemas and an error table; mark undefined items unknown. Inputs: API description, example requests/responses, and error codes.

The prompt

Organise the API contract. Output endpoint, request_schema, response_schema and errors[] with code, condition and client_action. Schema fields must come from description/examples; mark undefined fields. Do not invent error codes not provided.

Replace {field} placeholders with the current inputs before running.

Expected output shape

endpoint, schemas, and errors[].

Checkpoints

  • Fields have example or description support.
  • Error codes come from input.
  • Undefined items are explicit.

Failure branches

  • Insufficient examples: mark undefined, do not guess types.
  • Missing error branches: list gaps.

Sources and limits

This site has not tested the effect of this prompt. See the sources for the mechanism; changing model, version or input can change the result.

Sources

SourceURL
OpenAI Cookbook: Introduction to Structured Outputs (official repository raw, fetched 200 on 2026-11-07)https://raw.githubusercontent.com/openai/openai-cookbook/main/examples/Structured_Outputs_Intro.ipynb

Source snapshot: 2026-11-07; item-specific rechecks and their scope are recorded in the text or source notes. Features and terms may change; check the original sources before use.