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

# Create the next immutable version of a compute environment.

> Create the next immutable version of a compute environment.. Runs as the token's owner within their role; the portal's own authorization and audit log apply.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/admin/create_compute_environment
openapi: 3.0.3
info:
  title: AI Reserve Gateway API
  description: >-
    The AI Reserve API surface — inference, durable environments, workspaces,
    sandboxes, executions, agent runs, GPU infrastructure, and fine-tuning — all
    behind one endpoint and one API key.
  version: 1.0.0
servers:
  - url: https://api.aireserve.com
security:
  - bearerAuth: []
tags:
  - name: Customers
    description: >-
      Per-end-customer usage, cost, and billable amounts for organizations that
      tag requests with their own customers.
  - name: Dedicated GPU endpoints
    description: >-
      OpenAI-compatible inference on your organization's own dedicated
      HuggingFace vLLM deployments, called with an ordinary AI Reserve API key.
      GPU time is billed from the wallet; requests add no per-token charge.
  - name: GPU Infrastructure
    description: >-
      Provision and manage provider-hidden GPU instances. The recommended
      Instances API accepts workload requirements and an hourly price ceiling;
      AI Reserve handles provider placement internally. Every mutation is
      asynchronous and returns an operation to poll.
  - name: Environments
    description: Immutable, versioned runtime definitions.
  - name: Workspaces
    description: Durable project storage pinned to one environment version.
  - name: Sandboxes
    description: >-
      Ephemeral provider-disclosed compute allocated from sealed quotes.
      Requests remain provider-neutral.
  - name: Executions
    description: Durable asynchronous operations and command, service, or agent executions.
  - name: Agent Runs
    description: Durable Agent SDK runs with replayable events and external artifacts.
  - name: Customer keys
    description: >-
      Mint, list, and revoke API keys pinned to your own end customers (and
      their organizations), so spend splits per customer without per-request
      tagging.
  - name: AWS CLI login
    description: >-
      Browser-authorization endpoints consumed by `aws login --profile …` (AWS
      CLI v2.32.0+). All three routes are unauthenticated — the caller has no
      credential until `/v1/token` succeeds.
  - name: Fine-tuning
    description: >-
      Fine-tune open models on your own data. Data lives in an S3 bucket inside
      your organization's AWS hub account; you name a base, LoRA or full, a
      price ceiling and how the result must be servable, and AI Reserve places
      the run on a backend internally. The result is a model in your bucket you
      can deploy or download.
  - name: 'Admin: Catalog'
    description: Discover the operations available to this token.
  - name: 'Admin: Analytics'
    description: Usage, spend and attribution reads.
  - name: 'Admin: API Keys'
    description: Organization and team inference keys.
  - name: 'Admin: Billing'
    description: Wallet, ledger and invoice reads.
  - name: 'Admin: Compute'
    description: GPU machines and persistent storage (quote, launch, inspect, stop).
  - name: 'Admin: Compute Runtime'
    description: >-
      Portable environments, workspaces, sandboxes, executions, operations and
      durable agent runs.
  - name: 'Admin: Containers'
    description: The organization's AWS account, ECS services, logs and secrets.
  - name: 'Admin: Files'
    description: Organization shared files.
  - name: 'Admin: Members'
    description: 'People in the organization: invite, profile, team, access, role.'
  - name: 'Admin: Models & Routing'
    description: Model availability, defaults, fallbacks and routing.
  - name: 'Admin: Organization'
    description: Retention, logging, branding, sign-in domains, classification.
  - name: 'Admin: Personal'
    description: The caller's own usage, budget, API keys and preferences.
  - name: 'Admin: Teams & Budgets'
    description: Teams, spend caps and allocations.
  - name: 'Admin: Training'
    description: Fine-tuning datasets, runs, models and deployments.
