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

# Get sync points for a track

> Sync points for one track against a video you own, no match required. Pass a
`track_id` (from a match, or one you picked yourself). Returns labeled offsets, best
first: where to start the track under the top of your clip.

The `200` is served from cache only. It needs either stored alignment points for this
exact `(video_id, track_id)` pair, or both profiles cached: the video's, built at
ingest, and the track's, built the first time that track is indexed. Otherwise you get
a `202` with a `job_id`, so poll `GET /v1/align/jobs/{job_id}`. `cached` on the response
tells you which rate you paid.

A video that is still ingesting answers `202` with no `job_id`.




## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/align
openapi: 3.1.0
info:
  title: Cue API
  version: 1.0.0
  description: >
    Match licensed music to a video, or to a script. Five things it does:
    **match** music to

    an analyzed video, **underscore** a text script with no video at all,
    **sync** a track to

    the moments in a clip, **loop** a short track across a long one, and map a
    track's

    **beats** and downbeats. Videos are ingested once and reused by match, sync
    and loop;

    underscore and beats take no video at all.


    Responses carry timings and catalog identifiers, not recordings. You resolve
    a track through

    your own catalog access and render it yourself.


    Work that is already cached answers `200`. Work that needs a first-time
    build answers `202`,

    in one of two shapes: a JOB (`job_id` plus a job URL) or a VIDEO STILL
    INGESTING (`video_id`

    and a `/v1/videos/{id}` URL, with no `job_id`). Branch on whether `job_id`
    is present.


    All requests authenticate with an API key, sent either as `Authorization:
    Bearer vbsk_...`

    or in an `x-api-key` header. Both work. Keys are created in the

    [developer portal](https://cue.vibeset.ai/developer).
servers:
  - url: https://cue.vibeset.ai
    description: Production
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Match
    description: Match music to a video.
  - name: Underscore
    description: Match music to a script, no video needed.
  - name: Sync
    description: Get sync points, where a track lands with a video.
  - name: Loop
    description: Loop a short track seamlessly across a long video.
  - name: Beats
    description: Map the beat and downbeat grid of any audio you can point us at.
  - name: Videos
    description: Ingest and check the status of videos.
paths:
  /v1/align:
    post:
      tags:
        - Sync
      summary: Get sync points for a track
      description: >
        Sync points for one track against a video you own, no match required.
        Pass a

        `track_id` (from a match, or one you picked yourself). Returns labeled
        offsets, best

        first: where to start the track under the top of your clip.


        The `200` is served from cache only. It needs either stored alignment
        points for this

        exact `(video_id, track_id)` pair, or both profiles cached: the video's,
        built at

        ingest, and the track's, built the first time that track is indexed.
        Otherwise you get

        a `202` with a `job_id`, so poll `GET /v1/align/jobs/{job_id}`. `cached`
        on the response

        tells you which rate you paid.


        A video that is still ingesting answers `202` with no `job_id`.
      operationId: alignTrack
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: >
            Suppresses a DUPLICATE BILLING ROW for a retry of this exact
            request. It does not

            return the earlier response and does not stop the alignment
            re-running.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlignRequest'
            example:
              video_id: 69e5a58e73370adad5a10dc9
              track_id: '14792'
              top_k: 6
      responses:
        '200':
          description: Sync points for the track, best first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlignResult'
        '202':
          description: >
            Either a cold-align job (`job_id` present) or a video still
            ingesting (`job_id`

            absent). Poll `poll` either way.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/AlignJob'
                  - $ref: '#/components/schemas/VideoJob'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    AlignRequest:
      type: object
      required:
        - video_id
        - track_id
      properties:
        video_id:
          type: string
          maxLength: 128
          description: A video you own (or a shared/seed clip).
        track_id:
          type: string
          maxLength: 128
          description: >-
            The track to align, the Soundstripe song id, as returned by
            `/v1/match`.
        top_k:
          type: integer
          minimum: 1
          maximum: 50
          default: 12
          description: How many sync points to return.
        auto_mix:
          type: boolean
          default: false
          description: >-
            When true, also return a `mix` block: if the video has a voiceover,
            how to duck the music under it (see the `Mix` schema). Off ⇒ no
            `mix` key in the response.
    AlignResult:
      type: object
      properties:
        video_id:
          type: string
        track_id:
          type: string
        cached:
          type: boolean
          description: True when this pairing was served warm (billed at the lower rate).
        sync_points:
          type: array
          items:
            $ref: '#/components/schemas/SyncPoint'
        mix:
          oneOf:
            - $ref: '#/components/schemas/Mix'
            - type: 'null'
          description: >
            Present only when `auto_mix` was true. Null when the measurement
            could not be read. Auto-mix never fails the align call.
      example:
        video_id: 69e5a58e73370adad5a10dc9
        track_id: '14792'
        cached: true
        sync_points:
          - offset_seconds: 12.03
            score: 0.91
            label: Drop
          - offset_seconds: 27.44
            score: 0.74
            label: Downbeat
    AlignJob:
      type: object
      description: >-
        A cold alignment running as a job. Poll `poll` until `status` is
        `complete`.
      properties:
        video_id:
          type: string
        track_id:
          type: string
          description: Present on the submit response.
        job_id:
          type: string
        status:
          type: string
          example: processing
        poll:
          type: string
          example: /v1/align/jobs/run_9f2c
        next:
          type: string
    VideoJob:
      type: object
      description: >-
        A video being ingested. Carries NO `job_id`. Poll `poll` until the video
        is `ready`, then call the endpoint you wanted again.
      properties:
        video_id:
          type: string
        status:
          type: string
          example: processing
        poll:
          type: string
          description: Path to poll, always `/v1/videos/{video_id}`.
        next:
          type: string
          description: >-
            What to do once the video is ready. Present on the `/v1/match`
            `video_url` branch; `POST /v1/videos` returns `video_id`, `status`
            and `poll` only.
      example:
        video_id: 69e5a58e73370adad5a10dc9
        status: processing
        poll: /v1/videos/69e5a58e73370adad5a10dc9
    SyncPoint:
      type: object
      description: A moment where the music lands with the video.
      properties:
        offset_seconds:
          type: number
          description: Seconds into the song that sits under the start of the video.
        score:
          type: number
          description: Strength of the hit, 0–1.
        label:
          type:
            - string
            - 'null'
          description: >
            What lands here, e.g. "Drop", "Phrase", "Downbeat". Null on a track
            that could only be aligned by energy, and an empty string for a
            mid-song beat-sync point.
    Mix:
      type: object
      description: >-
        Auto-mix (duck-the-music-under-the-voiceover) spec, returned when
        `auto_mix` is true. These are the same numbers the Cue app's Loop/Sync
        preview + export use, so a render with them matches the app. Applicable
        to whatever music you lay under the clip.
      properties:
        voiceover:
          type: boolean
          description: >-
            True when the video has a sustained, measured voiceover to duck
            under.
        classification:
          type: string
          description: >-
            The video's own audio, classified, `voice` / `ambient` / `silent` /
            `none`.
        music_gain_db:
          type: number
          description: >-
            Suggested gain (dB) to sit the music under the voice. Present only
            when `voiceover` is true.
        video_gain_db:
          type: number
          description: >-
            Suggested gain (dB) to bring the footage voice up. Present only when
            `voiceover` is true.
        duck:
          type:
            - object
            - 'null'
          description: >-
            How to duck the music during speech. Null when there's no voiceover.
            Apply in this order: footage audio at `video_gain_db`, then music at
            `music_gain_db`, then `envelope_points` as further attenuation on
            the music only, then sum and limit.
          properties:
            envelope_points:
              type: array
              description: >-
                THE AUTHORITATIVE CURVE: `[[t_seconds, gain_db], ...]`, the same
                automation Cue's own renderer replays. Each `gain_db` is a
                POSITIVE amount to pull the music DOWN at that instant: `0` is
                untouched, `20` is 20 dB below where `music_gain_db` left it.
                INTERPOLATE LINEARLY between points. That reproduces the curve
                exactly. Points are emitted only where the curve moves, so held
                passages cost nothing.
              items:
                type: array
                items:
                  type: number
            envelope_hz:
              type: integer
              description: >-
                The grid the points were sampled on (the curve's resolution, not
                its length). You do not need it to render, because the points
                carry their own timestamps.
            speech_ranges:
              type: array
              description: >-
                Voiceover spans `[start, end]` in seconds where the music should
                duck.
              items:
                type: array
                items:
                  type: number
            depth_db:
              type: number
              description: >-
                NOMINAL full-depth excursion, as a POSITIVE magnitude in dB.
                Ramp lengths are computed per gap, so this describes a
                full-depth move and nothing else. A short pause gets a
                shallower, faster one. Rendering from this instead of
                `envelope_points` gives an audibly cruder mix than Cue's.
            attack_ms:
              type: integer
              description: >-
                NOMINAL fade-down time entering a speech span, in ms. See
                `depth_db`.
            release_ms:
              type: integer
              description: >-
                NOMINAL fade-up time leaving a speech span, in ms. See
                `depth_db`.
      example:
        voiceover: true
        classification: voice
        music_gain_db: -4.4
        video_gain_db: 11.4
        duck:
          envelope_points:
            - - 0
              - 20
            - - 1.2
              - 20
            - - 1.9
              - 0
            - - 4.8
              - 0
          envelope_hz: 40
          speech_ranges:
            - - 1.2
              - 4.8
            - - 9.5
              - 14.1
          depth_db: 20
          attack_ms: 375
          release_ms: 1425
    Error:
      type: object
      description: Every `/v1` error body has this shape.
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request
                - authentication_error
                - payment_required
                - forbidden
                - not_found
                - conflict
                - payload_too_large
                - unsupported_media_type
                - rate_limited
                - internal_error
                - upstream_error
                - service_unavailable
                - error
              description: >-
                A stable machine-readable type. Branch on this, not on the
                message.
            message:
              type: string
              description: A human-readable explanation of what went wrong.
            request_id:
              type:
                - string
                - 'null'
              description: >-
                The same value as the `X-Request-Id` response header. Quote it
                to support.
            details:
              type: array
              description: >-
                Present only on a request-validation `422`, listing which fields
                were invalid.
              items:
                type: object
      example:
        error:
          type: invalid_request
          message: Provide either 'video_id' or 'video_url'.
          request_id: a1b2c3d4e5f6
  responses:
    BadRequest:
      description: The request was malformed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: The key is missing, invalid, expired or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentRequired:
      description: >
        No active payment method, the credit grant is exhausted or expired, or
        the monthly

        spend cap was reached. `error.message` names which.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        The key can't access this resource, the video or job belongs to another
        account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: No such video or job.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnprocessableEntity:
      description: >
        A field is invalid (then `error.details` lists which), or the video
        failed to process

        and should be re-submitted.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Too many requests. See the `Retry-After` header.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests allowed per minute.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests remaining in the current window.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your API key as a Bearer token, e.g. `Authorization: Bearer
        vbsk_live_...`
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Your API key in the x-api-key header, e.g. `x-api-key: vbsk_live_...`'

````