'JSON 으로 답해줘' 프롬프트는 folklore 야 — 모델이 가끔 commentary, code fence, trailing prose 를 끼워 넣어서 defensive 파싱 + retry 지옥. Structured output 은 다른 layer — response_format 에 Pydantic schema 박으면 모델이 그 shape 외엔 못 돌려줘.
왜 folklore 보다 강한가
Schema 강제는 server-side. API 가 non-conforming 출력을 거부하고 모델한테 다시 시켜. 코드는 typed Pydantic instance 받아. Defensive 파싱이 통째로 사라져.
Batch API — 50% 할인 대신 24h
50K prompt 처리해야 하는데 interactive 아니고 cost 를 반으로 줄이고 싶다면 Batch API 가 답. JSONL 업로드, 24h 안에 완료, 결과 JSONL 다운로드. 채팅엔 catastrophically wrong (latency unbounded), eval/dataset gen/moderation backfill 엔 perfect.
실전 비교 exercise
같은 작업을 prompt-json 방식과 response_format 방식 둘 다 돌려서 fail rate 측정해 봐. 보통 prompt-json 은 1-3% fail, response_format 은 거의 0. 그 1-3% 가 production 에서 alert 으로 돌아옴.