paths:
  /v1/admin/create_compute_environment:
    post:
      tags:
        - 'Admin: Compute Runtime'
      summary: Create the next immutable version of a compute environment.
      description: >-
        Create the next immutable version of a compute environment.. Runs as the
        token's owner within their role; the portal's own authorization and
        audit log apply.
      operationId: create_compute_environment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                key:
                  type: string
                  minLength: 1
                  maxLength: 120
                  pattern: ^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$
                name:
                  type: string
                  minLength: 1
                  maxLength: 255
                description:
                  nullable: true
                  type: string
                  maxLength: 10000
                imageRef:
                  type: string
                  minLength: 1
                  maxLength: 1024
                manifest:
                  type: object
                  properties:
                    architecture:
                      type: string
                      enum:
                        - amd64
                        - arm64
                    workingDirectory:
                      type: string
                      minLength: 1
                      maxLength: 512
                      pattern: ^\/(?:[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*)?$
                    packages:
                      maxItems: 256
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 255
                    features:
                      maxItems: 128
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 120
                        pattern: ^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$
                    environmentKeys:
                      maxItems: 256
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 255
                        pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                      description: >-
                        Environment-variable names only. Values are injected
                        when an execution starts and are never returned.
                    agentHarnesses:
                      maxItems: 32
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            minLength: 1
                            maxLength: 64
                            pattern: ^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$
                          argv:
                            minItems: 1
                            maxItems: 64
                            type: array
                            items:
                              type: string
                              minLength: 1
                              maxLength: 4096
                          workingDirectory:
                            type: string
                            minLength: 1
                            maxLength: 512
                            pattern: ^\/(?:[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*)?$
                          models:
                            minItems: 1
                            maxItems: 128
                            type: array
                            items:
                              type: string
                              minLength: 1
                              maxLength: 255
                          toolNames:
                            maxItems: 256
                            type: array
                            items:
                              type: string
                              minLength: 1
                              maxLength: 255
                          environmentKeys:
                            maxItems: 256
                            type: array
                            items:
                              type: string
                              minLength: 1
                              maxLength: 255
                              pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                        required:
                          - id
                          - argv
                          - models
                          - toolNames
                          - environmentKeys
                        additionalProperties: false
                      description: >-
                        Explicit argv-only agent harness allowlist. Shell
                        command templates are not accepted.
                    networkPolicy:
                      type: object
                      properties:
                        mode:
                          type: string
                          enum:
                            - open
                            - allowlist
                            - none
                        domains:
                          maxItems: 256
                          type: array
                          items:
                            type: string
                            minLength: 1
                            maxLength: 253
                            pattern: >-
                              ^(?:\*\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$
                      required:
                        - mode
                        - domains
                      additionalProperties: false
                    secretReferences:
                      maxItems: 256
                      type: array
                      items:
                        type: object
                        properties:
                          environmentKey:
                            type: string
                            minLength: 1
                            maxLength: 255
                            pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                          secretId:
                            type: string
                            minLength: 1
                            maxLength: 255
                        required:
                          - environmentKey
                          - secretId
                        additionalProperties: false
                      description: >-
                        Reserved for tenant-scoped provider-vault bindings.
                        Current compute providers require this array to be
                        empty.
                  required:
                    - architecture
                    - workingDirectory
                    - packages
                    - features
                    - environmentKeys
                    - agentHarnesses
                    - networkPolicy
                    - secretReferences
                  additionalProperties: false
                clientId:
                  description: >-
                    Required only for a platform operator targeting an
                    organization.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                idempotencyKey:
                  description: Optional stable retry key.
                  type: string
                  minLength: 8
                  maxLength: 180
                  pattern: ^[A-Za-z0-9:_-]+$
              required:
                - key
                - name
                - imageRef
                - manifest
              additionalProperties: false
      responses:
        '200':
          description: 'Executed successfully (`ok: true`).'
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/AdminOutcome'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                            pattern: >-
                              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                          object:
                            type: string
                            enum:
                              - environment
                          key:
                            type: string
                            minLength: 1
                            maxLength: 120
                            pattern: ^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$
                          version:
                            type: integer
                            minimum: 0
                            exclusiveMinimum: true
                            maximum: 9007199254740991
                          name:
                            type: string
                            minLength: 1
                            maxLength: 255
                          description:
                            nullable: true
                            type: string
                            maxLength: 10000
                          imageRef:
                            type: string
                            minLength: 1
                            maxLength: 1024
                          manifest:
                            type: object
                            properties:
                              architecture:
                                type: string
                                enum:
                                  - amd64
                                  - arm64
                              workingDirectory:
                                type: string
                                minLength: 1
                                maxLength: 512
                                pattern: ^\/(?:[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*)?$
                              packages:
                                maxItems: 256
                                type: array
                                items:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                              features:
                                maxItems: 128
                                type: array
                                items:
                                  type: string
                                  minLength: 1
                                  maxLength: 120
                                  pattern: ^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$
                              environmentKeys:
                                maxItems: 256
                                type: array
                                items:
                                  type: string
                                  minLength: 1
                                  maxLength: 255
                                  pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                description: >-
                                  Environment-variable names only. Values are
                                  injected when an execution starts and are
                                  never returned.
                              agentHarnesses:
                                maxItems: 32
                                type: array
                                items:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                      minLength: 1
                                      maxLength: 64
                                      pattern: ^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$
                                    argv:
                                      minItems: 1
                                      maxItems: 64
                                      type: array
                                      items:
                                        type: string
                                        minLength: 1
                                        maxLength: 4096
                                    workingDirectory:
                                      type: string
                                      minLength: 1
                                      maxLength: 512
                                      pattern: >-
                                        ^\/(?:[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*)?$
                                    models:
                                      minItems: 1
                                      maxItems: 128
                                      type: array
                                      items:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                    toolNames:
                                      maxItems: 256
                                      type: array
                                      items:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                    environmentKeys:
                                      maxItems: 256
                                      type: array
                                      items:
                                        type: string
                                        minLength: 1
                                        maxLength: 255
                                        pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                  required:
                                    - id
                                    - argv
                                    - models
                                    - toolNames
                                    - environmentKeys
                                  additionalProperties: false
                                description: >-
                                  Explicit argv-only agent harness allowlist.
                                  Shell command templates are not accepted.
                              networkPolicy:
                                type: object
                                properties:
                                  mode:
                                    type: string
                                    enum:
                                      - open
                                      - allowlist
                                      - none
                                  domains:
                                    maxItems: 256
                                    type: array
                                    items:
                                      type: string
                                      minLength: 1
                                      maxLength: 253
                                      pattern: >-
                                        ^(?:\*\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$
                                required:
                                  - mode
                                  - domains
                                additionalProperties: false
                              secretReferences:
                                maxItems: 256
                                type: array
                                items:
                                  type: object
                                  properties:
                                    environmentKey:
                                      type: string
                                      minLength: 1
                                      maxLength: 255
                                      pattern: ^[A-Za-z_][A-Za-z0-9_]*$
                                    secretId:
                                      type: string
                                      minLength: 1
                                      maxLength: 255
                                  required:
                                    - environmentKey
                                    - secretId
                                  additionalProperties: false
                                description: >-
                                  Reserved for tenant-scoped provider-vault
                                  bindings. Current compute providers require
                                  this array to be empty.
                            required:
                              - architecture
                              - workingDirectory
                              - packages
                              - features
                              - environmentKeys
                              - agentHarnesses
                              - networkPolicy
                              - secretReferences
                            additionalProperties: false
                          manifestHash:
                            type: string
                            pattern: ^[0-9a-f]{64}$
                          state:
                            type: string
                            enum:
                              - draft
                              - active
                              - deprecated
                              - retired
                          activatedAt:
                            nullable: true
                            type: string
                            format: date-time
                            pattern: >-
                              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                          deprecatedAt:
                            nullable: true
                            type: string
                            format: date-time
                            pattern: >-
                              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                          createdAt:
                            type: string
                            format: date-time
                            pattern: >-
                              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                          updatedAt:
                            type: string
                            format: date-time
                            pattern: >-
                              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
                        required:
                          - id
                          - object
                          - key
                          - version
                          - name
                          - description
                          - imageRef
                          - manifest
                          - manifestHash
                          - state
                          - activatedAt
                          - deprecatedAt
                          - createdAt
                          - updatedAt
                        additionalProperties: false
                        description: >-
                          An immutable environment version. Editing an
                          environment creates another version.
        '400':
          description: Invalid input for this operation, or a confirm token problem.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminRefusal'
        '401':
          description: >-
            Missing, expired or revoked management token. Inference API keys are
            refused.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminAuthError'
        '403':
          description: The operation is not available at the caller's access level.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminRefusal'
        '404':
          description: Unknown operation id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminRefusal'
        '409':
          description: The target changed since it was described (`target_changed`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminRefusal'
        '422':
          description: >-
            Executed but the operation reported a failure (`ok: false`, see
            `message`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminOutcome'
        '429':
          description: Organization request budget exhausted; see `Retry-After`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminAuthError'
      security:
        - managementToken: []
components:
  schemas:
    AdminOutcome:
      type: object
      properties:
        status:
          type: string
          enum:
            - executed
        ok:
          type: boolean
          description: Whether the operation succeeded.
        summary:
          type: string
          description: >-
            The consent line describing what was done, built from resolved
            labels.
        message:
          type: string
          description: Human-readable result line.
        data:
          description: Operation payload (reads) or detail worth relaying (writes).
        secret:
          description: >-
            A one-time secret the operation minted (API key, credential). Shown
            once; store it now.
          type: string
        sensitive:
          description: 'Present exactly when `secret` is: redact this response from logs.'
          type: boolean
          enum:
            - true
      required:
        - status
        - ok
        - summary
        - message
      additionalProperties: false
    AdminRefusal:
      type: object
      properties:
        status:
          type: string
          enum:
            - refused
        code:
          type: string
          enum:
            - unknown_op
            - not_allowed
            - insufficient_scope
            - invalid_input
            - confirm_invalid
            - confirm_expired
            - target_changed
        error:
          type: string
      required:
        - status
        - code
        - error
      additionalProperties: false
    AdminAuthError:
      type: object
      properties:
        error:
          type: string
        error_description:
          type: string
      required:
        - error
        - error_description
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your AI Reserve API key (aireserve_api_…) from the API Keys page in the
        portal (https://portal.aireserve.com/keys).
    managementToken:
      type: http
      scheme: bearer
      bearerFormat: aireserve_mcp_…
      description: >-
        A management token: minted by the OAuth flow (`aireserve login`, or an
        MCP client's Authenticate step) or on the portal Keys page under
        Management Keys. Inference API keys are refused.

````

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