---
title: "Text to Image Search"
method: POST
path: "/api/v1/search/text-to-image"
tags: ["search > search"]
---

# Text to Image Search

`POST /api/v1/search/text-to-image`

Search a dataset with a natural-language query and get back the images that best match it. Use this when you want to find visuals by describing what's in them.For example, search for a sunset at the beach or Jalen Hurts holding the Vince Lombardi trophy. Pair the text query with exact-match metadata filters to narrow results further.

## Headers

- `Authorization` string, required

## Request body

- SearchTextSearchRequest — Text search request
  - `dataset_id` string, uuid, required — The unique identifier for the dataset
  - `offset` integer — Starting index to return
  - `limit` integer — Max number of items to return
  - `metadata_filters` SearchMetadataFilters
    - `filters` SearchMetadataFiltersFiltersItems[], required
      - union
        - SearchBooleanEqualsClause
          - `key` string, required
          - `operator` '==', required
          - `value` boolean, required
        - SearchEqualsClause
          - `key` string, required
          - `operator` '==', required
          - `value` string, required
        - SearchNotEqualsClause
          - `key` string, required
          - `operator` '!=', required
          - `value` string, required
        - SearchDateTimeRangeInclusiveClause
          - `key` string, required
          - `start_utc_epoch` number, double, nullable
          - `end_utc_epoch` number, double, nullable
          - `operator` 'DateTimeRangeInclusive', required
  - `moderation_score_type` 'probability' | 'level' — Score type returned by the moderation service. - PROBABILITY: Scores in range 0-1 (uses BGE Reranker model) - LEVEL: Scores in range 0-5 (uses OpenAI model)
  - `text_query` string, required — The text query to search for
  - `negative_text` string, nullable — Optional text describing what to exclude from search results. Steers the query embedding away from this direction.
  - `asset_type` 'image' | 'video'
  - `skip_moderation` boolean — Skip content moderation if enabled

## Response `200`

Successful Response

- SearchAppApiRoutesSearchV1SchemaSchemaSearchResponse — Base search response
  - `data` SearchAppApiRoutesSearchV1SchemaSchemaSearchResponseDataItems[], required — The paginated results
    - union
      - SearchImage — An image asset response
        - `created_user_id` string, required — The user that created the resource
        - `created_dt` string, date-time, required — The created datetime of the resource
        - `updated_user_id` string, required — The user that last updated the resource
        - `updated_dt` string, date-time, required — The datetime the resource was last updated
        - `coactive_image_id` string, uuid, required — The coactive image id
        - `path` string, nullable — The original path of the image
        - `metadata` object, nullable — The user provided metadata for the image
        - `moderation_score` number, double, nullable — The moderation score of the image
      - SearchAppApiRoutesSearchV1SchemaSchemaKeyframe — A keyframe asset response
        - `coactive_image_id` string, uuid, required — The coactive image id
        - `video` SearchVideo, required — A video asset response
          - `created_user_id` string, required — The user that created the resource
          - `created_dt` string, date-time, required — The created datetime of the resource
          - `updated_user_id` string, required — The user that last updated the resource
          - `updated_dt` string, date-time, required — The datetime the resource was last updated
          - `path` string, nullable — The original path of the video
          - `coactive_video_id` string, uuid, required — The coactive video id
          - `metadata` object, nullable — The user provided metadata for the video
        - `shot` SearchShot, required — Metadata about a video shot
          - `shot_id` string, uuid, required — The unique shot id
          - `start_time_ms` integer, required — The start time in milliseconds from the beginning of the video
          - `end_time_ms` integer, required — The end time in milliseconds from the beginning of the video
        - `audio_segment` SearchAudioSegment — Metadata about a video audio segment
          - `start_time_ms` integer, required — The start time in milliseconds of the beginning of the audio clip
          - `end_time_ms` integer, required — The end time in milliseconds of the end of the audio clip
          - `speech_to_text_transcription` string, required — The text transcription of the audio clip
        - `timestamp` integer, nullable — The timestamp of the keyframe in the video in milliseconds
        - `moderation_score` number, double, nullable — The moderation score of the image
        - `keyframe_is_v1` boolean — Whether the keyframe is from the v1 video data model

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/coactive/apis/api-reference.md) · [All operations](https://skmtc.dev/coactive/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/coactive/api-reference/revisions/1223758be9ba/schema)
