API Response Quality Gate
API Response Quality Gate
ClaudeChatGPT
Health
0/100
β² 9
π 59 copies
Trigger Phrase
Validate this API response
Prompt
117 wordsUse this prompt to validate that an AI-generated API response meets quality standards before shipping.
Paste your API endpoint spec and the AI-generated response, then ask:
Review this API response against its spec. Check for:
1. Does the response match the schema exactly? (field names, types, nesting)
2. Are all required fields present?
3. Are optional fields handled correctly when absent vs null vs empty string?
4. Are error responses consistent with the success response structure?
5. Is pagination correct if applicable?
6. Are there any fields in the response not in the spec?
Return: PASS or FAIL, then a bulleted list of every deviation found. Be literal β if the spec says 'user_id' and the response has 'userId', that is a failure.
Paste your API endpoint spec and the AI-generated response, then ask:
Review this API response against its spec. Check for:
1. Does the response match the schema exactly? (field names, types, nesting)
2. Are all required fields present?
3. Are optional fields handled correctly when absent vs null vs empty string?
4. Are error responses consistent with the success response structure?
5. Is pagination correct if applicable?
6. Are there any fields in the response not in the spec?
Return: PASS or FAIL, then a bulleted list of every deviation found. Be literal β if the spec says 'user_id' and the response has 'userId', that is a failure.
Install Instructions
Paste this prompt, then your OpenAPI spec, then the API response you want to check. Works well in Claude due to large context.
Test It
Test command:
Test with a response that has 'userId' instead of 'user_id'
Expected output:
Should return FAIL and identify the field name mismatch
Pass criteria:
- Returns FAIL. Identifies the exact field name deviation. Lists it literally.
β οΈ Guardrails
- This checks structure only β it cannot verify business logic or live data accuracy.
π Context File Tip
Paste your OpenAPI/Swagger spec for best results
