---
title: "Generate Records Constraints Endpoint"
method: POST
path: "/felix/constraints/records"
tags: ["felix"]
---

# Generate Records Constraints Endpoint

`POST /felix/constraints/records`

Generate constraints for records/custom tasks

## Request body

- GenerateRecordsConstraintsRequest — Records constraint generation request
  - `user_id` string, nullable — User ID (optional, uses authenticated user if not provided)
  - `domain_description` string, nullable — Domain description for generation context
  - `fields` RecordField[], required — Field definitions for structured records
    - `name` string, required
    - `type` string
    - `description` string, nullable
    - `allowed_values` string[], nullable
  - `min_criteria` integer — Minimum number of constraints to generate

## Response `200`

Successful Response

- GenerateConstraintsResponse — Constraint generation response
  - `success` boolean, required
  - `constraints` ConstraintRequest[], required
    - `description` string, required — Constraint description
    - `choices` string[], nullable — Optional list of choices for this constraint
    - `weights` number[], nullable — Optional weights for choices (must align with choices length)
    - `probability` number, nullable — Optional probability (0.0-1.0) for this constraint
  - `count` integer, required
  - `token_usage` integer, nullable — Estimated tokens used for constraint generation

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/pioneer/apis/brain-api.md) · [All operations](https://skmtc.net/pioneer/apis/brain-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pioneer/brain-api/versions/31dfe831e079/schema)
