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

# Create Twin

> Build a twin from one episode of a Hugging Face LeRobot dataset. Only `source` is required.

The dataset is checked first (the same checks as /v1/twins/validate), so a twin that cannot work is refused
here, for free. Returns 202 with a `queued` twin; a twin takes about 100 minutes. Poll GET /v1/twins/{id},
or subscribe to twin.completed / twin.failed / twin.canceled. Send an `Idempotency-Key` to make retries safe:
a retry with the same key and body returns the same twin, even while the first request is still in flight.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/twins
openapi: 3.1.0
info:
  title: Kite Platform API
  description: >-
    Public API for Kite. Authenticate with `Authorization: Bearer kite_...`, and
    send `Kite-Version: 2026-09-27` to pin the dated contract your code was
    written against (without it you get 2026-09-27). Every response carries the
    version that served it.
  version: '2026-09-27'
servers:
  - url: https://api.kiteml.com
    description: Kite Platform API
security:
  - bearerAuth: []
tags:
  - name: Augmentations
    description: Generate new episodes from a LeRobot dataset.
  - name: Training runs
    description: Fine-tune a policy on a dataset, one run per policy.
  - name: Twins
    description: Rebuild a robot episode as an interactable MuJoCo scene (private beta).
  - name: Catalog
    description: Policies, hardware tiers, and dataset inspection.
  - name: Operations
    description: Poll any run by its id.
  - name: Webhooks
    description: Endpoints that receive events, and the event log.
  - name: API keys
    description: The key making the request.
  - name: Usage
    description: Token usage and credit balance.
paths:
  /v1/twins:
    post:
      tags:
        - Twins
      summary: Create Twin
      description: >-
        Build a twin from one episode of a Hugging Face LeRobot dataset. Only
        `source` is required.


        The dataset is checked first (the same checks as /v1/twins/validate), so
        a twin that cannot work is refused

        here, for free. Returns 202 with a `queued` twin; a twin takes about 100
        minutes. Poll GET /v1/twins/{id},

        or subscribe to twin.completed / twin.failed / twin.canceled. Send an
        `Idempotency-Key` to make retries safe:

        a retry with the same key and body returns the same twin, even while the
        first request is still in flight.
      operationId: create_twin_v1_twins_post
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 255
              - type: 'null'
            title: Idempotency-Key
        - $ref: '#/components/parameters/KiteVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TwinCreate'
      responses:
        '202':
          description: The twin, queued
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Twin'
        '400':
          description: >-
            Invalid request (`parameter_invalid`, `unsupported_version`, ...);
            `param` names the field
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: Missing or invalid API key (`unauthenticated`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '403':
          description: >-
            The key lacks a scope this route needs (`missing_scope`), or the
            feature is not enabled for the account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
          description: >-
            Conflicts with the resource's state or an earlier request (e.g.
            `not_cancelable`, `idempotency_key_reused`)
        '429':
          description: >-
            Rate or concurrency limited (`rate_limit_exceeded`,
            `concurrency_limit_exceeded`, `capacity_exceeded`); honor
            `Retry-After`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
          description: >-
            An upstream service failed (e.g. `launch_failed`); the request is
            safe to retry
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
          description: >-
            Temporarily unavailable (`service_unavailable`); retry after
            `Retry-After`
