> ## Documentation Index
> Fetch the complete documentation index at: https://api-reference.scale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Object Index

> [!NOTE]
>
> **[Click for Python SDK](https://docs.nucleus.scale.com/en/latest/api/nucleus/index.html#nucleus.Dataset.create_object_index)**
>
> ```
> Dataset.create_object_index(
>     model_run_id: Optional[str] = None,
>     gt_only: Optional[bool] = None
> ) -> AsyncJob
> ```

This endpoint will create or update an object index for a Dataset, provided that one exists.

This will generate internal embeddings for each object in the dataset that does not already have an associated embedding. These embeddings are used for object Autotag and similarity search.

This endpoint is idempotent. If this endpoint is called again for a model run that has been indexed in the past, the previously indexed predictions will not have new embeddings recomputed. The same is true for ground truth annotations. This means if you update a prediction or ground truth bounding box that already has an associated embedding, the embedding will not be updated, even with another call to this endpoint. To simultaneously update an annotation/prediction and update its embedding, we recommend deleting the prediction or ground truth annotation and re-inserting it.

This endpoint is currently limited to indexing all the objects of a single model run, or all of the ground truth annotations of a dataset. It is also limited to index up to only 3 million objects at a time — if a request is made that exceeds this limit, the job will fail.

This endpoint is currently only enabled for enterprise customers. Please reach out to [nucleus@scale.com](mailto:nucleus@scale.com) if you wish to learn more.


## OpenAPI

````yaml openapi/nucleus.json POST /indexing/{dataset_id}/internal/object
openapi: 3.1.0
info:
  title: Nucleus API
  version: '1.1'
servers:
  - url: https://api.scale.com/v1/nucleus
security:
  - sec0: []
paths:
  /indexing/{dataset_id}/internal/object:
    post:
      summary: Create Object Index
      operationId: create-object-index
      parameters:
        - name: dataset_id
          in: path
          description: The Scale-generated ID of the Dataset.
          schema:
            type: string
          required: true
        - name: ingestGtOnly
          in: header
          description: >-
            Flag to determine whether we are only indexing ground truth
            annotations
          schema:
            type: boolean
            default: false
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                modelRunId:
                  type: string
                  description: >-
                    The Scale-generated ID of the model run we are creating an
                    index over.
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    job_id: job_ffsj9afawlfkd
                    job_last_known_status: Running
                    job_type: ingestTasks
                    job_creation_time: '2021-07-20T18:07:13.055Z'
              schema:
                type: object
                properties:
                  job_id:
                    type: string
                    example: job_ffsj9afawlfkd
                  job_last_known_status:
                    type: string
                    example: Running
                  job_type:
                    type: string
                    example: ingestTasks
                  job_creation_time:
                    type: string
                    example: '2021-07-20T18:07:13.055Z'
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: {}
              schema:
                type: object
                properties: {}
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````