## Model Search

`search.model_search(SearchModelSearchParams**kwargs)  -> SyncSearchHitsOffset[SearchModelSearchResponse]`

**post** `/search/models`

Search for models.
At least one of the following fields must have a value: `query`, `filter`, `image`, or `images`.

`image`, and `images` are mutually exclusive.

### Parameters

- `original_assets: Optional[bool]`

  If set to true, returns the original asset without transformation

- `project_id: Optional[str]`

  The projectId used for ownership resource management. Either to assert ownership or to set the owner of the resource(s)

- `filter: Optional[str]`

  Filter queries by an attribute's value

- `hits_per_page: Optional[float]`

  Maximum number of documents returned for a page. Must be used with `page`.

- `image: Optional[str]`

  Search for model with `image` as a reference

  Must be an existing `AssetId` or a valid data URL.

- `images: Optional[Images]`

  Search for model with `images.like` and `images.unlike` as a reference

  Must be an array of existing `AssetId` or valid data URLs.

  - `like: Optional[Sequence[str]]`

    Search for model images with `images.like` as a reference

    Must be an array of existing `AssetId` or valid data URLs.

  - `unlike: Optional[Sequence[str]]`

    Search for model images that are not similar to `images.unlike` as a reference

    Must be an array of existing `AssetId` or valid data URLs.

- `image_semantic_ratio: Optional[float]`

  Image embedding ratio for hybrid search, applied when `image`, `images.like`, or `images.unlike`
  are provided

- `limit: Optional[float]`

  Maximum number of documents returned. Must be used with `offset`.

- `offset: Optional[float]`

  Number of documents to skip. Must be used with `limit`. Starts from 0.

- `page: Optional[float]`

  Request a specific page of results. Must be used with `hitsPerPage`.

- `public: Optional[bool]`

  Search for public images not necessarily belonging to the current `ownerId`

- `query: Optional[str]`

  A string used for querying search results.

- `query_semantic_ratio: Optional[float]`

  Query embedding for hybrid search, if possible

- `sort_by: Optional[Sequence[str]]`

  Sort the search results by the given attributes. Each attribute in the list must be followed by a colon (`:`) and the preferred sorting order: either ascending (`asc`) or descending (`desc`).

  Example: `['createdAt:desc']`

### Returns

- `class SearchModelSearchResponse: …`

  - `id: str`

    Unique identifier for the model (e.g., "model_GTrL3mq4SXWyMxkOHRxlpw")

  - `author_id: str`

    User ID of the model creator/author

  - `capabilities: List[str]`

    Array of model capabilities

  - `collection_ids: List[str]`

    Array of collection IDs this model belongs to

  - `concepts: List[Concept]`

    Array of concept models associated with this model
    Each concept contains a reference to its source model

    - `model_id: str`

      ID of the concept's source model

  - `created_at: str`

    Creation timestamp in ISO 8601 format (e.g., "2025-01-16T11:19:41.579Z")

  - `example_asset_ids: List[str]`

    Array of example asset IDs associated with this model

  - `name: str`

    Display name of the model

  - `owner_id: str`

    Project ID of the model owner

  - `privacy: str`

    Privacy setting of the model ("public", "private", or "unlisted")

  - `short_description: str`

    Short description of the model

  - `source: str`

    Source/origin of the model (e.g., "training", "import")

  - `tags: List[str]`

    Array of user-assigned tags for categorization

  - `team_id: str`

    Team ID of the model owner

  - `training_images_number: float`

    Number of images used to train this model

  - `type: str`

    Type of the model (e.g., "flux.1", "flux.1-lora")

  - `updated_at: str`

    Last modification timestamp in ISO 8601 format (e.g., "2025-01-16T11:19:41.579Z")

  - `parent_model_id: Optional[str]`

    ID of the parent model this model was derived from

  - `score: Optional[float]`

    Score assigned to the model based on usage and popularity

  - `thumbnail: Optional[Thumbnail]`

    Thumbnail image information for the model

    - `asset_id: str`

      ID of the asset used as thumbnail

    - `url: str`

      Signed URL of the thumbnail

### Example

```python
import os
from scenario_sdk import Scenario

client = Scenario(
    api_key=os.environ.get("SCENARIO_SDK_API_KEY"),  # This is the default and can be omitted
    api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"),  # This is the default and can be omitted
)
page = client.search.model_search()
page = page.hits[0]
print(page.id)
```

#### Response

```json
{
  "hits": [
    {
      "id": "id",
      "authorId": "authorId",
      "capabilities": [
        "string"
      ],
      "collectionIds": [
        "string"
      ],
      "concepts": [
        {
          "modelId": "modelId"
        }
      ],
      "createdAt": "createdAt",
      "exampleAssetIds": [
        "string"
      ],
      "name": "name",
      "ownerId": "ownerId",
      "privacy": "privacy",
      "shortDescription": "shortDescription",
      "source": "source",
      "tags": [
        "string"
      ],
      "teamId": "teamId",
      "trainingImagesNumber": 0,
      "type": "type",
      "updatedAt": "updatedAt",
      "parentModelId": "parentModelId",
      "score": 0,
      "thumbnail": {
        "assetId": "assetId",
        "url": "url"
      }
    }
  ],
  "limit": 0,
  "offset": 0,
  "estimatedTotalHits": 0,
  "hitsPerPage": 0,
  "page": 0,
  "totalHits": 0,
  "totalPages": 0
}
```