components:
  parameters:
    KiteVersion:
      name: Kite-Version
      in: header
      required: false
      description: >-
        The dated contract your code was written against. Without it you get
        2026-09-27; every response says which version served it.
      schema:
        type: string
        enum:
          - '2026-09-27'
        default: '2026-09-27'
  schemas:
    TwinCreate:
      properties:
        source:
          $ref: '#/components/schemas/TwinSource'
        name:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Name
          description: A short name for the twin
        task:
          anyOf:
            - type: string
              maxLength: 4000
            - type: 'null'
          title: Task
          description: >-
            Which objects to author: the ones the robot manipulates. Defaults to
            a general manipulation brief
        prompt:
          anyOf:
            - type: string
              maxLength: 4000
            - type: 'null'
          title: Prompt
          description: How to describe the room to the reconstructor
        camera:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Camera
          description: Substring of the camera that seeds the room (see /v1/twins/validate)
        wrist_camera:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Wrist Camera
        ceiling_m:
          type: number
          exclusiveMaximum: 10
          exclusiveMinimum: 1.5
          title: Ceiling M
          description: 'Floor-to-ceiling height: the scale anchor'
          default: 2.9
        webhook_metadata:
          anyOf:
            - type: object
            - type: 'null'
          title: Webhook Metadata
          description: Opaque metadata echoed on the resource and its webhook events
      type: object
      required:
        - source
      title: TwinCreate
      description: >-
        Build a digital twin from one episode of a Hugging Face LeRobot dataset.
        Only `source` is required.
      examples:
        - source:
            repo_id: lerobot/svla_so101_pickplace
            type: huggingface
    Twin:
      properties:
        id:
          type: string
          title: Id
          description: '`twin_` + a time-ordered ULID'
        object:
          type: string
          enum:
            - twin
          const: twin
          title: Object
          default: twin
        status:
          type: string
          enum:
            - queued
            - processing
            - canceling
            - succeeded
            - failed
            - canceled
          title: Status
        progress:
          type: number
          maximum: 1
          minimum: 0
          title: Progress
        stage:
          anyOf:
            - type: string
            - type: 'null'
          title: Stage
          description: The stage running now
        status_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Message
        eta_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Eta Seconds
          description: >-
            While queued or processing: time left, from the stages' typical
            durations
        error:
          anyOf:
            - $ref: '#/components/schemas/TwinError'
            - type: 'null'
        source:
          $ref: '#/components/schemas/TwinSource'
        camera:
          anyOf:
            - $ref: '#/components/schemas/TwinCamera'
            - type: 'null'
          description: What the dataset check resolved
        config:
          type: object
          title: Config
          description: The build options given at create
        stages:
          items:
            $ref: '#/components/schemas/TwinStage'
          type: array
          title: Stages
          description: Every finished stage, in order
        download:
          anyOf:
            - $ref: '#/components/schemas/TwinDownload'
            - type: 'null'
          description: >-
            Once `succeeded`: the whole scene as one .tar.gz. Its file list is
            GET /v1/twins/{id}/files
        webhook_metadata:
          anyOf:
            - type: object
            - type: 'null'
          title: Webhook Metadata
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
      type: object
      required:
        - id
        - status
        - progress
        - source
      title: Twin
      description: One digital twin.
    ApiErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ApiErrorBody'
      type: object
      required:
        - error
      title: ApiErrorResponse
      description: Every /v1 error has this shape.
    TwinSource:
      properties:
        type:
          type: string
          enum:
            - huggingface
          const: huggingface
          title: Type
          default: huggingface
        repo_id:
          type: string
          maxLength: 500
          minLength: 3
          title: Repo Id
          description: HF dataset id, e.g. 'lerobot/pusht'
      type: object
      required:
        - repo_id
      title: TwinSource
      description: >-
        Where the episode comes from. The same shape as an augmentation's
        `source`.
    TwinError:
      properties:
        code:
          type: string
          title: Code
          description: >-
            `stage_failed` (a stage's measurement failed its review) or
            `interrupted` (the build stopped before finishing)
        message:
          type: string
          title: Message
        stage:
          anyOf:
            - type: string
            - type: 'null'
          title: Stage
          description: The stage it stopped in
        resumable:
          type: boolean
          title: Resumable
          description: POST /v1/twins/{id}/resume continues from the stages already done
      type: object
      required:
        - code
        - message
        - resumable
      title: TwinError
    TwinCamera:
      properties:
        scene:
          anyOf:
            - type: string
            - type: 'null'
          title: Scene
          description: The camera that seeds the room
        wrist:
          anyOf:
            - type: string
            - type: 'null'
          title: Wrist
          description: The wrist camera used for close-ups, if any
        available:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Available
          description: Every camera the dataset has
      type: object
      title: TwinCamera
    TwinStage:
      properties:
        stage:
          type: string
          title: Stage
          description: >-
            ingest, environment, decompose, label, author, refine, assemble,
            dynamics, or publish
        ok:
          type: boolean
          title: Ok
        attempts:
          anyOf:
            - type: integer
            - type: 'null'
          title: Attempts
        seconds:
          anyOf:
            - type: number
            - type: 'null'
          title: Seconds
        measurement:
          anyOf:
            - type: string
            - type: 'null'
          title: Measurement
          description: What the stage measured about its own output
      type: object
      required:
        - stage
        - ok
      title: TwinStage
    TwinDownload:
      properties:
        url:
          type: string
          title: Url
          description: >-
            A signed link straight to the archive (no credentials; valid until
            `expires_at`), or this API's own archive path when `requires_auth`
        requires_auth:
          type: boolean
          title: Requires Auth
          description: Send your Authorization header to `url` (it is then an API path)
        expires_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Expires At
          description: >-
            When a signed `url` stops working; GET the twin again for a fresh
            one
        filename:
          type: string
          title: Filename
          description: '`<twin id>.tar.gz`'
        bytes:
          type: integer
          title: Bytes
        sha256:
          type: string
          title: Sha256
          description: Check the downloaded file against it
        scene:
          type: string
          title: Scene
          description: 'The scene inside the archive: `<twin id>/scene.xml`'
      type: object
      required:
        - url
        - requires_auth
        - filename
        - bytes
        - sha256
        - scene
      title: TwinDownload
    ApiErrorBody:
      properties:
        type:
          type: string
          title: Type
          description: >-
            invalid_request_error, authentication_error, permission_error,
            not_found_error, conflict_error, rate_limit_error, or api_error
        code:
          type: string
          title: Code
          description: 'Machine-readable: branch on this, not on the message'
        message:
          type: string
          title: Message
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
          description: The request field the error is about, when there is one
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
          description: Also in the X-Request-Id header; quote it to support
        details:
          anyOf:
            - type: object
            - type: 'null'
          title: Details
          description: >-
            Extra data for some codes (e.g. the cameras a dataset does have, for
            camera_not_found)
      type: object
      required:
        - type
        - code
        - message
      title: ApiErrorBody
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A Kite API key (`kite_...`), from **Platform API → Keys** in the
        dashboard.

````