{
  "openapi": "3.1.0",
  "info": {
    "title": "Pioneer AI API",
    "description": "Public API for fine-tuning, evaluating, and deploying small language models and LLMs. Full docs at https://agent.pioneer.ai/llms-full.txt",
    "version": "2.0.0"
  },
  "servers": [
    {
      "url": "https://api.pioneer.ai",
      "description": "Pioneer AI API"
    }
  ],
  "paths": {
    "/base-models": {
      "get": {
        "description": "Public model catalog — single source of truth for available models. Returns the union of all provider catalogs. Each model carries\n``supports_training`` and ``supports_inference`` flags derived from\n``catalog_registry``. Use query parameters to filter by capability. No authentication required — this is a read-only catalog with no\nuser-specific data. Examples: GET /base-models — full catalog GET /base-models?supports_inference=true — serverless-capable models GET /base-models?supports_training=true — trainable models GET /base-models?task_type=gliner — encoder/NER models only GET /base-models?task_type=decoder — decoder/LLM models only",
        "operationId": "list_base_models_base_models_get",
        "parameters": [
          {
            "description": "Filter to models that support fine-tuning",
            "in": "query",
            "name": "supports_training",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Supports Training"
            }
          },
          {
            "description": "Filter to models with serverless inference",
            "in": "query",
            "name": "supports_inference",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Supports Inference Filter"
            }
          },
          {
            "description": "Filter by task type: 'gliner' (encoder/NER) or 'decoder' (LLM)",
            "in": "query",
            "name": "task_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Task Type"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainableBaseModelsResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Base Models",
        "tags": [
          "model-selection"
        ]
      }
    },
    "/create-api-key": {
      "post": {
        "description": "Create a new API key for the authenticated user. Returns the secret key which is only shown once.",
        "operationId": "create_api_key_create_api_key_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAPIKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAPIKeyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Api Key",
        "tags": [
          "api-keys"
        ]
      }
    },
    "/delete-api-key": {
      "delete": {
        "description": "Delete an API key belonging to the authenticated user.",
        "operationId": "delete_api_key_delete_api_key_delete",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteAPIKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Api Key",
        "tags": [
          "api-keys"
        ]
      }
    },
    "/felix/baseline-models": {
      "get": {
        "description": "List available baseline LLM models for evaluation comparison. Returns models from OpenAI (GPT-4o) and Together.ai (Llama 3.1 8B/70B).\nThese can be used to compare custom model performance against industry baselines.",
        "operationId": "list_baseline_models_felix_baseline_models_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Baseline Models",
        "tags": [
          "felix"
        ]
      }
    },
    "/felix/datasets": {
      "get": {
        "description": "List all datasets for the authenticated user. By default, returns only the latest version of each dataset.\nSet include_all_versions=True to return all versions.\nIf project_id is provided, returns datasets for that project plus orphan datasets.",
        "operationId": "list_datasets_felix_datasets_get",
        "parameters": [
          {
            "in": "query",
            "name": "include_all_versions",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include All Versions",
              "type": "boolean"
            }
          },
          {
            "description": "Filter by project ID (includes datasets with no project)",
            "in": "query",
            "name": "project_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by project ID (includes datasets with no project)",
              "title": "Project Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Datasets",
        "tags": [
          "felix",
          "datasets"
        ]
      }
    },
    "/felix/datasets/upload/process": {
      "post": {
        "description": "Process dataset uploaded to S3 via presigned URL. **Prerequisites:**\n1. Must have called /upload/url to get dataset_id\n2. Must have uploaded file to S3 using presigned URL **Response:**\n- Returns 202 Accepted with dataset in \"uploading\" status\n- Poll GET /{name}/{version} to check processing status\n- Status will change to \"ready\" when complete or \"failed\" on error **Processing:**\n- Validates file exists in S3\n- Converts to Parquet if needed (CSV/JSONL/JSON → Parquet)\n- Extracts metadata (row count, schema, etc.)\n- Validates data against expected schema if provided\n- Updates database status throughout",
        "operationId": "process_uploaded_dataset_felix_datasets_upload_process_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetUploadProcessRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Process Uploaded Dataset",
        "tags": [
          "felix",
          "datasets"
        ]
      }
    },
    "/felix/datasets/upload/url": {
      "post": {
        "description": "Get presigned S3 URL for direct dataset upload (bypasses API Gateway limits). **Two-step upload flow:**\n1. Call this endpoint to get presigned URL and dataset_id\n2. Upload file directly to S3 using the presigned URL (HTTP PUT)\n3. Call /upload/process with dataset_id to trigger validation/processing **Auto-versioning behavior:**\n- If dataset_name is new: creates version 1\n- If dataset_name exists: creates next version (e.g., 2, 3, etc.) **Response:**\n- presigned_url: S3 PUT URL for direct upload\n- dataset_id: Use this in /upload/process\n- version_number: Dataset version\n- expires_in: URL valid for this many seconds (default: 3600 = 1 hour) Supports JSONL, CSV, JSON, and Parquet formats.",
        "operationId": "get_upload_url_felix_datasets_upload_url_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetUploadUrlRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetUploadUrlResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Upload Url",
        "tags": [
          "felix",
          "datasets"
        ]
      }
    },
    "/felix/datasets/{name}": {
      "delete": {
        "description": "Delete a dataset and all its versions.",
        "operationId": "delete_dataset_felix_datasets__name__delete",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Dataset",
        "tags": [
          "felix",
          "datasets"
        ]
      },
      "get": {
        "description": "List all versions of a dataset.",
        "operationId": "list_dataset_versions_felix_datasets__name__get",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetVersionsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Dataset Versions",
        "tags": [
          "felix",
          "datasets"
        ]
      },
      "post": {
        "description": "Create a new version of an existing dataset.",
        "operationId": "create_dataset_version_felix_datasets__name__post",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_create_dataset_version_felix_datasets__name__post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Dataset Version",
        "tags": [
          "felix",
          "datasets"
        ]
      }
    },
    "/felix/datasets/{name}/{version}": {
      "delete": {
        "description": "Delete a specific version of a dataset.",
        "operationId": "delete_dataset_version_felix_datasets__name___version__delete",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "title": "Version",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Dataset Version",
        "tags": [
          "felix",
          "datasets"
        ]
      },
      "get": {
        "description": "Get metadata for a specific dataset version.",
        "operationId": "get_dataset_felix_datasets__name___version__get",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "title": "Version",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Dataset",
        "tags": [
          "felix",
          "datasets"
        ]
      },
      "put": {
        "description": "Update dataset metadata without creating a new version. Name changes propagate to all versions.",
        "operationId": "update_dataset_metadata_felix_datasets__name___version__put",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "title": "Version",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetMetadataUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Dataset Metadata",
        "tags": [
          "felix",
          "datasets"
        ]
      }
    },
    "/felix/datasets/{name}/{version}/download": {
      "get": {
        "description": "Download a specific dataset version in the specified format.",
        "operationId": "download_dataset_felix_datasets__name___version__download_get",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "title": "Version",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "default": "jsonl",
              "enum": [
                "jsonl",
                "csv",
                "parquet"
              ],
              "title": "Format",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "standard_columns",
            "required": false,
            "schema": {
              "default": false,
              "title": "Standard Columns",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download Dataset",
        "tags": [
          "felix",
          "datasets"
        ]
      }
    },
    "/felix/datasets/{name}/{version}/preview": {
      "get": {
        "description": "Preview rows from a dataset without downloading the full file.",
        "operationId": "preview_dataset_felix_datasets__name___version__preview_get",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "title": "Version",
              "type": "string"
            }
          },
          {
            "description": "Number of rows to preview (max 100)",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 10,
              "description": "Number of rows to preview (max 100)",
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Number of rows to skip",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "description": "Number of rows to skip",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Preview Dataset",
        "tags": [
          "felix",
          "datasets"
        ]
      }
    },
    "/felix/datasets/{name}/{version}/rows": {
      "delete": {
        "description": "Delete specific rows from a dataset, creating a new version. Supports two modes: index-based (``row_indices``) for backwards\ncompatibility and fingerprint-based (``fingerprints``) for safe\ndeletion that is immune to dataset mutations between analysis and\ndelete.",
        "operationId": "delete_dataset_rows_felix_datasets__name___version__rows_delete",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "title": "Version",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetRowsDeleteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetRowsDeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Dataset Rows",
        "tags": [
          "felix",
          "datasets"
        ]
      },
      "patch": {
        "description": "Update specific rows in a dataset without re-uploading the entire dataset. This is more efficient than creating a new version for small edits.\nOnly the specified rows are modified; all other rows remain unchanged.",
        "operationId": "update_dataset_rows_felix_datasets__name___version__rows_patch",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "title": "Name",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "title": "Version",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetRowsUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatasetRowsUpdateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Dataset Rows",
        "tags": [
          "felix",
          "datasets"
        ]
      }
    },
    "/felix/evaluations": {
      "get": {
        "description": "List all evaluations for the authenticated user. Returns model and benchmark evaluations with their metrics.\nUsed by the frontend to build the evaluations matrix view.\nIf project_id is provided, returns evaluations for that project plus orphan evaluations.",
        "operationId": "list_evaluations_felix_evaluations_get",
        "parameters": [
          {
            "description": "Filter by project ID (includes evaluations with no project)",
            "in": "query",
            "name": "project_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by project ID (includes evaluations with no project)",
              "title": "Project Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvaluationListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "Evaluation listing dependency is temporarily unavailable."
          }
        },
        "summary": "List Evaluations",
        "tags": [
          "felix"
        ]
      },
      "post": {
        "description": "Create model evaluation job(s) for multiple models and datasets.",
        "operationId": "create_evaluation_felix_evaluations_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EvaluationCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvaluationCreateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Evaluation",
        "tags": [
          "felix"
        ]
      }
    },
    "/felix/evaluations/{evaluation_id}": {
      "delete": {
        "description": "Delete an evaluation by ID. Verifies ownership via user_id before deleting.",
        "operationId": "delete_evaluation_felix_evaluations__evaluation_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "evaluation_id",
            "required": true,
            "schema": {
              "title": "Evaluation Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteEvaluationResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Evaluation",
        "tags": [
          "felix"
        ]
      },
      "get": {
        "description": "Get the status and results of a specific evaluation.",
        "operationId": "get_evaluation_felix_evaluations__evaluation_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "evaluation_id",
            "required": true,
            "schema": {
              "title": "Evaluation Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EvaluationResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Evaluation",
        "tags": [
          "felix"
        ]
      }
    },
    "/felix/trained-models": {
      "get": {
        "description": "List all completed/trained models for the authenticated user.",
        "operationId": "list_trained_models_felix_trained_models_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingJobListResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Trained Models",
        "tags": [
          "felix"
        ]
      }
    },
    "/felix/training-jobs": {
      "get": {
        "description": "List all training jobs for the authenticated user. Optionally filter by status (requested, running, complete, errored).",
        "operationId": "list_training_jobs_felix_training_jobs_get",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "project_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Project Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingJobListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Training Jobs",
        "tags": [
          "felix"
        ]
      },
      "post": {
        "description": "Create a new training job. The provider is resolved from the registry based on\n``(base_model, training_type)``.",
        "operationId": "create_training_job_felix_training_jobs_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingJobCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingJobResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Training Job",
        "tags": [
          "felix"
        ]
      }
    },
    "/felix/training-jobs/{job_id}": {
      "delete": {
        "description": "Delete a training job and associated checkpoints.",
        "operationId": "delete_training_job_felix_training_jobs__job_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteTrainingJobResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Training Job",
        "tags": [
          "felix"
        ]
      },
      "get": {
        "description": "Get a specific training job by ID.",
        "operationId": "get_training_job_felix_training_jobs__job_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingJobResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Training Job",
        "tags": [
          "felix"
        ]
      }
    },
    "/felix/training-jobs/{job_id}/checkpoints": {
      "get": {
        "description": "List all checkpoints for a training job.",
        "operationId": "list_training_job_checkpoints_felix_training_jobs__job_id__checkpoints_get",
        "parameters": [
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckpointListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Training Job Checkpoints",
        "tags": [
          "felix"
        ]
      }
    },
    "/felix/training-jobs/{job_id}/download": {
      "get": {
        "description": "Generate a presigned S3 URL to download a trained model.",
        "operationId": "download_trained_model_felix_training_jobs__job_id__download_get",
        "parameters": [
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelDownloadResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get download URL for trained model",
        "tags": [
          "felix"
        ]
      }
    },
    "/felix/training-jobs/{job_id}/logs": {
      "get": {
        "description": "Get training output logs (stdout/stderr) for a specific job.",
        "operationId": "get_training_job_logs_felix_training_jobs__job_id__logs_get",
        "parameters": [
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingLogsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Training Job Logs",
        "tags": [
          "felix"
        ]
      }
    },
    "/felix/training-jobs/{job_id}/stop": {
      "post": {
        "description": "Stop a running training job.",
        "operationId": "stop_training_job_felix_training_jobs__job_id__stop_post",
        "parameters": [
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StopJobResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Stop Training Job",
        "tags": [
          "felix"
        ]
      }
    },
    "/generate": {
      "post": {
        "description": "Create an async dataset generation job. Returns immediately with a ``job_id``. Poll ``GET /generate/jobs/{job_id}``\nfor status and results. The ``task_type`` field in the request body determines what kind of dataset\nis generated:\n- ``ner``: Named-entity recognition dataset. Requires ``labels``.\n- ``classification``: Text classification dataset. Requires ``labels``.\n- ``custom``: Free-form prompt-based dataset. Requires ``prompt``.\n- ``decoder``: Instruction-tuning (chat format) dataset. Requires ``domain_description``. Must have DECODER_SUPPORT_ENABLED=true. Dispatches via SQS with idempotency deduplication; falls back to in-process\nBackgroundTasks if SQS is unavailable.",
        "operationId": "create_generation_job_generate_post",
        "parameters": [
          {
            "description": "Whether this is a seed generation",
            "in": "query",
            "name": "is_seed",
            "required": false,
            "schema": {
              "default": false,
              "description": "Whether this is a seed generation",
              "title": "Is Seed",
              "type": "boolean"
            }
          },
          {
            "description": "Synthesis log session ID for resume support",
            "in": "query",
            "name": "synthesis_session_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Synthesis log session ID for resume support",
              "title": "Synthesis Session Id"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateAsyncResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Generation Job",
        "tags": [
          "generate"
        ]
      }
    },
    "/generate/classification/label-existing": {
      "post": {
        "description": "Label existing texts for classification tasks.",
        "operationId": "label_existing_classification_generate_classification_label_existing_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelExistingClassificationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Label Existing Classification",
        "tags": [
          "generate"
        ]
      }
    },
    "/generate/jobs/{job_id}": {
      "get": {
        "description": "Get the current status of an async generation job. Returns the current status and, when complete, the generated data.",
        "operationId": "get_generation_job_status_generate_jobs__job_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "job_id",
            "required": true,
            "schema": {
              "title": "Job Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateJobStatus"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Generation Job Status",
        "tags": [
          "generate"
        ]
      }
    },
    "/generate/ner/label-existing": {
      "post": {
        "description": "Label existing texts for NER entity extraction. Applies the provided label set to a corpus of raw texts using Felix.",
        "operationId": "label_existing_ner_generate_ner_label_existing_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LabelExistingNERRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Label Existing Ner",
        "tags": [
          "generate"
        ]
      }
    },
    "/inference": {
      "post": {
        "description": "Run inference on a fine-tuned model. Supports both encoder tasks (NER, classification, JSON extraction) and\ndecoder tasks (text generation). The ``task`` field discriminates the\nrequest type automatically, and the response ``type`` field indicates\nthe result shape. All provider routing is handled by InferenceService — this endpoint\nsimply validates, builds a payload, calls the service, and formats\nthe response.",
        "operationId": "run_inference_inference_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "discriminator": {
                  "mapping": {
                    "classify_text": "#/components/schemas/EncoderInferenceRequest",
                    "extract_entities": "#/components/schemas/EncoderInferenceRequest",
                    "extract_json": "#/components/schemas/EncoderInferenceRequest",
                    "generate": "#/components/schemas/GenerateInferenceRequest",
                    "schema": "#/components/schemas/EncoderInferenceRequest"
                  },
                  "propertyName": "task"
                },
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/EncoderInferenceRequest"
                  },
                  {
                    "$ref": "#/components/schemas/GenerateInferenceRequest"
                  }
                ],
                "title": "Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "discriminator": {
                    "mapping": {
                      "decoder": "#/components/schemas/GenerateInferenceResponse",
                      "encoder": "#/components/schemas/EncoderInferenceResponse"
                    },
                    "propertyName": "type"
                  },
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/EncoderInferenceResponse"
                    },
                    {
                      "$ref": "#/components/schemas/GenerateInferenceResponse"
                    }
                  ],
                  "title": "Response Run Inference Inference Post"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Run Inference",
        "tags": [
          "inference"
        ]
      }
    },
    "/inferences": {
      "get": {
        "description": "List inference history for the authenticated user. Returns all inference records across all model types (NER, classification,\nJSON extraction, decoder) sorted by most recent first.",
        "operationId": "list_inference_history_inferences_get",
        "parameters": [
          {
            "description": "Maximum records to return",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "description": "Maximum records to return",
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Number of records to skip",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "description": "Number of records to skip",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "description": "Filter by model ID",
            "in": "query",
            "name": "model_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by model ID",
              "title": "Model Id"
            }
          },
          {
            "description": "Filter by task type",
            "in": "query",
            "name": "task",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by task type",
              "title": "Task"
            }
          },
          {
            "description": "Filter by project ID",
            "in": "query",
            "name": "project_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by project ID",
              "title": "Project Id"
            }
          },
          {
            "description": "Filter by training job ID",
            "in": "query",
            "name": "training_job_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by training job ID",
              "title": "Training Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "Inference history dependency is temporarily unavailable."
          }
        },
        "summary": "List Inference History",
        "tags": [
          "inference-history"
        ]
      }
    },
    "/inferences/{inference_id}": {
      "get": {
        "description": "Get a single inference record by ID.",
        "operationId": "get_inference_detail_inferences__inference_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "inference_id",
            "required": true,
            "schema": {
              "title": "Inference Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceRecord"
                }
              }
            },
            "description": "Successful Response"
          },
          "404": {
            "description": "Inference not found."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "Inference history dependency is temporarily unavailable."
          }
        },
        "summary": "Get Inference Detail",
        "tags": [
          "inference-history"
        ]
      }
    },
    "/inferences/{inference_id}/feedback": {
      "get": {
        "description": "Get human feedback for a specific inference.",
        "operationId": "get_inference_feedback_inferences__inference_id__feedback_get",
        "parameters": [
          {
            "in": "path",
            "name": "inference_id",
            "required": true,
            "schema": {
              "title": "Inference Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceFeedbackResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "404": {
            "description": "Feedback not found."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "Inference history dependency is temporarily unavailable."
          }
        },
        "summary": "Get Inference Feedback",
        "tags": [
          "inference-history"
        ]
      },
      "post": {
        "description": "Submit human feedback on a specific inference. Marks an inference as correct or incorrect. When marking as incorrect,\nthe expected output must be provided for downstream training data curation.",
        "operationId": "submit_inference_feedback_inferences__inference_id__feedback_post",
        "parameters": [
          {
            "in": "path",
            "name": "inference_id",
            "required": true,
            "schema": {
              "title": "Inference Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InferenceFeedbackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceFeedbackResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "404": {
            "description": "Inference not found."
          },
          "422": {
            "description": "Invalid feedback payload."
          },
          "503": {
            "description": "Inference history dependency is temporarily unavailable."
          }
        },
        "summary": "Submit Inference Feedback",
        "tags": [
          "inference-history"
        ]
      }
    },
    "/list-api-keys": {
      "get": {
        "description": "List all API keys for the authenticated user with usage statistics. Does not return the actual key values.",
        "operationId": "list_api_keys_list_api_keys_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAPIKeysResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Api Keys",
        "tags": [
          "api-keys"
        ]
      }
    },
    "/projects": {
      "get": {
        "description": "List all projects visible to the authenticated user. Returns team projects (visibility=team) and the user's own private projects,\nscoped to the user's team, sorted by creation date (most recent first).",
        "operationId": "list_projects_projects_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectListResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Projects",
        "tags": [
          "projects"
        ]
      },
      "post": {
        "description": "Create a new project for the authenticated user. Delegates to ``ProjectService`` for business logic, example generation,\nactivity recording, and failure analytics.",
        "operationId": "create_project_projects_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Project",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{project_id}": {
      "delete": {
        "description": "Soft-delete a project by setting is_deleted=True. The project row is preserved in the database but hidden from all\nread queries. Associated resources (notebooks, datasets, training\njobs) remain linked and are unaffected. Works for team projects where the user has admin+ permissions.",
        "operationId": "delete_project_projects__project_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDeleteResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Project",
        "tags": [
          "projects"
        ]
      },
      "get": {
        "description": "Get a specific project by ID. Returns the project if the user can see it (team member + visibility check).\nPrivate projects are only visible to the creator.",
        "operationId": "get_project_projects__project_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Project",
        "tags": [
          "projects"
        ]
      },
      "patch": {
        "description": "Update a project's metadata. Only provided fields will be updated. Project names must remain unique per team.\nUser must be a member of the project's team.",
        "operationId": "update_project_projects__project_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Project",
        "tags": [
          "projects"
        ]
      }
    },
    "/projects/{project_id}/deployments": {
      "get": {
        "description": "Return deployment history for a project, newest first.",
        "operationId": "list_deployments_projects__project_id__deployments_get",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Project Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeploymentHistoryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List deployment history for a project",
        "tags": [
          "deployments"
        ]
      },
      "post": {
        "description": "Activate a training job as the project's active model and record the swap.",
        "operationId": "deploy_model_projects__project_id__deployments_post",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeploymentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeploymentResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Deploy a training job to a project",
        "tags": [
          "deployments"
        ]
      }
    },
    "/projects/{project_id}/deployments/{deployment_id}": {
      "get": {
        "description": "Fetch a specific deployment history record.",
        "operationId": "get_deployment_projects__project_id__deployments__deployment_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Project Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "deployment_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Deployment Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeploymentResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get a single deployment record",
        "tags": [
          "deployments"
        ]
      }
    },
    "/projects/{project_id}/inference": {
      "post": {
        "description": "OpenAI-compatible chat completion endpoint. Resolves the project's active model and runs inference.",
        "operationId": "run_project_inference_projects__project_id__inference_post",
        "parameters": [
          {
            "in": "path",
            "name": "project_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Project Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectInferenceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectInferenceResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Run inference using the project's active model",
        "tags": [
          "project-inference"
        ]
      }
    },
    "/v1/chat/completions": {
      "post": {
        "description": "OpenAI-compatible chat completions endpoint.",
        "operationId": "chat_completions_v1_chat_completions_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Chat Completions",
        "tags": [
          "openai-compat"
        ]
      }
    },
    "/v1/messages": {
      "post": {
        "description": "Anthropic-compatible messages endpoint.",
        "operationId": "messages_v1_messages_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnthropicMessagesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Messages",
        "tags": [
          "anthropic-compat"
        ]
      }
    },
    "/v1/models": {
      "get": {
        "description": "List available Anthropic-compatible models.",
        "operationId": "list_models_v1_models_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "before_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Before Id"
            }
          },
          {
            "in": "query",
            "name": "after_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "After Id"
            }
          },
          {
            "in": "query",
            "name": "client_version",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Client Version"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Models",
        "tags": [
          "anthropic-compat"
        ]
      }
    },
    "/v1/models/{model_id}": {
      "get": {
        "description": "Retrieve metadata for a single Anthropic-compatible model.",
        "operationId": "retrieve_model_v1_models__model_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "model_id",
            "required": true,
            "schema": {
              "title": "Model Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Retrieve Model",
        "tags": [
          "anthropic-compat"
        ]
      }
    },
    "/v1/responses": {
      "post": {
        "description": "Handle OpenAI-compatible Responses API requests.",
        "operationId": "responses_v1_responses_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponsesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Responses",
        "tags": [
          "openai-compat"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "TrainableBaseModelsResponse": {
        "description": "Response listing all base models available for training.",
        "properties": {
          "models": {
            "items": {
              "$ref": "#/components/schemas/TrainableBaseModelResponse"
            },
            "title": "Models",
            "type": "array"
          }
        },
        "required": [
          "models"
        ],
        "title": "TrainableBaseModelsResponse",
        "type": "object"
      },
      "CreateAPIKeyRequest": {
        "description": "Request model for creating an API key.",
        "properties": {
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional expiration timestamp (ISO format)",
            "title": "Expires At"
          },
          "name": {
            "description": "Name for the API key",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "CreateAPIKeyRequest",
        "type": "object"
      },
      "CreateAPIKeyResponse": {
        "description": "Response model for API key creation.",
        "properties": {
          "api_key_last_digits": {
            "title": "Api Key Last Digits",
            "type": "string"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "secret_key": {
            "title": "Secret Key",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "api_key_last_digits",
          "created_at",
          "secret_key"
        ],
        "title": "CreateAPIKeyResponse",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "DeleteAPIKeyRequest": {
        "description": "Request model for deleting an API key.",
        "properties": {
          "key_id": {
            "description": "ID of the API key to delete",
            "title": "Key Id",
            "type": "string"
          }
        },
        "required": [
          "key_id"
        ],
        "title": "DeleteAPIKeyRequest",
        "type": "object"
      },
      "SuccessResponse": {
        "description": "Generic success response.",
        "properties": {
          "data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Data"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "success": {
            "default": true,
            "title": "Success",
            "type": "boolean"
          }
        },
        "title": "SuccessResponse",
        "type": "object"
      },
      "DatasetListResponse": {
        "description": "Response model for listing datasets.",
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "datasets": {
            "items": {
              "$ref": "#/components/schemas/DatasetResponse"
            },
            "title": "Datasets",
            "type": "array"
          },
          "success": {
            "default": true,
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "datasets",
          "count"
        ],
        "title": "DatasetListResponse",
        "type": "object"
      },
      "DatasetUploadProcessRequest": {
        "description": "Request to process uploaded dataset from S3.",
        "properties": {
          "dataset_id": {
            "description": "Dataset ID from upload/url response (all metadata stored in DB)",
            "title": "Dataset Id",
            "type": "string"
          }
        },
        "required": [
          "dataset_id"
        ],
        "title": "DatasetUploadProcessRequest",
        "type": "object"
      },
      "DatasetResponse": {
        "description": "Response model for a single dataset.",
        "properties": {
          "annotation_config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Annotation Config"
          },
          "annotation_progress": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Annotation Progress"
          },
          "annotation_status": {
            "anyOf": [
              {
                "enum": [
                  "none",
                  "in_progress",
                  "completed"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Annotation Status"
          },
          "column_mapping": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Column mapping from original to standard names",
            "title": "Column Mapping"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "dataset_name": {
            "title": "Dataset Name",
            "type": "string"
          },
          "dataset_path": {
            "title": "Dataset Path",
            "type": "string"
          },
          "dataset_type": {
            "title": "Dataset Type",
            "type": "string"
          },
          "generation_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How the dataset was created: synthesize, upload, auto_relabel, manual_relabel, grow, external",
            "title": "Generation Type"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "is_competition": {
            "default": false,
            "description": "Whether this dataset is a competition benchmark",
            "title": "Is Competition",
            "type": "boolean"
          },
          "is_seed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": false,
            "description": "Whether this dataset is a seed dataset (small set for review before full expansion)",
            "title": "Is Seed"
          },
          "labels": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Label names (entity types for NER, class labels for classification)",
            "title": "Labels"
          },
          "processing_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Error message if status is failed",
            "title": "Processing Error"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Project Id"
          },
          "root_dataset_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Root Dataset Id"
          },
          "sample_size": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sample Size"
          },
          "schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schema"
          },
          "schema_warnings": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schema Warnings"
          },
          "size": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Size"
          },
          "status": {
            "anyOf": [
              {
                "enum": [
                  "initialized",
                  "uploading",
                  "converting",
                  "validating",
                  "ready",
                  "failed",
                  "generating",
                  "queued"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": "ready",
            "description": "Dataset status: initialized/uploading/converting/validating/ready/failed/generating/queued",
            "title": "Status"
          },
          "synthesis_session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "UUID of the synthesis log session for this dataset, used to restore creation workflow on resume",
            "title": "Synthesis Session Id"
          },
          "train_ratio": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Train split ratio for this dataset version. Left-to-right split with no shuffle; validation is the tail.",
            "title": "Train Ratio"
          },
          "type": {
            "default": "training",
            "description": "Dataset purpose tag: 'training', 'evaluation', or 'benchmark'",
            "title": "Type",
            "type": "string"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          },
          "validation": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Validation"
          },
          "version_number": {
            "default": "1",
            "title": "Version Number",
            "type": "string"
          },
          "visibility": {
            "default": "private",
            "description": "Dataset visibility: 'private' or 'public'",
            "title": "Visibility",
            "type": "string"
          }
        },
        "required": [
          "id",
          "user_id",
          "dataset_name",
          "dataset_path",
          "dataset_type",
          "created_at",
          "updated_at"
        ],
        "title": "DatasetResponse",
        "type": "object"
      },
      "DatasetUploadUrlRequest": {
        "description": "Request to get presigned URL for dataset upload (bypasses API Gateway limits).",
        "properties": {
          "column_mapping": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Column mapping from source to standard names (e.g., {\"sentence\": \"text\", \"category\": \"label\"}). Valid standard targets: text, label, labels, entities.",
            "title": "Column Mapping"
          },
          "dataset_name": {
            "description": "Name for the dataset",
            "title": "Dataset Name",
            "type": "string"
          },
          "dataset_type": {
            "default": "ner",
            "description": "Type of dataset",
            "enum": [
              "classification",
              "ner",
              "custom",
              "decoder"
            ],
            "title": "Dataset Type",
            "type": "string"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Original filename (used for format detection if format not provided)",
            "title": "Filename"
          },
          "format": {
            "anyOf": [
              {
                "enum": [
                  "jsonl",
                  "csv",
                  "parquet",
                  "json"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "File format (auto-detected from filename if not provided)",
            "title": "Format"
          },
          "generation_type": {
            "anyOf": [
              {
                "enum": [
                  "synthesize",
                  "upload",
                  "auto_relabel",
                  "manual_relabel",
                  "grow",
                  "external"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "How the dataset was created: synthesize, upload, auto_relabel, manual_relabel, grow, external",
            "title": "Generation Type"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional project ID to assign this dataset to",
            "title": "Project Id"
          },
          "schema": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Expected schema as JSON object (e.g., {\"age\": \"Int64\", \"name\": \"Utf8\"}). Enforces column types during parsing. Valid types: Int8, Int16, Int32, Int64, UInt8-64, Float32, Float64, Utf8, Boolean, Date, Datetime, Time, Duration, Categorical, Binary",
            "title": "Schema"
          },
          "split_ratio": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "number"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Split ratio when type is 'split', e.g. {'training': 0.8, 'evaluation': 0.2}",
            "title": "Split Ratio"
          },
          "type": {
            "anyOf": [
              {
                "enum": [
                  "training",
                  "evaluation",
                  "benchmark"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": "training",
            "description": "Dataset purpose: 'training' (trainable), 'evaluation' (not trainable), 'benchmark' (system-managed, evaluation-only; cannot be trained on or directly accessed).",
            "title": "Type"
          },
          "visibility": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": "private",
            "description": "Dataset visibility: 'private' (owner only) or 'public' (anyone can see)",
            "title": "Visibility"
          }
        },
        "required": [
          "dataset_name"
        ],
        "title": "DatasetUploadUrlRequest",
        "type": "object"
      },
      "DatasetUploadUrlResponse": {
        "description": "Response with presigned S3 URL for direct upload.",
        "properties": {
          "dataset_id": {
            "description": "Dataset ID for subsequent processing",
            "title": "Dataset Id",
            "type": "string"
          },
          "expires_in": {
            "description": "URL expiration time in seconds",
            "title": "Expires In",
            "type": "integer"
          },
          "presigned_url": {
            "description": "S3 presigned URL for PUT upload",
            "title": "Presigned Url",
            "type": "string"
          },
          "upload_instructions": {
            "default": "Upload file via HTTP PUT to presigned_url, then call /datasets/upload/process with dataset_id, format, and schema (if applicable)",
            "description": "Instructions for completing the upload",
            "title": "Upload Instructions",
            "type": "string"
          },
          "version_number": {
            "description": "Version number for this dataset",
            "title": "Version Number",
            "type": "string"
          }
        },
        "required": [
          "presigned_url",
          "dataset_id",
          "version_number",
          "expires_in"
        ],
        "title": "DatasetUploadUrlResponse",
        "type": "object"
      },
      "DatasetVersionsResponse": {
        "description": "List of all versions of a dataset",
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          },
          "versions": {
            "items": {
              "$ref": "#/components/schemas/DatasetResponse"
            },
            "title": "Versions",
            "type": "array"
          }
        },
        "required": [
          "success",
          "versions",
          "count"
        ],
        "title": "DatasetVersionsResponse",
        "type": "object"
      },
      "Body_create_dataset_version_felix_datasets__name__post": {
        "properties": {
          "file": {
            "contentMediaType": "application/octet-stream",
            "description": "Dataset file (JSONL, CSV, or Parquet)",
            "title": "File",
            "type": "string"
          },
          "format": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "File format (jsonl, csv, parquet). Auto-detected if not provided.",
            "title": "Format"
          }
        },
        "required": [
          "file"
        ],
        "title": "Body_create_dataset_version_felix_datasets__name__post",
        "type": "object"
      },
      "DatasetMetadataUpdate": {
        "description": "Request model for updating dataset metadata.",
        "properties": {
          "dataset_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New name for the dataset",
            "title": "Dataset Name"
          },
          "dataset_type": {
            "anyOf": [
              {
                "enum": [
                  "ner",
                  "classification",
                  "custom",
                  "decoder"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New type for the dataset",
            "title": "Dataset Type"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Project ID to assign this dataset to (use empty string to unassign)",
            "title": "Project Id"
          }
        },
        "title": "DatasetMetadataUpdate",
        "type": "object"
      },
      "DatasetRowsDeleteRequest": {
        "description": "Request to delete specific rows from a dataset. Exactly one of ``row_indices`` or ``fingerprints`` must be provided.\nFingerprint-based deletion is preferred because it is immune to\ndataset mutations between analysis and delete.",
        "properties": {
          "fingerprints": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Content fingerprints of rows to remove (position-independent)",
            "title": "Fingerprints"
          },
          "row_indices": {
            "anyOf": [
              {
                "items": {
                  "type": "integer"
                },
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Zero-based indices of rows to remove",
            "title": "Row Indices"
          }
        },
        "title": "DatasetRowsDeleteRequest",
        "type": "object"
      },
      "DatasetRowsDeleteResponse": {
        "description": "Response after deleting dataset rows.",
        "properties": {
          "dataset_name": {
            "title": "Dataset Name",
            "type": "string"
          },
          "new_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New version number if a new version was created",
            "title": "New Version"
          },
          "rows_deleted": {
            "title": "Rows Deleted",
            "type": "integer"
          },
          "rows_remaining": {
            "title": "Rows Remaining",
            "type": "integer"
          },
          "success": {
            "default": true,
            "title": "Success",
            "type": "boolean"
          },
          "version": {
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "dataset_name",
          "version",
          "rows_deleted",
          "rows_remaining"
        ],
        "title": "DatasetRowsDeleteResponse",
        "type": "object"
      },
      "DatasetRowsUpdateRequest": {
        "description": "Request to update specific rows in a dataset.",
        "properties": {
          "updates": {
            "description": "List of row updates to apply",
            "items": {
              "$ref": "#/components/schemas/RowUpdate"
            },
            "minItems": 1,
            "title": "Updates",
            "type": "array"
          }
        },
        "required": [
          "updates"
        ],
        "title": "DatasetRowsUpdateRequest",
        "type": "object"
      },
      "DatasetRowsUpdateResponse": {
        "description": "Response after updating dataset rows.",
        "properties": {
          "dataset_name": {
            "title": "Dataset Name",
            "type": "string"
          },
          "new_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New version number if a new version was created",
            "title": "New Version"
          },
          "rows_updated": {
            "title": "Rows Updated",
            "type": "integer"
          },
          "success": {
            "default": true,
            "title": "Success",
            "type": "boolean"
          },
          "validation_warnings": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Validation Warnings"
          },
          "version": {
            "title": "Version",
            "type": "string"
          }
        },
        "required": [
          "dataset_name",
          "version",
          "rows_updated"
        ],
        "title": "DatasetRowsUpdateResponse",
        "type": "object"
      },
      "EvaluationListResponse": {
        "description": "Response for listing evaluations",
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "evaluations": {
            "items": {
              "$ref": "#/components/schemas/EvaluationResponse"
            },
            "title": "Evaluations",
            "type": "array"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "evaluations",
          "count"
        ],
        "title": "EvaluationListResponse",
        "type": "object"
      },
      "EvaluationCreate": {
        "description": "Request to create a new model evaluation. Supports both single dataset (dataset_name) and multiple datasets (dataset_names).\nSupports both single model (base_model) and multiple models (base_model + comparison_models).\nWhen multiple datasets/models are provided, one evaluation is created per dataset x model combination.",
        "properties": {
          "base_model": {
            "description": "Primary model to evaluate (required). Can be a training job ID, explicit GLiNER model ID (e.g. 'fastino/gliner2-base-v1'), decoder base model ID (e.g. 'base:Qwen/Qwen3-8B'), or LLM model ID",
            "title": "Base Model",
            "type": "string"
          },
          "comparison_models": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional list of models to compare against (e.g., ['fastino/gliner2-base-v1', 'gpt-4o']). Provider auto-detected from model ID.",
            "title": "Comparison Models"
          },
          "dataset_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of a single dataset to evaluate on (use dataset_names for multiple)",
            "title": "Dataset Name"
          },
          "dataset_names": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "List of dataset names to evaluate on (creates one evaluation per dataset)",
            "title": "Dataset Names"
          },
          "dataset_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Dataset version (latest if omitted)",
            "title": "Dataset Version"
          },
          "label_column": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of the label/tags column",
            "title": "Label Column"
          },
          "max_examples": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": 100,
            "description": "Max examples for LLM evaluation (openai/together only)",
            "title": "Max Examples"
          },
          "model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "[DEPRECATED] Use base_model instead. Kept for backward compatibility.",
            "title": "Model Id"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional project ID to associate the evaluation with",
            "title": "Project Id"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "[DEPRECATED for multi-model] Provider auto-detected from model ID. Only used for single-model backward compatibility.",
            "title": "Provider"
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": 42,
            "description": "Random seed for sampling (openai/together only)",
            "title": "Seed"
          },
          "task_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Task type: 'classification', 'ner', 'json_extraction', or 'decoder'",
            "title": "Task Type"
          },
          "text_column": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name of the text column",
            "title": "Text Column"
          }
        },
        "required": [
          "base_model"
        ],
        "title": "EvaluationCreate",
        "type": "object"
      },
      "EvaluationCreateResponse": {
        "description": "Response for creating evaluations (supports single or multiple datasets)",
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "evaluations": {
            "items": {
              "$ref": "#/components/schemas/EvaluationResponse"
            },
            "title": "Evaluations",
            "type": "array"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "evaluations",
          "count"
        ],
        "title": "EvaluationCreateResponse",
        "type": "object"
      },
      "DeleteEvaluationResponse": {
        "description": "Response model for deleting an evaluation.",
        "properties": {
          "message": {
            "title": "Message",
            "type": "string"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "message"
        ],
        "title": "DeleteEvaluationResponse",
        "type": "object"
      },
      "EvaluationResponse": {
        "description": "Response for a single evaluation",
        "properties": {
          "accuracy": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accuracy"
          },
          "bleu_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bleu Score"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "dataset_name": {
            "title": "Dataset Name",
            "type": "string"
          },
          "dataset_version": {
            "title": "Dataset Version",
            "type": "string"
          },
          "error_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Count"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "error_sample": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Sample"
          },
          "evaluation_time_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evaluation Time Ms"
          },
          "f1_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "F1 Score"
          },
          "failed_examples": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failed Examples"
          },
          "hamming_loss": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hamming Loss"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "job_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Job Reference"
          },
          "max_examples": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Examples"
          },
          "model_id": {
            "title": "Model Id",
            "type": "string"
          },
          "model_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Name"
          },
          "precision_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Precision Score"
          },
          "predictions": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Predictions"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Project Id"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "recall_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recall Score"
          },
          "rouge_l_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rouge L Score"
          },
          "sample_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sample Count"
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "subset_accuracy": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subset Accuracy"
          },
          "total_cost_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Cost Usd"
          },
          "total_latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Latency Ms"
          },
          "total_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Tokens"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          },
          "validation_loss": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Validation Loss"
          }
        },
        "required": [
          "id",
          "user_id",
          "model_id",
          "dataset_name",
          "dataset_version",
          "status",
          "created_at"
        ],
        "title": "EvaluationResponse",
        "type": "object"
      },
      "TrainingJobListResponse": {
        "description": "List of training jobs response",
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          },
          "training_jobs": {
            "items": {
              "$ref": "#/components/schemas/TrainingJobResponse"
            },
            "title": "Training Jobs",
            "type": "array"
          }
        },
        "required": [
          "success",
          "training_jobs",
          "count"
        ],
        "title": "TrainingJobListResponse",
        "type": "object"
      },
      "TrainingJobCreate": {
        "description": "Request to create a training job.",
        "properties": {
          "base_model": {
            "description": "HuggingFace model identifier (e.g. 'fastino/gliner2-base-v1', 'Qwen/Qwen3-8B').",
            "minLength": 1,
            "title": "Base Model",
            "type": "string"
          },
          "batch_size": {
            "default": 8,
            "description": "Batch size",
            "minimum": 1,
            "title": "Batch Size",
            "type": "integer"
          },
          "datasets": {
            "description": "Datasets to train on (supports multi-dataset training)",
            "items": {
              "$ref": "#/components/schemas/DatasetReference"
            },
            "minItems": 1,
            "title": "Datasets",
            "type": "array"
          },
          "learning_rate": {
            "default": 0.00005,
            "description": "Learning rate",
            "exclusiveMinimum": 0,
            "title": "Learning Rate",
            "type": "number"
          },
          "lora_alpha": {
            "default": 32,
            "description": "LoRA alpha",
            "title": "Lora Alpha",
            "type": "integer"
          },
          "lora_dropout": {
            "default": 0.1,
            "description": "LoRA dropout",
            "title": "Lora Dropout",
            "type": "number"
          },
          "lora_r": {
            "default": 16,
            "description": "LoRA rank",
            "title": "Lora R",
            "type": "integer"
          },
          "model_name": {
            "description": "User-friendly name for the trained model",
            "maxLength": 100,
            "minLength": 1,
            "title": "Model Name",
            "type": "string"
          },
          "nr_epochs": {
            "default": 5,
            "description": "Number of training epochs",
            "minimum": 1,
            "title": "Nr Epochs",
            "type": "integer"
          },
          "profile_training": {
            "default": false,
            "description": "Enable structured training profiling for this run and persist a training_profile.json artifact.",
            "title": "Profile Training",
            "type": "boolean"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional project ID to associate with",
            "title": "Project Id"
          },
          "save_steps": {
            "default": 100,
            "description": "Save checkpoint every N steps",
            "minimum": 1,
            "title": "Save Steps",
            "type": "integer"
          },
          "training_type": {
            "default": "lora",
            "description": "Training type: 'full' or 'lora'",
            "enum": [
              "full",
              "lora"
            ],
            "title": "Training Type",
            "type": "string"
          },
          "validation_data_percentage": {
            "default": 0.1,
            "description": "Percentage of data for validation",
            "maximum": 1,
            "minimum": 0,
            "title": "Validation Data Percentage",
            "type": "number"
          },
          "wandb_api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional W&B API key for logging",
            "title": "Wandb Api Key"
          }
        },
        "required": [
          "model_name",
          "datasets",
          "base_model"
        ],
        "title": "TrainingJobCreate",
        "type": "object"
      },
      "TrainingJobResponse": {
        "description": "Training job response model",
        "properties": {
          "base_model": {
            "title": "Base Model",
            "type": "string"
          },
          "batch_size": {
            "title": "Batch Size",
            "type": "integer"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "datasets": {
            "items": {
              "$ref": "#/components/schemas/DatasetReference"
            },
            "title": "Datasets",
            "type": "array"
          },
          "deployment_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Deprecated. Always returns None -- deployment_status no longer exists. Kept for backward compat with clients that read this field.",
            "readOnly": true,
            "title": "Deployment Status"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "example": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Sample text to pre-load into inference input",
            "title": "Example"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "instance_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Type"
          },
          "is_terminal_status": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether this status is terminal for polling loops",
            "title": "Is Terminal Status"
          },
          "job_reference": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Job Reference"
          },
          "labels": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Merged labels from training datasets (entity types for NER, class labels for classification)",
            "title": "Labels"
          },
          "learning_rate": {
            "title": "Learning Rate",
            "type": "number"
          },
          "metrics": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Training and evaluation metrics dictionary. Contains final_training_loss, final_validation_loss, best_validation_loss from training logs, and optional evaluation metrics (f1_score, precision_score, recall_score, accuracy) if an evaluation has been run.",
            "title": "Metrics"
          },
          "model_auto_selected": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Auto Selected"
          },
          "model_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": "Unnamed Model",
            "title": "Model Name"
          },
          "model_selection_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Selection Reason"
          },
          "normalized_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Canonical status alias for compatibility handling (requested, running, complete, failed, cancelled)",
            "title": "Normalized Status"
          },
          "nr_epochs": {
            "title": "Nr Epochs",
            "type": "integer"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Project ID this training job is associated with",
            "title": "Project Id"
          },
          "root_job_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the original/root training job this version derives from",
            "title": "Root Job Id"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "task_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Task type derived from training datasets: 'ner', 'classification', 'custom', or 'decoder'",
            "title": "Task Type"
          },
          "trained_model_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trained Model Path"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          },
          "validation_data_percentage": {
            "title": "Validation Data Percentage",
            "type": "number"
          },
          "version_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Version number for this training job (e.g., '1', '2', '3')",
            "title": "Version Number"
          }
        },
        "required": [
          "id",
          "user_id",
          "datasets",
          "base_model",
          "validation_data_percentage",
          "nr_epochs",
          "learning_rate",
          "batch_size",
          "status",
          "created_at",
          "updated_at",
          "deployment_status"
        ],
        "title": "TrainingJobResponse",
        "type": "object"
      },
      "DeleteTrainingJobResponse": {
        "description": "Response model for deleting a training job",
        "properties": {
          "message": {
            "title": "Message",
            "type": "string"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "message"
        ],
        "title": "DeleteTrainingJobResponse",
        "type": "object"
      },
      "CheckpointListResponse": {
        "description": "List of checkpoints response",
        "properties": {
          "checkpoints": {
            "items": {
              "$ref": "#/components/schemas/CheckpointResponse"
            },
            "title": "Checkpoints",
            "type": "array"
          },
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "checkpoints",
          "count"
        ],
        "title": "CheckpointListResponse",
        "type": "object"
      },
      "ModelDownloadResponse": {
        "description": "Response with presigned URL for model download",
        "properties": {
          "download_url": {
            "title": "Download Url",
            "type": "string"
          },
          "expires_in_seconds": {
            "default": 3600,
            "title": "Expires In Seconds",
            "type": "integer"
          },
          "file_name": {
            "title": "File Name",
            "type": "string"
          },
          "job_id": {
            "title": "Job Id",
            "type": "string"
          },
          "message": {
            "default": "Download URL generated successfully",
            "title": "Message",
            "type": "string"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "job_id",
          "download_url",
          "file_name"
        ],
        "title": "ModelDownloadResponse",
        "type": "object"
      },
      "TrainingLogsResponse": {
        "description": "Response containing training output logs for a job",
        "properties": {
          "job_id": {
            "title": "Job Id",
            "type": "string"
          },
          "logs": {
            "items": {
              "$ref": "#/components/schemas/TrainingOutputLogEntry"
            },
            "title": "Logs",
            "type": "array"
          },
          "total_logs": {
            "title": "Total Logs",
            "type": "integer"
          }
        },
        "required": [
          "job_id",
          "logs",
          "total_logs"
        ],
        "title": "TrainingLogsResponse",
        "type": "object"
      },
      "StopJobResponse": {
        "description": "Response after stopping a training job",
        "properties": {
          "job_id": {
            "title": "Job Id",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "message",
          "job_id",
          "status"
        ],
        "title": "StopJobResponse",
        "type": "object"
      },
      "GenerateRequest": {
        "description": "Unified async generation request for all task types. Use ``task_type`` to specify what kind of dataset to generate.\nAll generation goes through SQS with BackgroundTasks fallback. Task-specific required fields:\n- ``ner``: requires ``labels``\n- ``classification``: requires ``labels``\n- ``custom``: requires ``prompt``\n- ``decoder``: requires ``domain_description``\n- ``records``: requires ``fields``\n- ``fields``: requires ``input_fields`` and ``output_fields``",
        "properties": {
          "batch_size": {
            "default": 5,
            "description": "Batch size for generation API calls",
            "maximum": 50,
            "minimum": 1,
            "title": "Batch Size",
            "type": "integer"
          },
          "class_balance": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "number"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional class distribution map (classification only)",
            "title": "Class Balance"
          },
          "classified_examples": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Seed examples with feedback for NER: [{text, entities, feedback}] or classification: [{text, label, feedback}]",
            "title": "Classified Examples"
          },
          "config_num_examples": {
            "default": 5,
            "description": "Number of examples to use for config generation",
            "maximum": 20,
            "minimum": 0,
            "title": "Config Num Examples",
            "type": "integer"
          },
          "constraints": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ConstraintRequest"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom constraints applied to all generated examples",
            "title": "Constraints"
          },
          "dataset_name": {
            "description": "Name for the generated dataset",
            "minLength": 1,
            "title": "Dataset Name",
            "type": "string"
          },
          "domain_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Domain description for generation context (required for decoder)",
            "title": "Domain Description"
          },
          "fields": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/RecordField"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Field definitions for structured records (required for records)",
            "title": "Fields"
          },
          "generation_profile": {
            "default": "auto",
            "description": "Queue/runtime execution profile. 'auto' selects a task-aware default.",
            "enum": [
              "auto",
              "fast",
              "balanced",
              "quality"
            ],
            "title": "Generation Profile",
            "type": "string"
          },
          "include_reasoning_trace": {
            "default": false,
            "description": "Whether to include reasoning traces (<think> blocks) in generated outputs for decoder tasks. Ignored when task_type is not 'decoder'.",
            "title": "Include Reasoning Trace",
            "type": "boolean"
          },
          "infer_output_format": {
            "default": false,
            "description": "Infer output format from prompt when output_format is absent",
            "title": "Infer Output Format",
            "type": "boolean"
          },
          "input_fields": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/RecordField"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Input field definitions (required for fields)",
            "title": "Input Fields"
          },
          "instruction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "System instruction for decoder chat format",
            "title": "Instruction"
          },
          "labels": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 250,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Entity/classification labels (required for ner and classification)",
            "title": "Labels"
          },
          "min_criteria": {
            "default": 10,
            "description": "Minimum diversity criteria to generate",
            "maximum": 50,
            "minimum": 1,
            "title": "Min Criteria",
            "type": "integer"
          },
          "multi_label": {
            "default": false,
            "description": "Enable multi-label classification (classification only)",
            "title": "Multi Label",
            "type": "boolean"
          },
          "multiplicator": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MultiplicatorRequest"
              },
              {
                "type": "null"
              }
            ],
            "description": "Multiplicator for balanced distribution across choices"
          },
          "negative_ratio": {
            "anyOf": [
              {
                "maximum": 50,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Percentage of rows with no labels (NER negative samples)",
            "title": "Negative Ratio"
          },
          "num_examples": {
            "default": 10,
            "description": "Number of examples to generate",
            "maximum": 5000,
            "minimum": 1,
            "title": "Num Examples",
            "type": "integer"
          },
          "output_fields": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/RecordField"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Output field definitions (required for fields)",
            "title": "Output Fields"
          },
          "output_format": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Expected output schema for custom generation",
            "title": "Output Format"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Project ID to assign the dataset to",
            "title": "Project Id"
          },
          "prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Natural language prompt describing the task (required for custom)",
            "title": "Prompt"
          },
          "quality": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Generation quality: 'light', 'medium', or 'heavy'",
            "title": "Quality"
          },
          "reasoning_effort": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reasoning effort for the underlying LLM (e.g., 'low', 'medium', 'high')",
            "title": "Reasoning Effort"
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Random seed for reproducibility",
            "title": "Seed"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session ID for log streaming",
            "title": "Session Id"
          },
          "split_ratio": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SplitRatioConfig"
              },
              {
                "type": "null"
              }
            ],
            "description": "Split ratio when type is 'split'. Ignored otherwise."
          },
          "target_choices": {
            "default": 15,
            "description": "Number of choices to expand for diversity",
            "maximum": 50,
            "minimum": 1,
            "title": "Target Choices",
            "type": "integer"
          },
          "task_type": {
            "description": "Type of generation task",
            "enum": [
              "ner",
              "classification",
              "custom",
              "decoder",
              "records",
              "fields"
            ],
            "title": "Task Type",
            "type": "string"
          },
          "temperature": {
            "default": 0.7,
            "description": "Generation temperature",
            "maximum": 2,
            "minimum": 0,
            "title": "Temperature",
            "type": "number"
          },
          "type": {
            "default": "training",
            "description": "Dataset type tag: 'training', 'evaluation', or 'split'",
            "title": "Type",
            "type": "string"
          },
          "use_meta_felix": {
            "default": true,
            "description": "Use MetaFelix for auto-generating diversity criteria",
            "title": "Use Meta Felix",
            "type": "boolean"
          },
          "visibility": {
            "default": "private",
            "description": "Dataset visibility: 'private' or 'public'",
            "title": "Visibility",
            "type": "string"
          }
        },
        "required": [
          "task_type",
          "dataset_name"
        ],
        "title": "GenerateRequest",
        "type": "object"
      },
      "GenerateAsyncResponse": {
        "description": "Response from async generation job creation (HTTP 202). Returned immediately when a background generation job is started.\nThe job_id (which is the dataset_id) can be used to poll for status.",
        "properties": {
          "dataset_name": {
            "description": "Name of the dataset being generated",
            "title": "Dataset Name",
            "type": "string"
          },
          "is_seed": {
            "default": false,
            "description": "Whether this is a seed generation job",
            "title": "Is Seed",
            "type": "boolean"
          },
          "job_id": {
            "description": "Job ID (same as dataset_id) for polling status",
            "title": "Job Id",
            "type": "string"
          },
          "message": {
            "default": "Generation job started",
            "description": "Human-readable status message",
            "title": "Message",
            "type": "string"
          },
          "status": {
            "default": "generating",
            "description": "Initial job status: queued or generating",
            "title": "Status",
            "type": "string"
          },
          "task_type": {
            "description": "Generation task type: ner, classification, or custom",
            "title": "Task Type",
            "type": "string"
          }
        },
        "required": [
          "job_id",
          "dataset_name",
          "task_type"
        ],
        "title": "GenerateAsyncResponse",
        "type": "object"
      },
      "LabelExistingClassificationRequest": {
        "description": "Label existing texts for classification",
        "properties": {
          "batch_size": {
            "default": 5,
            "description": "Number of samples to generate per API call",
            "maximum": 50,
            "minimum": 1,
            "title": "Batch Size",
            "type": "integer"
          },
          "class_balance": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "number"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional class distribution (must sum to 1.0)",
            "title": "Class Balance"
          },
          "config_num_examples": {
            "default": 5,
            "description": "Number of examples to generate for config",
            "maximum": 20,
            "minimum": 0,
            "title": "Config Num Examples",
            "type": "integer"
          },
          "constraints": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ConstraintRequest"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom constraints",
            "title": "Constraints"
          },
          "dataset_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name for the saved dataset (required if save_dataset=True)",
            "title": "Dataset Name"
          },
          "domain_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Domain description for generation context",
            "title": "Domain Description"
          },
          "inputs": {
            "description": "List of texts to label",
            "items": {
              "type": "string"
            },
            "maxItems": 1000,
            "minItems": 1,
            "title": "Inputs",
            "type": "array"
          },
          "labels": {
            "description": "List of classification labels",
            "items": {
              "type": "string"
            },
            "title": "Labels",
            "type": "array"
          },
          "multi_label": {
            "default": false,
            "description": "Enable multi-label classification (samples can have multiple labels)",
            "title": "Multi Label",
            "type": "boolean"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Project ID to assign the dataset to",
            "title": "Project Id"
          },
          "save_dataset": {
            "default": false,
            "description": "Save generated dataset to S3 and database",
            "title": "Save Dataset",
            "type": "boolean"
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Random seed for reproducibility",
            "title": "Seed"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session ID for log streaming",
            "title": "Session Id"
          },
          "temperature": {
            "default": 0.7,
            "description": "Generation temperature",
            "maximum": 2,
            "minimum": 0,
            "title": "Temperature",
            "type": "number"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "User ID (optional, uses authenticated user if not provided)",
            "title": "User Id"
          }
        },
        "required": [
          "labels",
          "inputs"
        ],
        "title": "LabelExistingClassificationRequest",
        "type": "object"
      },
      "GenerateResponse": {
        "description": "Generation response",
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "data": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Data",
            "type": "array"
          },
          "dataset": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Dataset info if saved to S3/database",
            "title": "Dataset"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          },
          "task_type": {
            "title": "Task Type",
            "type": "string"
          },
          "token_usage": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Estimated tokens used for generation",
            "title": "Token Usage"
          }
        },
        "required": [
          "success",
          "data",
          "count",
          "task_type"
        ],
        "title": "GenerateResponse",
        "type": "object"
      },
      "GenerateJobStatus": {
        "description": "Response from job status polling endpoint. Returns current status and, when complete, the generated data.",
        "properties": {
          "count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of generated rows (only present when status is 'ready')",
            "title": "Count"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Job creation timestamp",
            "title": "Created At"
          },
          "data": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Generated data rows (only present when status is 'ready')",
            "title": "Data"
          },
          "dataset": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Dataset info (only present when status is 'ready')",
            "title": "Dataset"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Error message (only present when status is 'failed')",
            "title": "Error"
          },
          "is_seed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether this is a seed dataset",
            "title": "Is Seed"
          },
          "job_id": {
            "description": "Job ID (same as dataset_id)",
            "title": "Job Id",
            "type": "string"
          },
          "status": {
            "description": "Job status: queued, generating, ready, failed",
            "title": "Status",
            "type": "string"
          },
          "task_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Generation task type: ner, classification, or custom",
            "title": "Task Type"
          },
          "token_usage": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Estimated tokens used (only present when status is 'ready')",
            "title": "Token Usage"
          }
        },
        "required": [
          "job_id",
          "status"
        ],
        "title": "GenerateJobStatus",
        "type": "object"
      },
      "LabelExistingNERRequest": {
        "description": "Label existing texts for NER",
        "properties": {
          "config_num_examples": {
            "default": 5,
            "description": "Number of examples to generate for config",
            "maximum": 20,
            "minimum": 0,
            "title": "Config Num Examples",
            "type": "integer"
          },
          "constraints": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ConstraintRequest"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom constraints",
            "title": "Constraints"
          },
          "dataset_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Name for the saved dataset (required if save_dataset=True)",
            "title": "Dataset Name"
          },
          "domain_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Domain description for generation context",
            "title": "Domain Description"
          },
          "inputs": {
            "description": "List of texts to label",
            "items": {
              "type": "string"
            },
            "maxItems": 1000,
            "minItems": 1,
            "title": "Inputs",
            "type": "array"
          },
          "labels": {
            "description": "List of entity labels (e.g., ['PERSON', 'ORG', 'LOC'])",
            "items": {
              "type": "string"
            },
            "title": "Labels",
            "type": "array"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Project ID to assign the dataset to",
            "title": "Project Id"
          },
          "save_dataset": {
            "default": false,
            "description": "Save generated dataset to S3 and database",
            "title": "Save Dataset",
            "type": "boolean"
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Random seed for reproducibility",
            "title": "Seed"
          },
          "session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Session ID for log streaming",
            "title": "Session Id"
          },
          "temperature": {
            "default": 0.7,
            "description": "Generation temperature",
            "maximum": 2,
            "minimum": 0,
            "title": "Temperature",
            "type": "number"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "User ID (optional, uses authenticated user if not provided)",
            "title": "User Id"
          }
        },
        "required": [
          "labels",
          "inputs"
        ],
        "title": "LabelExistingNERRequest",
        "type": "object"
      },
      "EncoderInferenceRequest": {
        "description": "Inference request for encoder (GLiNER) tasks. Supports entity extraction, text classification, JSON extraction,\nand multi-task schema extraction.",
        "properties": {
          "format_results": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": true,
            "description": "Format results (False for raw extraction data)",
            "title": "Format Results"
          },
          "include_confidence": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": false,
            "description": "Include confidence scores in results",
            "title": "Include Confidence"
          },
          "include_spans": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": false,
            "description": "Include character-level start/end positions",
            "title": "Include Spans"
          },
          "is_warmup": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": false,
            "description": "Whether this is a warmup request (not logged to history)",
            "title": "Is Warmup"
          },
          "model_id": {
            "description": "Training job ID of the fine-tuned model, or explicit encoder base model ID (for example 'fastino/gliner2-base-v1')",
            "title": "Model Id",
            "type": "string"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Project ID to associate with this inference. Required for base-model inferences to be picked up by LLMAJ sweeps.",
            "title": "Project Id"
          },
          "schema": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "additionalProperties": true,
                "type": "object"
              }
            ],
            "description": "Schema for extraction (format depends on task)",
            "title": "Schema"
          },
          "store": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": true,
            "description": "Whether to store this inference in the history table. Default true — opt out with store=false.",
            "title": "Store"
          },
          "task": {
            "description": "Encoder task type",
            "enum": [
              "extract_entities",
              "classify_text",
              "extract_json",
              "schema"
            ],
            "title": "Task",
            "type": "string"
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            ],
            "description": "Text to process (single string or list for batch)",
            "title": "Text"
          },
          "threshold": {
            "anyOf": [
              {
                "maximum": 1,
                "minimum": 0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "default": 0.5,
            "description": "Confidence threshold",
            "title": "Threshold"
          }
        },
        "required": [
          "model_id",
          "task",
          "text",
          "schema"
        ],
        "title": "EncoderInferenceRequest",
        "type": "object"
      },
      "GenerateInferenceRequest": {
        "description": "Inference request for decoder text generation. Requires a ``messages`` array in chat format. The last message must\nhave role ``\"user\"`` so the model generates an assistant reply.",
        "properties": {
          "include_reasoning_trace": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": false,
            "description": "When true, return extracted <think> reasoning trace separately from completion when available",
            "title": "Include Reasoning Trace"
          },
          "is_warmup": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": false,
            "description": "Whether this is a warmup request (not logged to history)",
            "title": "Is Warmup"
          },
          "max_tokens": {
            "anyOf": [
              {
                "maximum": 131072,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum tokens to generate",
            "title": "Max Tokens"
          },
          "messages": {
            "description": "Chat messages in [{role, content}] format",
            "items": {
              "$ref": "#/components/schemas/schemas__inference__ChatMessage"
            },
            "minItems": 1,
            "title": "Messages",
            "type": "array"
          },
          "model_id": {
            "description": "Training job ID of the fine-tuned decoder model",
            "title": "Model Id",
            "type": "string"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Project ID to associate with this inference. Required for base-model inferences to be picked up by LLMAJ sweeps.",
            "title": "Project Id"
          },
          "store": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": true,
            "description": "Whether to store this inference in the history table. Default true — opt out with store=false.",
            "title": "Store"
          },
          "task": {
            "const": "generate",
            "description": "Must be 'generate'",
            "title": "Task",
            "type": "string"
          },
          "temperature": {
            "anyOf": [
              {
                "maximum": 2,
                "minimum": 0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Sampling temperature",
            "title": "Temperature"
          },
          "top_p": {
            "anyOf": [
              {
                "maximum": 1,
                "minimum": 0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Top-p sampling parameter",
            "title": "Top P"
          }
        },
        "required": [
          "model_id",
          "task",
          "messages"
        ],
        "title": "GenerateInferenceRequest",
        "type": "object"
      },
      "EncoderInferenceResponse": {
        "description": "Response from an encoder (GLiNER) inference task.",
        "properties": {
          "inference_id": {
            "description": "Unique ID for this inference record (use for feedback/correlation)",
            "title": "Inference Id",
            "type": "string"
          },
          "latency_ms": {
            "description": "Inference latency in milliseconds",
            "title": "Latency Ms",
            "type": "number"
          },
          "model_id": {
            "description": "Training job ID used for inference",
            "title": "Model Id",
            "type": "string"
          },
          "model_used": {
            "description": "Model identifier (for example 'fastino/gliner2-base-v1', 'Qwen/Qwen3-8B', or a training job ID)",
            "title": "Model Used",
            "type": "string"
          },
          "result": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "items": {},
                "type": "array"
              }
            ],
            "description": "Encoder inference result (format depends on task)",
            "title": "Result"
          },
          "token_usage": {
            "description": "Number of input tokens processed",
            "title": "Token Usage",
            "type": "integer"
          },
          "type": {
            "const": "encoder",
            "default": "encoder",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "inference_id",
          "result",
          "model_id",
          "latency_ms",
          "token_usage",
          "model_used"
        ],
        "title": "EncoderInferenceResponse",
        "type": "object"
      },
      "GenerateInferenceResponse": {
        "description": "Response from a decoder text generation task.",
        "properties": {
          "completion": {
            "description": "Generated text completion",
            "title": "Completion",
            "type": "string"
          },
          "inference_id": {
            "description": "Unique ID for this inference record (use for feedback/correlation)",
            "title": "Inference Id",
            "type": "string"
          },
          "latency_ms": {
            "description": "Inference latency in milliseconds",
            "title": "Latency Ms",
            "type": "number"
          },
          "model_id": {
            "description": "Training job ID used for inference",
            "title": "Model Id",
            "type": "string"
          },
          "reasoning_trace": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional extracted <think> reasoning trace text when requested",
            "title": "Reasoning Trace"
          },
          "type": {
            "const": "decoder",
            "default": "decoder",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "inference_id",
          "completion",
          "model_id",
          "latency_ms"
        ],
        "title": "GenerateInferenceResponse",
        "type": "object"
      },
      "InferenceListResponse": {
        "description": "Response for listing inference history.",
        "properties": {
          "inferences": {
            "description": "List of inference records",
            "items": {
              "$ref": "#/components/schemas/InferenceRecord"
            },
            "title": "Inferences",
            "type": "array"
          },
          "limit": {
            "description": "Page size limit",
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "description": "Current offset",
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "description": "Total count of inferences matching filters",
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "inferences",
          "total",
          "limit",
          "offset"
        ],
        "title": "InferenceListResponse",
        "type": "object"
      },
      "InferenceRecord": {
        "description": "Stored inference record from the database.",
        "properties": {
          "base_model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "HuggingFace base model ID",
            "title": "Base Model"
          },
          "created_at": {
            "description": "When the inference was made",
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "human_corrected_output": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "description": "Expected output from human reviewer",
            "title": "Human Corrected Output"
          },
          "human_feedback_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When human feedback was submitted",
            "title": "Human Feedback At"
          },
          "human_feedback_notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional reviewer notes",
            "title": "Human Feedback Notes"
          },
          "human_verdict": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Human reviewer verdict (correct/incorrect)",
            "title": "Human Verdict"
          },
          "id": {
            "description": "Unique inference ID",
            "title": "Id",
            "type": "string"
          },
          "input": {
            "description": "Input text",
            "title": "Input",
            "type": "string"
          },
          "latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Latency in milliseconds",
            "title": "Latency Ms"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Extensible metadata (e.g. LLM judge results)",
            "title": "Metadata"
          },
          "model_id": {
            "description": "Model ID used for inference",
            "title": "Model Id",
            "type": "string"
          },
          "model_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Human-readable model name",
            "title": "Model Name"
          },
          "output": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "description": "Inference output (JSON)",
            "title": "Output"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Project ID the model belongs to",
            "title": "Project Id"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Inference provider",
            "title": "Provider"
          },
          "source": {
            "default": "api",
            "description": "Source of the request (api or ui)",
            "title": "Source",
            "type": "string"
          },
          "task": {
            "description": "Task type (extract_entities, classify_text, etc.)",
            "title": "Task",
            "type": "string"
          },
          "tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Token count",
            "title": "Tokens"
          },
          "training_job_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Training job UUID that produced the model",
            "title": "Training Job Id"
          },
          "user_id": {
            "description": "User who made the inference",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "user_id",
          "model_id",
          "task",
          "input",
          "created_at"
        ],
        "title": "InferenceRecord",
        "type": "object"
      },
      "InferenceFeedbackResponse": {
        "description": "Response after submitting human feedback.",
        "properties": {
          "human_feedback_at": {
            "description": "When the feedback was submitted",
            "format": "date-time",
            "title": "Human Feedback At",
            "type": "string"
          },
          "human_verdict": {
            "description": "Stored human verdict",
            "title": "Human Verdict",
            "type": "string"
          },
          "inference_id": {
            "description": "Inference ID that was annotated",
            "title": "Inference Id",
            "type": "string"
          }
        },
        "required": [
          "inference_id",
          "human_verdict",
          "human_feedback_at"
        ],
        "title": "InferenceFeedbackResponse",
        "type": "object"
      },
      "InferenceFeedbackRequest": {
        "description": "Request to submit human feedback on a specific inference.",
        "properties": {
          "corrected_output": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "description": "Expected output for incorrect verdicts (JSON structure matching task output)",
            "title": "Corrected Output"
          },
          "notes": {
            "anyOf": [
              {
                "maxLength": 5000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional reviewer notes",
            "title": "Notes"
          },
          "verdict": {
            "description": "Human judgment: 'correct' or 'incorrect'",
            "enum": [
              "correct",
              "incorrect"
            ],
            "title": "Verdict",
            "type": "string"
          }
        },
        "required": [
          "verdict"
        ],
        "title": "InferenceFeedbackRequest",
        "type": "object"
      },
      "ListAPIKeysResponse": {
        "description": "Response model for listing API keys.",
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "keys": {
            "items": {
              "$ref": "#/components/schemas/APIKeyInfo"
            },
            "title": "Keys",
            "type": "array"
          }
        },
        "required": [
          "keys",
          "count"
        ],
        "title": "ListAPIKeysResponse",
        "type": "object"
      },
      "ProjectListResponse": {
        "description": "Response model for listing projects.",
        "properties": {
          "count": {
            "title": "Count",
            "type": "integer"
          },
          "projects": {
            "items": {
              "$ref": "#/components/schemas/ProjectResponse"
            },
            "title": "Projects",
            "type": "array"
          },
          "success": {
            "default": true,
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "projects",
          "count"
        ],
        "title": "ProjectListResponse",
        "type": "object"
      },
      "ProjectCreate": {
        "description": "Request model for creating a project.",
        "properties": {
          "active_model_id": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Active model ID for inference",
            "title": "Active Model Id"
          },
          "description": {
            "anyOf": [
              {
                "maxLength": 1000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional project description",
            "title": "Description"
          },
          "example": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Generated API example for the project",
            "title": "Example"
          },
          "icon": {
            "default": "folder",
            "description": "Icon identifier for the project",
            "maxLength": 50,
            "title": "Icon",
            "type": "string"
          },
          "name": {
            "description": "Name for the project",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "repo": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional repository reference or URL",
            "title": "Repo"
          },
          "selected_model_id": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "[Deprecated] Use active_model_id instead.",
            "title": "Selected Model Id"
          },
          "team_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Team ID to assign this project to. Defaults to the user's personal team when omitted.",
            "title": "Team Id"
          },
          "visibility": {
            "default": "private",
            "description": "Who can see this project: private (creator only) or team (all team members).",
            "enum": [
              "private",
              "team"
            ],
            "title": "Visibility",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "ProjectCreate",
        "type": "object"
      },
      "ProjectResponse": {
        "description": "Response model for a single project.",
        "properties": {
          "active_model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active Model Id"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "example": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Example"
          },
          "icon": {
            "default": "folder",
            "title": "Icon",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "repo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Repo"
          },
          "selected_model_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Deprecated alias for active_model_id -- kept for backward compat.",
            "readOnly": true,
            "title": "Selected Model Id"
          },
          "team_id": {
            "title": "Team Id",
            "type": "string"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          },
          "visibility": {
            "default": "private",
            "title": "Visibility",
            "type": "string"
          }
        },
        "required": [
          "id",
          "user_id",
          "name",
          "team_id",
          "created_at",
          "updated_at",
          "selected_model_id"
        ],
        "title": "ProjectResponse",
        "type": "object"
      },
      "ProjectDeleteResponse": {
        "description": "Response model for deleting a project.",
        "properties": {
          "message": {
            "title": "Message",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "message",
          "project_id"
        ],
        "title": "ProjectDeleteResponse",
        "type": "object"
      },
      "ProjectUpdate": {
        "description": "Request model for updating a project.",
        "properties": {
          "active_model_id": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Active model ID for inference",
            "title": "Active Model Id"
          },
          "description": {
            "anyOf": [
              {
                "maxLength": 1000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New project description",
            "title": "Description"
          },
          "icon": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New icon identifier for the project",
            "title": "Icon"
          },
          "name": {
            "anyOf": [
              {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New name for the project",
            "title": "Name"
          },
          "repo": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New repository reference or URL",
            "title": "Repo"
          },
          "selected_model_id": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "[Deprecated] Use active_model_id instead.",
            "title": "Selected Model Id"
          },
          "visibility": {
            "anyOf": [
              {
                "enum": [
                  "private",
                  "team"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who can see this project: private (creator only) or team (all team members).",
            "title": "Visibility"
          }
        },
        "title": "ProjectUpdate",
        "type": "object"
      },
      "DeploymentHistoryResponse": {
        "description": "Paginated list of deployment history records. Attributes: deployments: Ordered list of deployment records (newest first).",
        "properties": {
          "deployments": {
            "items": {
              "$ref": "#/components/schemas/DeploymentResponse"
            },
            "title": "Deployments",
            "type": "array"
          }
        },
        "required": [
          "deployments"
        ],
        "title": "DeploymentHistoryResponse",
        "type": "object"
      },
      "DeploymentCreate": {
        "description": "Request body for deploying a training job to a project. Attributes: training_job_id: UUID of the completed training job to activate. reason: Optional human-readable reason for the swap. project_id: Project ID -- used only by the deprecated /felix/deployments endpoint. For new clients, supply project_id in the URL path instead.",
        "properties": {
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "[Deprecated] Project ID. Provide in the URL path (/projects/{project_id}/deployments) instead.",
            "title": "Project Id"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional reason for this deployment",
            "title": "Reason"
          },
          "training_job_id": {
            "description": "UUID of the training job to deploy",
            "title": "Training Job Id",
            "type": "string"
          }
        },
        "required": [
          "training_job_id"
        ],
        "title": "DeploymentCreate",
        "type": "object"
      },
      "DeploymentResponse": {
        "description": "A single deployment history record. Attributes: id: Unique deployment record ID. project_id: The project whose active model was changed. training_job_id: The training job that was deployed. deployed_by: User ID who triggered the deployment. reason: Optional reason for the swap. deployed_at: When the swap occurred.",
        "properties": {
          "deployed_at": {
            "format": "date-time",
            "title": "Deployed At",
            "type": "string"
          },
          "deployed_by": {
            "title": "Deployed By",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "project_id": {
            "title": "Project Id",
            "type": "string"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "training_job_id": {
            "title": "Training Job Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "project_id",
          "training_job_id",
          "deployed_by",
          "reason",
          "deployed_at"
        ],
        "title": "DeploymentResponse",
        "type": "object"
      },
      "ProjectInferenceRequest": {
        "description": "OpenAI-compatible chat completion request for a project. Attributes: messages: List of chat messages in OpenAI format. project_id: Project ID (optional if provided in path). schema: Entity labels for NER/classification/extraction models. task_type: GLiNER task type - 'ner', 'classification', or 'json_extraction'. max_tokens: Maximum tokens to generate. temperature: Sampling temperature (0.0-2.0). top_p: Nucleus sampling parameter. stream: Whether to stream the response (not yet supported). skip_save: If true, do not save the inference to the database.",
        "properties": {
          "max_tokens": {
            "anyOf": [
              {
                "maximum": 32768,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum tokens to generate",
            "title": "Max Tokens"
          },
          "messages": {
            "description": "Chat messages in OpenAI format",
            "items": {
              "$ref": "#/components/schemas/InferenceMessage"
            },
            "minItems": 1,
            "title": "Messages",
            "type": "array"
          },
          "project_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Project ID (optional if provided in URL path)",
            "title": "Project Id"
          },
          "schema": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Entity labels for NER models (e.g., ['person', 'organization', 'location'])",
            "title": "Schema"
          },
          "skip_save": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": false,
            "description": "If true, do not save the inference to the database",
            "title": "Skip Save"
          },
          "stream": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": false,
            "description": "Whether to stream the response (not yet supported)",
            "title": "Stream"
          },
          "task_type": {
            "anyOf": [
              {
                "enum": [
                  "ner",
                  "classification",
                  "json_extraction"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "GLiNER task type: 'ner' for entity recognition, 'classification' for text classification, 'json_extraction' for structured extraction",
            "title": "Task Type"
          },
          "temperature": {
            "anyOf": [
              {
                "maximum": 2,
                "minimum": 0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Sampling temperature",
            "title": "Temperature"
          },
          "top_p": {
            "anyOf": [
              {
                "maximum": 1,
                "minimum": 0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Nucleus sampling parameter",
            "title": "Top P"
          }
        },
        "required": [
          "messages"
        ],
        "title": "ProjectInferenceRequest",
        "type": "object"
      },
      "ProjectInferenceResponse": {
        "description": "OpenAI-compatible chat completion response. Attributes: id: Unique completion ID. object: Always 'chat.completion'. created: Unix timestamp of creation. model: Model identifier used. choices: List of completion choices. usage: Token usage statistics.",
        "properties": {
          "choices": {
            "description": "Completion choices",
            "items": {
              "$ref": "#/components/schemas/ProjectInferenceChoice"
            },
            "title": "Choices",
            "type": "array"
          },
          "created": {
            "description": "Unix timestamp of creation",
            "title": "Created",
            "type": "integer"
          },
          "id": {
            "description": "Unique completion ID",
            "title": "Id",
            "type": "string"
          },
          "model": {
            "description": "Model identifier used",
            "title": "Model",
            "type": "string"
          },
          "object": {
            "const": "chat.completion",
            "default": "chat.completion",
            "description": "Object type",
            "title": "Object",
            "type": "string"
          },
          "usage": {
            "$ref": "#/components/schemas/ProjectInferenceUsage",
            "description": "Token usage statistics"
          }
        },
        "required": [
          "model",
          "choices",
          "usage"
        ],
        "title": "ProjectInferenceResponse",
        "type": "object"
      },
      "ChatCompletionRequest": {
        "description": "OpenAI-compatible chat completion request.",
        "properties": {
          "extra_body": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extra Body"
          },
          "extra_headers": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extra Headers"
          },
          "frequency_penalty": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Frequency Penalty"
          },
          "include_confidence": {
            "default": true,
            "title": "Include Confidence",
            "type": "boolean"
          },
          "include_spans": {
            "default": true,
            "title": "Include Spans",
            "type": "boolean"
          },
          "logit_bias": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logit Bias"
          },
          "max_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Tokens"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/api__openai_compat_router__ChatMessage"
            },
            "title": "Messages",
            "type": "array"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "n": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "N"
          },
          "presence_penalty": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Presence Penalty"
          },
          "response_format": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Format"
          },
          "schema": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schema"
          },
          "seed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seed"
          },
          "stop": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stop"
          },
          "stream": {
            "default": false,
            "title": "Stream",
            "type": "boolean"
          },
          "task_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Type"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "tool_choice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Choice"
          },
          "tools": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tools"
          },
          "top_p": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Top P"
          },
          "user": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User"
          }
        },
        "required": [
          "model",
          "messages"
        ],
        "title": "ChatCompletionRequest",
        "type": "object"
      },
      "AnthropicMessagesRequest": {
        "description": "Anthropic Messages API request format.",
        "properties": {
          "include_confidence": {
            "default": true,
            "title": "Include Confidence",
            "type": "boolean"
          },
          "include_spans": {
            "default": true,
            "title": "Include Spans",
            "type": "boolean"
          },
          "max_tokens": {
            "default": 1024,
            "minimum": 1,
            "title": "Max Tokens",
            "type": "integer"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/AnthropicMessage"
            },
            "title": "Messages",
            "type": "array"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "schema": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schema"
          },
          "stream": {
            "default": false,
            "title": "Stream",
            "type": "boolean"
          },
          "system": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/SystemContentBlock"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "System"
          },
          "task_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task Type"
          },
          "temperature": {
            "anyOf": [
              {
                "maximum": 1,
                "minimum": 0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "top_p": {
            "anyOf": [
              {
                "maximum": 1,
                "minimum": 0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Top P"
          }
        },
        "required": [
          "model",
          "messages"
        ],
        "title": "AnthropicMessagesRequest",
        "type": "object"
      },
      "ResponsesRequest": {
        "additionalProperties": true,
        "description": "OpenAI-compatible Responses API request.",
        "properties": {
          "extra_body": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extra Body"
          },
          "extra_headers": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extra Headers"
          },
          "include": {
            "items": {
              "type": "string"
            },
            "title": "Include",
            "type": "array"
          },
          "input": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Input",
            "type": "array"
          },
          "instructions": {
            "default": "",
            "title": "Instructions",
            "type": "string"
          },
          "max_output_tokens": {
            "anyOf": [
              {
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Output Tokens"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          },
          "model": {
            "title": "Model",
            "type": "string"
          },
          "parallel_tool_calls": {
            "default": false,
            "title": "Parallel Tool Calls",
            "type": "boolean"
          },
          "prompt_cache_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt Cache Key"
          },
          "reasoning": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ResponsesReasoningRequest"
              },
              {
                "type": "null"
              }
            ]
          },
          "service_tier": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Tier"
          },
          "store": {
            "default": true,
            "title": "Store",
            "type": "boolean"
          },
          "stream": {
            "default": false,
            "title": "Stream",
            "type": "boolean"
          },
          "temperature": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Temperature"
          },
          "text": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ResponsesTextRequest"
              },
              {
                "type": "null"
              }
            ]
          },
          "tool_choice": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "additionalProperties": true,
                "type": "object"
              }
            ],
            "default": "auto",
            "title": "Tool Choice"
          },
          "tools": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Tools",
            "type": "array"
          },
          "top_p": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Top P"
          }
        },
        "required": [
          "model"
        ],
        "title": "ResponsesRequest",
        "type": "object"
      },
      "TrainableBaseModelResponse": {
        "description": "Display metadata for a single trainable base model.",
        "properties": {
          "context_window": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum context length in tokens",
            "title": "Context Window"
          },
          "description": {
            "description": "Short description shown in UI",
            "title": "Description",
            "type": "string"
          },
          "id": {
            "description": "HuggingFace model ID (canonical routing key)",
            "title": "Id",
            "type": "string"
          },
          "input_price_per_million": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "USD cost per million input tokens",
            "title": "Input Price Per Million"
          },
          "label": {
            "description": "Human-friendly display name",
            "title": "Label",
            "type": "string"
          },
          "output_price_per_million": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "USD cost per million output tokens",
            "title": "Output Price Per Million"
          },
          "supports_inference": {
            "description": "Whether this model is available via a pre-deployed, serverless endpoint (no startup latency, pay-per-token). When False the model may still be served on-demand after fine-tuning — see supports_on_demand_inference.",
            "title": "Supports Inference",
            "type": "boolean"
          },
          "supports_on_demand_inference": {
            "description": "Whether this model supports on-demand LoRA deployment (dedicated GPU serving a fine-tuned adapter).",
            "title": "Supports On Demand Inference",
            "type": "boolean"
          },
          "task_type": {
            "description": "Training task: 'decoder' for LLM fine-tuning, 'gliner' for NER/classification",
            "title": "Task Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "description",
          "task_type",
          "supports_inference",
          "supports_on_demand_inference"
        ],
        "title": "TrainableBaseModelResponse",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "RowUpdate": {
        "description": "A single row update specification.",
        "properties": {
          "changes": {
            "additionalProperties": true,
            "description": "Column name to new value mapping",
            "title": "Changes",
            "type": "object"
          },
          "row_index": {
            "description": "Zero-based index of the row to update",
            "title": "Row Index",
            "type": "integer"
          }
        },
        "required": [
          "row_index",
          "changes"
        ],
        "title": "RowUpdate",
        "type": "object"
      },
      "DatasetReference": {
        "description": "Reference to a dataset by name and optional version",
        "properties": {
          "name": {
            "description": "Dataset name",
            "title": "Name",
            "type": "string"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Version (latest if omitted)",
            "title": "Version"
          }
        },
        "required": [
          "name"
        ],
        "title": "DatasetReference",
        "type": "object"
      },
      "CheckpointResponse": {
        "description": "Single checkpoint response",
        "properties": {
          "accuracy": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accuracy"
          },
          "checkpoint_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Checkpoint Path"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "epoch": {
            "title": "Epoch",
            "type": "integer"
          },
          "gpu_memory_total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gpu Memory Total"
          },
          "gpu_memory_used": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gpu Memory Used"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "is_best": {
            "default": false,
            "title": "Is Best",
            "type": "boolean"
          },
          "is_deployable": {
            "default": false,
            "title": "Is Deployable",
            "type": "boolean"
          },
          "is_final": {
            "default": false,
            "title": "Is Final",
            "type": "boolean"
          },
          "job_id": {
            "title": "Job Id",
            "type": "string"
          },
          "learning_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Learning Rate"
          },
          "step": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Step"
          },
          "training_loss": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Training Loss"
          },
          "updated_at": {
            "title": "Updated At",
            "type": "string"
          },
          "validation_loss": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Validation Loss"
          }
        },
        "required": [
          "id",
          "job_id",
          "epoch",
          "created_at",
          "updated_at"
        ],
        "title": "CheckpointResponse",
        "type": "object"
      },
      "TrainingOutputLogEntry": {
        "description": "Single training output log entry (stdout/stderr)",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "job_id": {
            "title": "Job Id",
            "type": "string"
          },
          "level": {
            "title": "Level",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "timestamp": {
            "format": "date-time",
            "title": "Timestamp",
            "type": "string"
          }
        },
        "required": [
          "id",
          "job_id",
          "timestamp",
          "level",
          "message",
          "source"
        ],
        "title": "TrainingOutputLogEntry",
        "type": "object"
      },
      "ConstraintRequest": {
        "description": "Constraint request model",
        "properties": {
          "choices": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional list of choices for this constraint",
            "title": "Choices"
          },
          "description": {
            "description": "Constraint description",
            "title": "Description",
            "type": "string"
          },
          "probability": {
            "anyOf": [
              {
                "maximum": 1,
                "minimum": 0,
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional probability (0.0-1.0) for this constraint",
            "title": "Probability"
          },
          "weights": {
            "anyOf": [
              {
                "items": {
                  "type": "number"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional weights for choices (must align with choices length)",
            "title": "Weights"
          }
        },
        "required": [
          "description"
        ],
        "title": "ConstraintRequest",
        "type": "object"
      },
      "RecordField": {
        "description": "Record field definition",
        "properties": {
          "allowed_values": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Values"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "type": {
            "default": "str",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "RecordField",
        "type": "object"
      },
      "MultiplicatorRequest": {
        "description": "Multiplicator for balanced dataset distribution",
        "properties": {
          "choices": {
            "description": "List of choices to balance across",
            "items": {
              "type": "string"
            },
            "title": "Choices",
            "type": "array"
          },
          "prompt": {
            "description": "Multiplicator prompt (e.g., 'The sentiment should be')",
            "title": "Prompt",
            "type": "string"
          }
        },
        "required": [
          "prompt",
          "choices"
        ],
        "title": "MultiplicatorRequest",
        "type": "object"
      },
      "SplitRatioConfig": {
        "description": "Split ratio configuration for train/eval split datasets. Values are decimals (e.g. 0.8 for 80% training, 0.2 for 20% evaluation).",
        "properties": {
          "evaluation": {
            "default": 0.2,
            "description": "Fraction of data for evaluation (0.05–0.95)",
            "maximum": 0.95,
            "minimum": 0.05,
            "title": "Evaluation",
            "type": "number"
          },
          "training": {
            "default": 0.8,
            "description": "Fraction of data for training (0.05–0.95)",
            "maximum": 0.95,
            "minimum": 0.05,
            "title": "Training",
            "type": "number"
          }
        },
        "title": "SplitRatioConfig",
        "type": "object"
      },
      "schemas__inference__ChatMessage": {
        "description": "Single message in a chat conversation. Matches the Qwen chat format used for decoder dataset validation.",
        "properties": {
          "content": {
            "description": "Message content text",
            "minLength": 1,
            "title": "Content",
            "type": "string"
          },
          "role": {
            "description": "Message role: 'system', 'user', or 'assistant'",
            "enum": [
              "system",
              "user",
              "assistant"
            ],
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "role",
          "content"
        ],
        "title": "ChatMessage",
        "type": "object"
      },
      "APIKeyInfo": {
        "description": "Information about an API key.",
        "properties": {
          "api_key_last_digits": {
            "title": "Api Key Last Digits",
            "type": "string"
          },
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "request_count": {
            "title": "Request Count",
            "type": "integer"
          },
          "usage_cost": {
            "title": "Usage Cost",
            "type": "number"
          },
          "usage_tokens": {
            "title": "Usage Tokens",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "api_key_last_digits",
          "created_at",
          "usage_tokens",
          "usage_cost",
          "request_count"
        ],
        "title": "APIKeyInfo",
        "type": "object"
      },
      "InferenceMessage": {
        "description": "Single message in a chat conversation (OpenAI format). Attributes: role: Message role - 'system', 'user', or 'assistant'. content: Message content text.",
        "properties": {
          "content": {
            "description": "Message content text",
            "title": "Content",
            "type": "string"
          },
          "role": {
            "description": "Message role: 'system', 'user', or 'assistant'",
            "enum": [
              "system",
              "user",
              "assistant"
            ],
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "role",
          "content"
        ],
        "title": "InferenceMessage",
        "type": "object"
      },
      "ProjectInferenceChoice": {
        "description": "Single completion choice (OpenAI format). Attributes: index: Choice index (0 for single completion). message: The generated message. finish_reason: Why generation stopped.",
        "properties": {
          "finish_reason": {
            "default": "stop",
            "description": "Why generation stopped",
            "enum": [
              "stop",
              "length",
              "content_filter"
            ],
            "title": "Finish Reason",
            "type": "string"
          },
          "index": {
            "default": 0,
            "description": "Choice index",
            "title": "Index",
            "type": "integer"
          },
          "message": {
            "$ref": "#/components/schemas/ProjectInferenceChoiceMessage",
            "description": "Generated message"
          }
        },
        "required": [
          "message"
        ],
        "title": "ProjectInferenceChoice",
        "type": "object"
      },
      "ProjectInferenceUsage": {
        "description": "Token usage statistics (OpenAI format). Attributes: prompt_tokens: Number of tokens in the prompt. completion_tokens: Number of tokens in the completion. total_tokens: Total tokens used.",
        "properties": {
          "completion_tokens": {
            "description": "Tokens in the completion",
            "title": "Completion Tokens",
            "type": "integer"
          },
          "prompt_tokens": {
            "description": "Tokens in the prompt",
            "title": "Prompt Tokens",
            "type": "integer"
          },
          "total_tokens": {
            "description": "Total tokens used",
            "title": "Total Tokens",
            "type": "integer"
          }
        },
        "required": [
          "prompt_tokens",
          "completion_tokens",
          "total_tokens"
        ],
        "title": "ProjectInferenceUsage",
        "type": "object"
      },
      "api__openai_compat_router__ChatMessage": {
        "description": "A single chat message.",
        "properties": {
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "tool_call_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Call Id"
          },
          "tool_calls": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Calls"
          }
        },
        "required": [
          "role"
        ],
        "title": "ChatMessage",
        "type": "object"
      },
      "AnthropicMessage": {
        "description": "A message in Anthropic format.",
        "properties": {
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/ContentBlock"
                },
                "type": "array"
              }
            ],
            "title": "Content"
          },
          "role": {
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "role",
          "content"
        ],
        "title": "AnthropicMessage",
        "type": "object"
      },
      "SystemContentBlock": {
        "description": "A system content block in Anthropic format.",
        "properties": {
          "text": {
            "default": "",
            "title": "Text",
            "type": "string"
          },
          "type": {
            "default": "text",
            "title": "Type",
            "type": "string"
          }
        },
        "title": "SystemContentBlock",
        "type": "object"
      },
      "ResponsesReasoningRequest": {
        "additionalProperties": true,
        "description": "Reasoning controls in OpenAI Responses format.",
        "properties": {
          "effort": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effort"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          }
        },
        "title": "ResponsesReasoningRequest",
        "type": "object"
      },
      "ResponsesTextRequest": {
        "additionalProperties": true,
        "description": "Responses text controls.",
        "properties": {
          "format": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ResponsesTextFormatRequest"
              },
              {
                "type": "null"
              }
            ]
          },
          "verbosity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verbosity"
          }
        },
        "title": "ResponsesTextRequest",
        "type": "object"
      },
      "ProjectInferenceChoiceMessage": {
        "description": "Message content within a choice (OpenAI format). Attributes: role: Always 'assistant' for completions. content: Generated text content.",
        "properties": {
          "content": {
            "description": "Generated text content",
            "title": "Content",
            "type": "string"
          },
          "role": {
            "const": "assistant",
            "default": "assistant",
            "description": "Message role",
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "title": "ProjectInferenceChoiceMessage",
        "type": "object"
      },
      "ContentBlock": {
        "description": "A content block in Anthropic format.",
        "properties": {
          "text": {
            "default": "",
            "title": "Text",
            "type": "string"
          },
          "type": {
            "default": "text",
            "title": "Type",
            "type": "string"
          }
        },
        "title": "ContentBlock",
        "type": "object"
      },
      "ResponsesTextFormatRequest": {
        "additionalProperties": true,
        "description": "Structured-output controls for Responses text formatting.",
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schema"
          },
          "strict": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Strict"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          }
        },
        "title": "ResponsesTextFormatRequest",
        "type": "object"
      }
    },
    "securitySchemes": {
      "APIKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Pioneer API key (starts with pio_sk_)"
      }
    }
  },
  "security": [
    {
      "APIKeyHeader": []
    }
  ]
}
