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

# Infer (File Upload)

> Upload a CSV file and get results back immediately.

Uses the latest ready model version unless `model_version_id` is specified. Maximum file size is 30 MB.

Set `output_type` to control the response format (`json`, `csv`, or `parquet`). For anomaly models, set `anomaly_format` to `ids_only` (default) or `per_row`.

See [Output Formats](/api-reference/inference#output-formats) for output columns by model type.


## OpenAPI

````yaml /openapi.json post /models/{model_id}/infer
openapi: 3.1.0
info:
  title: Woodwide API
  description: API service for the Woodwide platform
  version: 0.1.0
servers:
  - url: https://api.woodwide.ai
    description: Production
security: []
paths:
  /models/{model_id}/infer:
    post:
      tags:
        - Inference
      summary: Infer (File Upload)
      description: Upload a CSV file and get results back immediately.
      operationId: infer_models__model_id__infer_post
      parameters:
        - name: model_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Model Id
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_infer_models__model_id__infer_post'
            example:
              file: test.csv
              output_type: json
      responses:
        '200':
          description: >-
            Successful Response Output format depends on the `output_type`
            parameter (json, csv, or parquet). See [Output
            Formats](/api-reference/inference#output-formats) for output columns
            by model type.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  When `output_type` is `json`, the response is a JSON object.
                  When `output_type` is `csv` or `parquet`, the response is a
                  file download.
                properties:
                  job_id:
                    type: string
                    format: uuid
                    description: Unique ID for the inference job.
                  status:
                    type: string
                    description: Job status (e.g. `succeeded`).
                  latency_ms:
                    type: integer
                    description: Inference latency in milliseconds.
                  model_id:
                    type: string
                    format: uuid
                    description: ID of the model used.
                  model_version_id:
                    type: string
                    format: uuid
                    description: ID of the model version used.
                  model_type:
                    type: string
                    description: Type of the model (e.g. `prediction`, `clustering`).
                  data:
                    type: object
                    additionalProperties: true
                    description: Inference results. Structure varies by model type.
                  prediction_descriptions:
                    type: object
                    additionalProperties: true
                    description: >-
                      Human-readable descriptions keyed by prediction value
                      (prediction models only).
              example:
                job_id: c3d4e5f6-0000-0000-0000-000000000001
                status: succeeded
                latency_ms: 29567
                model_id: b2c3d4e5-0000-0000-0000-000000000001
                model_version_id: b2c3d4e5-0000-0000-0000-000000000002
                model_type: prediction
                data:
                  id:
                    - 0
                  prediction:
                    - competitor
                  prediction_probs:
                    - 0.9999940395355225
                prediction_descriptions:
                  competitor:
                    summary: Service Recovery and Support Volume
                    description: >-
                      These active accounts are flagged for retention efforts
                      due to elevated support volumes.
        '401':
          description: Unauthorized -- API key is missing or invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: Not authenticated
        '403':
          description: >-
            Forbidden -- your API key does not have permission for this
            resource.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: Forbidden
        '404':
          description: Not Found -- the requested resource does not exist.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: >-
            Too Many Requests -- you have exceeded the rate limit. Heavy
            operations (training, inference, dataset uploads) are limited to 60
            requests per minute per API key. All other endpoints are limited to
            600 requests per minute per API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: Rate limit exceeded. Retry after a short delay.
      security:
        - HTTPBearer: []
components:
  schemas:
    Body_infer_models__model_id__infer_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
          description: 'The file to upload. Maximum file size: 30 MB.'
        model_version_id:
          type: string
          format: uuid
          title: Model Version Id
        output_type:
          $ref: '#/components/schemas/OutputType'
          default: csv
          example: json
        anomaly_format:
          $ref: '#/components/schemas/AnomalyFormat'
          description: >-
            Controls anomaly detection output shape. 'ids_only' returns a list
            of anomalous row indices. 'per_row' returns id, is_anomaly, and
            anomaly_score for every input row. Ignored for non-anomaly model
            types.
          default: ids_only
      type: object
      required:
        - file
      title: Body_infer_models__model_id__infer_post
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
      description: Returned when request parameters or body fail validation.
    OutputType:
      type: string
      enum:
        - json
        - csv
        - parquet
      title: OutputType
      description: Supported inference output formats.
    AnomalyFormat:
      type: string
      enum:
        - ids_only
        - per_row
      title: AnomalyFormat
      description: |-
        Controls anomaly detection output format.

        - ``ids_only`` (default): returns a compact list of anomalous row
          indices.
        - ``per_row``: returns a row for every input instance with
          ``is_anomaly`` (bool) and ``anomaly_score`` (float) columns.
    ValidationError:
      type: object
      required:
        - loc
        - msg
        - type
      properties:
        loc:
          type: array
          items:
            type: string
          title: Location
          description: Path to the field that caused the error.
        msg:
          type: string
          title: Message
          description: Human-readable error message.
        type:
          type: string
          title: Error Type
          description: Machine-readable error type identifier.
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````