API Conventions
Overview
All API endpoints follow consistent conventions for response formats, status codes, and error handling. This page documents what to expect when making requests to the API.
Request Headers
All API requests require the following headers:
Response Format
All API responses follow a consistent JSON structure:
Success response
Error response
HTTP Status Codes
The Evals API uses standard HTTP status codes to indicate the success or failure of requests.
Success codes
Client error codes
Server error codes
Ensure Forward Compatibility
We may add new fields to the data field of API responses at any time without considering it a breaking change.
To ensure your integration remains stable, your client should ignore unknown fields rather than failing when encountering them.
For example, if today an endpoint returns:
And tomorrow it returns:
Your client should continue to work without modification. Most JSON parsing libraries handle this by default, but be cautious if you’re using strict schema validation.
When deserializing responses, configure your parser to ignore unknown
properties. In Python with Pydantic, use extra = "ignore". In TypeScript,
avoid strict object type assertions.
Deprecation Notices
When an endpoint is deprecated, responses will include "deprecated": true. We recommend:
- Monitor the
deprecatedfield in all responses - Plan to migrate to the recommended alternative before the endpoint is removed
Deprecated endpoints will continue to function for a transition period, but may be removed in future API versions. Always migrate to recommended alternatives when you see deprecation notices.