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

# Start analysis

> Upload a video file and start a biomechanical analysis. Returns a unique `video_id`
that you use to poll for results.

**Video requirements:**
- Maximum file size: 30 MB
- Maximum duration: 10 seconds
- Accepted formats: MP4, MOV, AVI, WEBM

See [example videos](/guides/example-videos) for sample input and output recordings.

**Analysis types:**
- `side_view` -- Running gait from the side. Produces biomechanical scores, metrics, joint angles, foot landing, and running style.
- `back_view` -- Running gait from behind. Produces pronation/supination, pelvic drop, knee adduction, and gait cycle data.

**Link to a subject:**
Pass an optional `subject_id` to associate this analysis with a runner profile.
You can then retrieve all analyses for that subject via
`GET /analysis/subjects/{subject_id}`.
See [subject management](/guides/subject-management) for the full workflow.

**Webhooks (optional):** Set `notify_via_webhook=true` to receive progress and completion
events on the HTTPS URL you registered with [`PUT /webhook`](/api-reference/webhooks/configure-webhook).
Defaults to `false`. When `true`, a valid partner webhook must be configured and enabled.
See [API keys and webhooks](/guides/webhooks-and-api-keys) for event types and payload format.

One analysis credit is consumed per request.




## OpenAPI

````yaml /openapi.yaml post /analysis/start
openapi: 3.0.1
info:
  title: Ochy Partner API
  version: 1.0.0
  description: >
    The Ochy Partner API lets you integrate running biomechanical analysis into
    your application.

    Upload a video of a runner, receive detailed biomechanical metrics, joint
    angles, running style

    classification, and frame-by-frame position data.
servers:
  - url: https://partner-api.ochy-prod.com
    description: Production
security:
  - apiKey: []
paths:
  /analysis/start:
    post:
      tags:
        - Analysis
      summary: Start analysis
      description: >
        Upload a video file and start a biomechanical analysis. Returns a unique
        `video_id`

        that you use to poll for results.


        **Video requirements:**

        - Maximum file size: 30 MB

        - Maximum duration: 10 seconds

        - Accepted formats: MP4, MOV, AVI, WEBM


        See [example videos](/guides/example-videos) for sample input and output
        recordings.


        **Analysis types:**

        - `side_view` -- Running gait from the side. Produces biomechanical
        scores, metrics, joint angles, foot landing, and running style.

        - `back_view` -- Running gait from behind. Produces
        pronation/supination, pelvic drop, knee adduction, and gait cycle data.


        **Link to a subject:**

        Pass an optional `subject_id` to associate this analysis with a runner
        profile.

        You can then retrieve all analyses for that subject via

        `GET /analysis/subjects/{subject_id}`.

        See [subject management](/guides/subject-management) for the full
        workflow.


        **Webhooks (optional):** Set `notify_via_webhook=true` to receive
        progress and completion

        events on the HTTPS URL you registered with [`PUT
        /webhook`](/api-reference/webhooks/configure-webhook).

        Defaults to `false`. When `true`, a valid partner webhook must be
        configured and enabled.

        See [API keys and webhooks](/guides/webhooks-and-api-keys) for event
        types and payload format.


        One analysis credit is consumed per request.
      operationId: startAnalysis
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - video
                - analysis_type
              properties:
                video:
                  type: string
                  format: binary
                  description: Video file to analyze (max 30 MB, 10 seconds).
                subject_id:
                  type: string
                  description: >-
                    Optional subject ID to link this analysis to. See [subject
                    management](/guides/subject-management) to create subjects.
                height:
                  type: number
                  description: Runner height in meters.
                  default: 1.7
                  example: 1.75
                weight:
                  type: number
                  description: Runner weight in kilograms.
                  default: 70
                  example: 68
                pace:
                  type: string
                  pattern: ^[0-9]{2}:[0-9]{2}$
                  description: >
                    Running pace in `MM:SS` format. Required when
                    `treadmill=true`.

                    Optional when `treadmill=false` (pace is calculated
                    automatically for overground running).
                  example: '05:30'
                language:
                  type: string
                  enum:
                    - en
                    - fr
                    - de
                    - zh
                    - ko
                    - pt
                    - es
                    - it
                    - ja
                  default: en
                  description: Language for analysis results and recommendations.
                  example: en
                analysis_type:
                  type: string
                  enum:
                    - side_view
                    - back_view
                  default: side_view
                  description: Type of analysis to perform.
                  example: side_view
                treadmill:
                  type: boolean
                  default: false
                  description: >-
                    Whether the runner is on a treadmill (`true`) or running
                    outdoors (`false`).
                  example: false
                full_body:
                  type: boolean
                  default: true
                  description: >
                    Include full body analysis. Only affects `back_view`
                    analysis.

                    When `false`, only pronation/supination analysis is
                    performed.
                  example: true
                notify_via_webhook:
                  type: boolean
                  default: false
                  description: >
                    When `true`, send progress and completion events for this
                    analysis to the

                    partner webhook URL configured via `PUT /webhook`. Requires
                    a valid, enabled

                    webhook. When `false` or omitted, no webhook events are sent
                    for this analysis.
                  example: false
      responses:
        '202':
          description: Analysis started.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalysisStartResponse'
              example:
                message: 'Analysis started for ID: 3dde3402-94d7-462e-a784-9306207108dd'
                video_id: 3dde3402-94d7-462e-a784-9306207108dd
        '400':
          description: >
            Bad request -- invalid parameters, unsupported file type, video too
            long, or

            `notify_via_webhook=true` when no valid webhook is configured.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Video duration (15s) exceeds maximum allowed duration of 10s
        '401':
          description: Missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthErrorResponse'
              example:
                detail: API Key is missing
        '402':
          description: Insufficient credits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Insufficient credits to perform analysis
                code: insufficient_credits
        '403':
          description: Invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthErrorResponse'
              example:
                detail: Invalid API Key
        '413':
          description: File too large (max 30 MB).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileSizeErrorResponse'
              example:
                detail: File size exceeds the maximum allowed limit of 30 MB
                code: file_too_large
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AnalysisStartResponse:
      type: object
      properties:
        message:
          type: string
          example: 'Analysis started for ID: 3dde3402-94d7-462e-a784-9306207108dd'
        video_id:
          type: string
          description: Unique identifier for the analysis. Use this to poll for results.
          example: 3dde3402-94d7-462e-a784-9306207108dd
    ErrorResponse:
      type: object
      properties:
        detail:
          type: string
          example: Internal server error
        code:
          type: string
          description: Machine-readable error code (present on some errors).
          example: insufficient_credits
    AuthErrorResponse:
      type: object
      properties:
        detail:
          type: string
          example: API Key is missing
    FileSizeErrorResponse:
      type: object
      properties:
        detail:
          type: string
          example: File size exceeds the maximum allowed limit of 30 MB
        code:
          type: string
          example: file_too_large
  securitySchemes:
    apiKey:
      type: apiKey
      in: query
      name: apiKey
      description: Your API key, passed as a query parameter on every request.

````