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

# Cook Job from Recipe



## OpenAPI

````yaml https://api.dispersed.com/openapi.json post /v1/job-recipes/{uuid}/cook
openapi: 3.1.0
info:
  title: Dispersed API
  version: 1.0.0
servers:
  - url: https://api.dispersed.com
security: []
paths:
  /v1/job-recipes/{uuid}/cook:
    post:
      tags:
        - Job Recipes
      summary: Cook Job from Recipe
      parameters:
        - schema:
            type: string
          required: true
          name: uuid
          in: path
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CookJobRecipeRequest'
      responses:
        '201':
          description: Job created from recipe successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CookJobRecipeRequest:
      type: object
      properties:
        title:
          type: string
          description: Override the job title from the recipe.
        description:
          type:
            - string
            - 'null'
          description: Override the job description from the recipe.
        task:
          type: string
          enum:
            - BATCH
            - PERSISTENT
          description: >-
            Override the task type. BATCH jobs run to completion; PERSISTENT
            jobs run indefinitely.
        cpu_count:
          type: number
          minimum: 0
          description: Override the number of CPU cores required.
        gpu_count:
          type: number
          minimum: 0
          description: Override the number of GPUs required.
        gpu_name:
          type:
            - string
            - 'null'
          description: >-
            Override the GPU name requirement. Cannot be used with
            gpu_registry_uuid.
        gpu_registry_uuid:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            Override with a specific GPU registry UUID for precise matching.
            Cannot be used with gpu_name.
        min_vram_gb:
          type: number
          minimum: 0
          description: Override the minimum VRAM in GB.
        min_ram_gb:
          type: number
          minimum: 0
          description: Override the minimum RAM in GB.
        min_storage_gb:
          type: number
          minimum: 0
          description: Override the minimum storage in GB.
        max_node_count:
          type: number
          exclusiveMinimum: 0
          description: Override the maximum number of nodes.
        max_retry_count:
          type: number
          minimum: 0
          description: Override the maximum retry count.
        max_timeout_assign_ms:
          type: number
          minimum: 300000
          description: Override the assignment timeout in milliseconds.
        max_timeout_start_ms:
          type: number
          minimum: 120000
          description: Override the start timeout in milliseconds.
        max_timeout_run_ms:
          type:
            - number
            - 'null'
          minimum: 60000
          description: >-
            Override the run timeout in milliseconds. Required for BATCH tasks,
            must be null for PERSISTENT tasks.
        parameters:
          $ref: '#/components/schemas/CookParametersOverride'
        target_node_uuid:
          type:
            - string
            - 'null'
          format: uuid
          description: ADMIN-only. Restrict this cooked Job to the Node with this UUID.
          example: 01234567-89ab-cdef-0123-456789abcdef
        allowed_region_codes:
          type: array
          items:
            type: string
            enum:
              - ca-central-1
              - ca-west-1
              - mx-central-1
              - sa-east-1
              - us-east-1
              - us-east-2
              - us-west-1
              - us-west-2
              - eu-central-1
              - eu-central-2
              - eu-north-1
              - eu-south-1
              - eu-south-2
              - eu-west-1
              - eu-west-2
              - eu-west-3
              - ap-east-1
              - ap-east-2
              - ap-northeast-1
              - ap-northeast-2
              - ap-northeast-3
              - ap-south-1
              - ap-south-2
              - ap-southeast-1
              - ap-southeast-2
              - ap-southeast-3
              - ap-southeast-4
              - ap-southeast-5
              - ap-southeast-6
              - ap-southeast-7
              - cn-north-1
              - cn-northwest-1
              - af-south-1
              - il-central-1
              - me-central-1
              - me-south-1
          maxItems: 36
          description: Override the recipe`s allowed_region_codes for this cooked Job.
    JobResponse:
      type: object
      properties:
        uuid:
          type:
            - string
            - 'null'
        object:
          type: string
          enum:
            - job
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        status:
          type: string
          enum:
            - PENDING
            - ASSIGNED
            - RUNNING
            - COMPLETED
            - CANCELLED
            - FAILED
        task:
          type: string
          enum:
            - BATCH
            - PERSISTENT
        started_at:
          type:
            - string
            - 'null'
          format: date-time
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
        title:
          type: string
        description:
          type:
            - string
            - 'null'
        cpu_count:
          type:
            - number
            - 'null'
        gpu_count:
          type:
            - number
            - 'null'
        gpu_name:
          type:
            - string
            - 'null'
        gpu_registry_uuid:
          type:
            - string
            - 'null'
        min_ram_gb:
          type: number
        min_vram_gb:
          type: number
        min_storage_gb:
          type: number
        max_timeout_assign_ms:
          type:
            - number
            - 'null'
        max_timeout_run_ms:
          type:
            - number
            - 'null'
        max_timeout_start_ms:
          type:
            - number
            - 'null'
        max_retry_count:
          type:
            - number
            - 'null'
        max_node_count:
          type:
            - number
            - 'null'
        image_size_bytes:
          type:
            - number
            - 'null'
        allowed_region_codes:
          type: array
          items:
            $ref: '#/components/schemas/RegionCode'
          default: []
        parameters:
          type: object
          properties:
            parameters:
              type: object
              properties:
                allowed_ips:
                  type: array
                  items:
                    type: string
                  description: >-
                    Array of IPs allowed to access the container (if any).
                    Accepts comma-separated string or array. If not specified,
                    the container is accessible from any IP address.
                env:
                  type: object
                  additionalProperties:
                    type: string
                  description: Key-value pairs for container environment variables.
                host:
                  type: string
                  description: >-
                    Custom registry host. If not specified, the default Docker
                    Hub registry is used. Only applicable when using `image`.
                image:
                  type: string
                  minLength: 1
                  description: >-
                    The Docker image to use for the container (e.g., "nginx",
                    "myregistry/myimage"). Mutually exclusive with `imagesrc` -
                    provide one or the other.
                imagesrc:
                  type: string
                  format: uri
                  description: >-
                    Signed HTTPS URL to download a Docker Image Archive (.tar
                    file). Mutually exclusive with `image` - provide one or the
                    other. When using imagesrc, `tag` is not applicable.
                ports:
                  type: array
                  items:
                    type: number
                  description: >-
                    Array of ports to expose from the container (if any). If not
                    specified, no ports are exposed.
                secret:
                  type: string
                  description: >-
                    Secret for private registry authentication (if any).
                    Required if the image is hosted on a private registry. Only
                    applicable when using `image`.
                sshkey:
                  type: string
                  description: >-
                    SSH public key to be added to the container for SSH access
                    (if any). This public key will be passed to the container as
                    `SSH_PUBKEY` environment variable. You must configure your
                    container `~/.ssh/authorized_keys` to allow access.
                tag:
                  type: string
                  description: >-
                    The tag of the Docker image to use. If not specified,
                    defaults to "latest" on creation. Only applicable when using
                    `image`, not `imagesrc`.
                user:
                  type: string
                  description: >-
                    Username for private registry authentication (if any).
                    Required if the image is hosted on a private registry. Only
                    applicable when using `image`.
                volumes:
                  type: array
                  items:
                    type: object
                    properties:
                      image:
                        type: string
                      mount:
                        type: string
                      registry:
                        type: string
                      secret:
                        type: string
                      tag:
                        type: string
                      user:
                        type: string
                  description: >-
                    Array of volume definitions to mount into the container (if
                    any). Each volume can optionally specify an image, mount
                    point, registry, tag, user, and secret for private registry
                    authentication.
            type:
              type: string
              enum:
                - docker
          required:
            - parameters
            - type
        container_access_tokens:
          type: array
          items:
            type: object
            properties:
              label:
                type: string
              token:
                type: string
            required:
              - label
              - token
          default: []
        status_reason:
          type:
            - string
            - 'null'
        source_recipe_uuid:
          type:
            - string
            - 'null'
        timeout_assign_at_ms:
          type:
            - number
            - 'null'
      required:
        - object
        - created_at
        - updated_at
        - status
        - task
        - title
        - cpu_count
        - gpu_count
        - min_ram_gb
        - min_vram_gb
        - min_storage_gb
        - parameters
        - timeout_assign_at_ms
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Error'
      required:
        - error
    CookParametersOverride:
      type: object
      properties:
        parameters:
          type: object
          properties:
            allowed_ips:
              type: array
              items:
                type: string
              description: >-
                Array of IPs allowed to access the container (if any). Accepts
                comma-separated string or array. If not specified, the container
                is accessible from any IP address.
            env:
              type: object
              additionalProperties:
                type: string
              description: Key-value pairs for container environment variables.
            host:
              type: string
              description: >-
                Custom registry host. If not specified, the default Docker Hub
                registry is used. Only applicable when using `image`.
            image:
              type: string
              minLength: 1
              description: >-
                The Docker image to use for the container (e.g., "nginx",
                "myregistry/myimage"). Mutually exclusive with `imagesrc` -
                provide one or the other.
            imagesrc:
              type: string
              format: uri
              description: >-
                Signed HTTPS URL to download a Docker Image Archive (.tar file).
                Mutually exclusive with `image` - provide one or the other. When
                using imagesrc, `tag` is not applicable.
            ports:
              type: array
              items:
                type: number
              description: >-
                Array of ports to expose from the container (if any). If not
                specified, no ports are exposed.
            secret:
              type: string
              description: >-
                Secret for private registry authentication (if any). Required if
                the image is hosted on a private registry. Only applicable when
                using `image`.
            sshkey:
              type: string
              description: >-
                SSH public key to be added to the container for SSH access (if
                any). This public key will be passed to the container as
                `SSH_PUBKEY` environment variable. You must configure your
                container `~/.ssh/authorized_keys` to allow access.
            tag:
              type: string
              description: >-
                The tag of the Docker image to use. If not specified, defaults
                to "latest" on creation. Only applicable when using `image`, not
                `imagesrc`.
            user:
              type: string
              description: >-
                Username for private registry authentication (if any). Required
                if the image is hosted on a private registry. Only applicable
                when using `image`.
            volumes:
              type: array
              items:
                type: object
                properties:
                  image:
                    type: string
                  mount:
                    type: string
                  registry:
                    type: string
                  secret:
                    type: string
                  tag:
                    type: string
                  user:
                    type: string
              description: >-
                Array of volume definitions to mount into the container (if
                any). Each volume can optionally specify an image, mount point,
                registry, tag, user, and secret for private registry
                authentication.
        type:
          type: string
          enum:
            - docker
      description: Override the container/execution parameters.
    RegionCode:
      type:
        - string
        - 'null'
      enum:
        - ca-central-1
        - ca-west-1
        - mx-central-1
        - sa-east-1
        - us-east-1
        - us-east-2
        - us-west-1
        - us-west-2
        - eu-central-1
        - eu-central-2
        - eu-north-1
        - eu-south-1
        - eu-south-2
        - eu-west-1
        - eu-west-2
        - eu-west-3
        - ap-east-1
        - ap-east-2
        - ap-northeast-1
        - ap-northeast-2
        - ap-northeast-3
        - ap-south-1
        - ap-south-2
        - ap-southeast-1
        - ap-southeast-2
        - ap-southeast-3
        - ap-southeast-4
        - ap-southeast-5
        - ap-southeast-6
        - ap-southeast-7
        - cn-north-1
        - cn-northwest-1
        - af-south-1
        - il-central-1
        - me-central-1
        - me-south-1
        - null
      default: null
      description: Coarse geographic-network region identifier (AWS-style naming).
      example: us-west-2
    Error:
      type: object
      properties:
        code:
          type: string
        details:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              expected:
                type: string
              input:
                type: string
              keys:
                type: array
                items:
                  type: string
              message:
                type: string
              path:
                type: array
                items:
                  anyOf:
                    - type: string
                    - type: number
            required:
              - message
              - path
          default: []
        message:
          type: string
        status:
          type: number
        timestamp:
          type: string
      required:
        - code
        - message
        - status
        - timestamp

````