Validation Rules

Getting Started Jun 12, 2026

The API validates request payloads before routing them to an agent. If the request body is malformed, incomplete, or contains an unsupported response_schema, the API returns 422 Unprocessable Entity.

Message Validation Rules

The messages field must follow these rules:

  • messages must be a non-empty array.
  • Each message must be an object containing role and content.
  • role must be a supported role: user or assistant.
  • content must be a non-empty string.
  • The last message in the array must have the role user.

Invalid Messages Example

{
  "detail": "Invalid messages: messages must be a non-empty list of {role, content} objects"
}

Response Schema Validation

If a response_schema is provided, it must follow the supported schema rules. Invalid schemas are rejected before the agent runs.

For example, an object schema must define a valid properties field.

Invalid Schema Example

{
  "detail": "Invalid response_schema: Object schema must define 'properties'"
}

Notes

  • Validation errors use HTTP status code 422.
  • The request is not routed to an agent when validation fails.
  • Error messages are returned in the detail field.
  • Fix the request body and retry the request.

Tags

Try Statement Today

Get early updates, and product notes.

Get early access