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

# Validate container config

> Checks a release's tinfoil-config.yml, release workflow, and account limits. Problems are reported in the body, not as an error status.



## OpenAPI

````yaml https://api.tinfoil.sh/openapi.yaml post /api/containers/validate
openapi: 3.2.0
info:
  title: Tinfoil Controlplane API
  version: 0.1.0
  description: >-
    Manage inference API keys, read usage and invoices, and manage Tinfoil
    confidential containers, their configuration, and the organization resources
    they use. Authenticate with an admin API key sent as a bearer token.
servers:
  - url: https://api.tinfoil.sh
security:
  - apiKey: []
tags:
  - name: Account
    description: >-
      The identity and organization behind the API key, and the token usage and
      invoices of the personal account or organization.
  - name: API keys
    parent: Account
    description: Inference API keys of the personal account or organization.
  - name: Containers
    description: Create, deploy, and stop confidential containers.
  - name: Container updates
    description: >-
      Move a container to a new release, and promote or cancel an update that is
      held for review.
  - name: Projects
    description: Groups of containers deployed from the same config source.
  - name: Volumes
    description: Encrypted persistent volumes that attach to containers.
  - name: Secrets
    description: >-
      Organization secrets available to containers, and secrets scoped to a
      single GitHub repository.
  - name: Access
    description: >-
      SSH public keys for attested SSH access to containers, custom domains that
      route to containers, and credentials for pulling images from private
      registries. An organization can store one ecr and one custom registry
      connection, each identified by its hostname.
  - name: GitHub & models
    description: >-
      Repository config and image builds through the Tinfoil GitHub app, and
      packaging Hugging Face models for use in containers. Packaging models
      requires a GPU entitlement or model access for the organization.
  - name: Config registry
    description: >-
      Publish tinfoil-config.yml revisions, read published configs, and resolve
      the endorsements that let clients verify them.
  - name: Bunkers
    description: Bunker owner keys and owner attestation.
paths:
  /api/containers/validate:
    post:
      tags:
        - Containers
      summary: Validate container config
      description: >-
        Checks a release's tinfoil-config.yml, release workflow, and account
        limits. Problems are reported in the body, not as an error status.
      operationId: validateContainerConfig
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContainerValidateRequest'
      responses:
        '200':
          description: Validation result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContainerValidationResult'
        '400':
          $ref: '#/components/responses/Error'
          description: Invalid request
        '401':
          $ref: '#/components/responses/Error'
          description: Missing or invalid credentials
        '403':
          $ref: '#/components/responses/Error'
          description: Not permitted
        '404':
          $ref: '#/components/responses/Error'
          description: Not found
        '500':
          $ref: '#/components/responses/Error'
          description: Server error
        '503':
          $ref: '#/components/responses/Error'
          description: Temporarily unavailable; retry later
      security:
        - apiKey:
            - containers.validate
components:
  schemas:
    ContainerValidateRequest:
      type: object
      required:
        - repo
        - tag
      properties:
        repo:
          type: string
          description: GitHub owner/repo.
        tag:
          type: string
        instance_name:
          type: string
          description: >-
            Name of the container to be created. Required for keys restricted to
            container names, and both it and repo must match the key's
            restrictions. Ignored when update_container_id or
            replace_container_id is set; authorization then uses that
            container's name.
        update_container_id:
          type: string
          format: uuid
          description: Container being updated; skips the container limit.
        replace_container_id:
          type: string
          format: uuid
          description: Container being replaced; skips the container limit.
    ContainerValidationResult:
      type: object
      required:
        - valid
        - limits
        - current
      properties:
        valid:
          type: boolean
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ContainerValidationIssue'
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/ContainerValidationIssue'
        limits:
          type: object
          required:
            - max_org_instances
            - valid_cpu_values
            - valid_memory_mb
          properties:
            max_org_instances:
              type: integer
            valid_cpu_values:
              type:
                - array
                - 'null'
              items:
                type: integer
            valid_memory_mb:
              type:
                - array
                - 'null'
              items:
                type: integer
        current:
          type: object
          required:
            - total_instances
          properties:
            total_instances:
              type: integer
        config:
          $ref: '#/components/schemas/TinfoilConfig'
        env_vars:
          type: array
          description: Environment variables the config's containers declare.
          items:
            $ref: '#/components/schemas/ConfigEnvVar'
    ContainerValidationIssue:
      type: object
      required:
        - field
        - message
      properties:
        field:
          type: string
        code:
          type: string
          description: >-
            Stable issue code, such as invalid_keyserver_url when keyserver_url
            has invalid syntax.
        message:
          type: string
    TinfoilConfig:
      type: object
      description: Dashboard-editable view of tinfoil-config.yml.
      required:
        - models
        - containers
        - memory
        - cpus
        - gpus
      properties:
        keyserver_url:
          type: string
          description: The config's keyserver-url.
        models:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/TinfoilConfigModel'
        volumes:
          type: array
          items:
            $ref: '#/components/schemas/TinfoilConfigVolume'
        containers:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/TinfoilConfigContainer'
        memory:
          type: integer
        cpus:
          type: integer
          format: int32
        gpus:
          type: integer
          format: int32
        shim:
          $ref: '#/components/schemas/TinfoilConfigShim'
    ConfigEnvVar:
      type: object
      required:
        - key
        - has_value
        - is_secret_ref
      properties:
        key:
          type: string
        value:
          type: string
        has_value:
          type: boolean
        is_secret_ref:
          type: boolean
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message.
        code:
          type: string
          description: Stable machine-readable error code.
      additionalProperties: true
    TinfoilConfigModel:
      type: object
      required:
        - name
        - repo
        - mpk
      properties:
        name:
          type: string
        repo:
          type: string
        mpk:
          type: string
        key_secret:
          type: string
          description: The model's key-secret.
    TinfoilConfigVolume:
      type: object
      required:
        - name
      properties:
        size:
          type: string
        name:
          type: string
        key_secret:
          type: string
          description: The mount's key-secret.
    TinfoilConfigContainer:
      type: object
      required:
        - name
        - image
        - args
        - env
        - secrets
      properties:
        name:
          type: string
        image:
          type: string
        args:
          type:
            - array
            - 'null'
          items:
            type: string
        env:
          type:
            - array
            - 'null'
          description: Environment entries as KEY=value, or KEY alone.
          items:
            type: string
        secrets:
          type:
            - array
            - 'null'
          items:
            type: string
    TinfoilConfigShim:
      type: object
      properties:
        upstream_port:
          type: integer
        tls_wildcard:
          type: boolean
        dummy_attestation:
          type: boolean
          description: The shim's dummy-attestation setting.
  responses:
    Error:
      description: The request failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        An admin API key. Personal admin keys reach the API key, billing and
        Account endpoints for the creator's personal account; the other
        endpoints need an organization admin key. Security requirement entries
        list the permission a scoped key needs for the operation.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.