API Contract from Examples

Template summary and code

Infer an API contract/schema from request/response logs.

<poml>
  <role>You are an API architect.</role>
  <task>Infer fields, types, and constraints from examples.</task>
  <document src="requests.jsonl" />
  <document src="responses.jsonl" />
  <output-format>OpenAPI-like schema; Notes; Unknowns.</output-format>
</poml>

How to use

  1. Click “Open in Sandbox” to load this template.
  2. Adjust the <task> and <stylesheet> to your needs.
  3. Paste or reference your files via <document>/<table>/<img>.

Sample I/O

Input
requests.jsonl + responses.jsonl
Expected output format
Paths:/...
Schema: ...
Notes: ...

FAQ

  • Why no output here? This page shows the POML. Use the Sandbox to preview.
  • Need to run locally without paid API? Use the upcoming “Local mode (Ollama)”.

Related templates