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

# Create Model

> Create Model



## OpenAPI

````yaml /api-reference/openapi.json post /models
openapi: 3.1.0
info:
  title: Cradl API
  version: '2026-01-28T09:00:46Z'
servers:
  - url: https://api.cradl.ai/{basePath}
    variables:
      basePath:
        default: v1
security: []
paths:
  /models:
    post:
      parameters:
        - in: header
          name: Content-Type
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostModels'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Model'
          description: 200 response
          headers:
            Access-Control-Allow-Headers:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 400 response
          headers:
            Access-Control-Allow-Headers:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 403 response
          headers:
            Access-Control-Allow-Headers:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 404 response
          headers:
            Access-Control-Allow-Headers:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
        '415':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 415 response
          headers:
            Access-Control-Allow-Headers:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: 500 response
          headers:
            Access-Control-Allow-Headers:
              schema:
                type: string
            Access-Control-Allow-Origin:
              schema:
                type: string
      security:
        - OAuth2:
            - models:write
components:
  schemas:
    PostModels:
      title: POST /models
      required:
        - fieldConfig
      type: object
      properties:
        metadata:
          type: object
        confidenceVersion:
          type: string
          enum:
            - v1
            - v2
        llmVersion:
          type: string
          enum:
            - sonnet-4.0
            - sonnet-4.5
            - qwen3-vl
        preprocessConfig:
          minProperties: 1
          type: object
          properties:
            trimMargins:
              type: boolean
            useGhostScript:
              type: boolean
            startPage:
              type: integer
            pages:
              maxItems: 100
              type: array
              items:
                type: integer
            usePoppler:
              type: boolean
            padToFit:
              type: boolean
            useTextDetection:
              type: boolean
            maxPages:
              maximum: 100
              minimum: 1
              type: integer
            rotation:
              type: integer
              enum:
                - 0
                - 90
                - 180
                - 270
            deskewImage:
              type: boolean
            autoRotate:
              type: boolean
            imageQuality:
              type: string
              enum:
                - LOW
                - HIGH
          additionalProperties: false
        postprocessConfig:
          oneOf:
            - required:
                - strategy
              type: object
              properties:
                strategy:
                  type: string
                  enum:
                    - BEST_FIRST
                outputFormat:
                  type: string
                  enum:
                    - v1
                    - v2
              additionalProperties: false
            - required:
                - parameters
                - strategy
              type: object
              properties:
                strategy:
                  type: string
                  enum:
                    - BEST_N_PAGES
                outputFormat:
                  type: string
                  enum:
                    - v1
                    - v2
                parameters:
                  required:
                    - 'n'
                  type: object
                  properties:
                    'n':
                      maximum: 100
                      minimum: 1
                      type: integer
                    collapse:
                      type: boolean
              additionalProperties: false
        name:
          maxLength: 4096
          type: string
          nullable: true
        description:
          maxLength: 4096
          type: string
          nullable: true
        fieldConfig:
          type: object
          additionalProperties: false
          patternProperties:
            ^[0-9A-Za-z-_]{1,36}$:
              oneOf:
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - amount
                        - date
                        - digits
                        - enum
                        - multi-value
                        - numeric
                        - single-value
                        - string
                    maxLength:
                      type: integer
                      minimum: 1
                      maximum: 1024
                    enum:
                      maxItems: 500
                      minItems: 1
                      type: array
                      uniqueItems: true
                      items:
                        maxLength: 512
                        minLength: 1
                        type: string
                    description:
                      type: string
                      maxLength: 4096
                      nullable: true
                    order:
                      type: number
                      nullable: true
                    promptHint:
                      type: string
                      maxLength: 4096
                      nullable: true
                    isMultivalue:
                      type: boolean
                    isNullable:
                      type: boolean
                    format:
                      type: string
                      maxLength: 4096
                      nullable: true
                    strict:
                      type: boolean
                  required:
                    - type
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - lines
                        - table
                    fields:
                      type: object
                      additionalProperties: false
                      patternProperties:
                        ^[0-9A-Za-z-_]{1,36}$:
                          type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - amount
                                - date
                                - digits
                                - enum
                                - multi-value
                                - numeric
                                - single-value
                                - string
                            maxLength:
                              type: integer
                              minimum: 1
                              maximum: 1024
                            enum:
                              maxItems: 500
                              minItems: 1
                              type: array
                              uniqueItems: true
                              items:
                                maxLength: 512
                                minLength: 1
                                type: string
                            description:
                              type: string
                              maxLength: 4096
                              nullable: true
                            order:
                              type: number
                              nullable: true
                            promptHint:
                              type: string
                              maxLength: 4096
                              nullable: true
                            isMultivalue:
                              type: boolean
                            isNullable:
                              type: boolean
                            format:
                              type: string
                              maxLength: 4096
                              nullable: true
                            strict:
                              type: boolean
                          required:
                            - type
                  required:
                    - fields
                    - type
      additionalProperties: false
    Model:
      title: model
      required:
        - createdBy
        - createdTime
        - description
        - fieldConfig
        - metadata
        - modelId
        - name
        - numberOfDataBundles
        - numberOfRunningTrainings
        - organizationId
        - preprocessConfig
        - status
        - trainingId
        - updatedBy
        - updatedTime
      type: object
      properties:
        updatedTime:
          pattern: >-
            ^[0-9]{4}-?[0-9]{2}-?[0-9]{2}(
            |T)?[0-9]{2}:?[0-9]{2}:?[0-9]{2}(.[0-9]{1,6})?(Z|[+][0-9]{2}(:|)[0-9]{2})$
          type: string
          nullable: true
        metadata:
          type: object
          nullable: true
        updatedBy:
          maxLength: 4096
          type: string
          nullable: true
        llmVersion:
          type: string
          enum:
            - sonnet-4.0
            - sonnet-4.5
            - qwen3-vl
        trainingId:
          pattern: ^las:model-training:[a-z0-9-_]+$
          type: string
          nullable: true
        modelId:
          pattern: ^(cradl|las):model:[a-z0-9-_]+$
          type: string
        postprocessConfig:
          oneOf:
            - required:
                - strategy
              type: object
              properties:
                strategy:
                  type: string
                  enum:
                    - BEST_FIRST
                outputFormat:
                  type: string
                  enum:
                    - v1
                    - v2
              additionalProperties: false
            - required:
                - parameters
                - strategy
              type: object
              properties:
                strategy:
                  type: string
                  enum:
                    - BEST_N_PAGES
                outputFormat:
                  type: string
                  enum:
                    - v1
                    - v2
                parameters:
                  required:
                    - 'n'
                  type: object
                  properties:
                    'n':
                      maximum: 100
                      minimum: 1
                      type: integer
                    collapse:
                      type: boolean
              additionalProperties: false
        description:
          maxLength: 4096
          type: string
          nullable: true
        fieldConfig:
          type: object
          additionalProperties: false
          patternProperties:
            ^[0-9A-Za-z-_]{1,36}$:
              oneOf:
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - amount
                        - date
                        - digits
                        - enum
                        - multi-value
                        - numeric
                        - single-value
                        - string
                    maxLength:
                      type: integer
                      minimum: 1
                      maximum: 1024
                    enum:
                      maxItems: 500
                      minItems: 1
                      type: array
                      uniqueItems: true
                      items:
                        maxLength: 512
                        minLength: 1
                        type: string
                    description:
                      type: string
                      maxLength: 4096
                      nullable: true
                    order:
                      type: number
                      nullable: true
                    promptHint:
                      type: string
                      maxLength: 4096
                      nullable: true
                    isMultivalue:
                      type: boolean
                    isNullable:
                      type: boolean
                    format:
                      type: string
                      maxLength: 4096
                      nullable: true
                    strict:
                      type: boolean
                  required:
                    - type
                - type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - lines
                        - table
                    fields:
                      type: object
                      additionalProperties: false
                      patternProperties:
                        ^[0-9A-Za-z-_]{1,36}$:
                          type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - amount
                                - date
                                - digits
                                - enum
                                - multi-value
                                - numeric
                                - single-value
                                - string
                            maxLength:
                              type: integer
                              minimum: 1
                              maximum: 1024
                            enum:
                              maxItems: 500
                              minItems: 1
                              type: array
                              uniqueItems: true
                              items:
                                maxLength: 512
                                minLength: 1
                                type: string
                            description:
                              type: string
                              maxLength: 4096
                              nullable: true
                            order:
                              type: number
                              nullable: true
                            promptHint:
                              type: string
                              maxLength: 4096
                              nullable: true
                            isMultivalue:
                              type: boolean
                            isNullable:
                              type: boolean
                            format:
                              type: string
                              maxLength: 4096
                              nullable: true
                            strict:
                              type: boolean
                          required:
                            - type
                  required:
                    - fields
                    - type
          nullable: true
        version:
          minimum: 0
          type: integer
        organizationId:
          pattern: ^(cradl|las):organization:[a-z0-9-_]+$
          type: string
        confidenceVersion:
          type: string
          enum:
            - v1
            - v2
        preprocessConfig:
          minProperties: 1
          type: object
          properties:
            trimMargins:
              type: boolean
            useGhostScript:
              type: boolean
            startPage:
              type: integer
            pages:
              maxItems: 100
              type: array
              items:
                type: integer
            usePoppler:
              type: boolean
            padToFit:
              type: boolean
            useTextDetection:
              type: boolean
            maxPages:
              maximum: 100
              minimum: 1
              type: integer
            rotation:
              type: integer
              enum:
                - 0
                - 90
                - 180
                - 270
            deskewImage:
              type: boolean
            autoRotate:
              type: boolean
            imageQuality:
              type: string
              enum:
                - LOW
                - HIGH
          additionalProperties: false
        createdBy:
          maxLength: 4096
          type: string
        updatedFieldConfigTime:
          pattern: >-
            ^[0-9]{4}-?[0-9]{2}-?[0-9]{2}(
            |T)?[0-9]{2}:?[0-9]{2}:?[0-9]{2}(.[0-9]{1,6})?(Z|[+][0-9]{2}(:|)[0-9]{2})$
          type: string
          nullable: true
        numberOfRunningTrainings:
          minimum: 0
          type: integer
        name:
          maxLength: 4096
          type: string
          nullable: true
        numberOfDataBundles:
          minimum: 0
          type: integer
        createdTime:
          pattern: >-
            ^[0-9]{4}-?[0-9]{2}-?[0-9]{2}(
            |T)?[0-9]{2}:?[0-9]{2}:?[0-9]{2}(.[0-9]{1,6})?(Z|[+][0-9]{2}(:|)[0-9]{2})$
          type: string
        statistics:
          type: object
          nullable: true
        status:
          type: string
          enum:
            - active
            - inactive
      additionalProperties: false
    Error:
      title: Error Schema
      type: object
      properties:
        message:
          type: string
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://auth.cradl.ai/oauth2/token
          scopes:
            actions.runs:read: Read permissions
            actions.runs:write: Write permissions
            actions:read: Read permissions
            actions:write: Write permissions
            agents.runs:read: Read permissions
            agents.runs:write: Write permissions
            agents.statistics:read: Read permissions
            agents:read: Read permissions
            agents:write: Write permissions
            appclients:read: Read permissions
            appclients:write: Write permissions
            documents:read: Read permissions
            documents:write: Write permissions
            hooks.runs:read: Read permissions
            hooks.runs:write: Write permissions
            hooks:read: Read permissions
            hooks:write: Write permissions
            logs:read: Read permissions
            models:read: Read permissions
            models:write: Write permissions
            organizations:read: Read permissions
            organizations:write: Write permissions
            predictions:read: Read permissions
            predictions:write: Write permissions
            users:read: Read permissions
            users:write: Write permissions
            validations.tasks:read: Read permissions
            validations.tasks:write: Write permissions
            validations:read: Read permissions
            validations:write: Write permissions
            workflows:read: Read permissions
            workflows:write: Write permissions

````