---
title: "POST /model-hub/ai-filter/"
method: POST
path: "/model-hub/ai-filter/"
tags: ["model-hub"]
---

# POST /model-hub/ai-filter/

`POST /model-hub/ai-filter/`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/model-hub/ai-filter/`
- Auth: one of:
  - API key in header `X-Api-Key`
  - API key in header `X-Secret-Key`

Request body:
{
    "query": "show me LLM evals that are pass/fail",
    "schema": [
        {
            "field": "eval_type",
            "label": "Eval Type",
            "type": "enum",
            "operators": ["is", "is_not"],
            "choices": ["llm", "code", "agent"]
        },
        ...
    ]
}

## Request body

- AIFilterRequest
  - `mode` 'build_filters' | 'select_fields' | 'smart'
  - `query` string, required
  - `schema` AIFilterSchemaField[], required
    - `field` string, required
    - `property_id` string
    - `label` string
    - `type` string
    - `category` string
    - `operators` string[]
    - `choices` object[]
    - `choice_labels` object
  - `source` 'traces' | 'sessions' | 'simulation' | 'dataset'
  - `project_id` string, uuid, nullable
  - `dataset_id` string, uuid, nullable
  - `agent_definition_id` string, uuid, nullable
  - `run_test_id` string, uuid, nullable
  - `test_execution_id` string, uuid, nullable

## Response `200`

OK

- AIFilterResponse
  - `status` boolean
  - `result` AIFilterResult, required
    - `filters` AIFilterCondition[]
      - `field` string, required
      - `property_id` string
      - `operator` string, required
      - `value` object, nullable: Any valid JSON value.
    - `fields` string[]

## Other responses

- `400`: Bad Request
- `422`: Unprocessable Entity
- `500`: Internal Server Error
- `503`: Service Unavailable
- `default`: Default error response

---

[API](https://skmtc.dev/futureagi/apis/future-agi-management-api.md) · [All operations](https://skmtc.dev/futureagi/apis/future-agi-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/futureagi/apis/future-agi-management-api/revisions/c8684118e142?raw)
