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

# Update Benchmark Task Env Resources

> Change the CPU, memory, GPU or network settings of one benchmark task's sandbox without uploading the task again. Only the fields in the request change. Rollouts that start after the change use it; sandboxes already running keep the settings they started with.



## OpenAPI

````yaml /openapi.json patch /api/v1/benchmarks/{bench_id}/tasks/{task_id}/env_resources
openapi: 3.1.0
info:
  title: Trajectory API
  version: 0.1.0
  x-trajectory-api-version: '2026-10-14'
  description: >-
    This contract is API version 2026-10-14. The optional Trajectory-API-Version
    header pins it, and tmp-contract is accepted as an alias. Requests without
    the header get this version. Version 2026-10-07 and the pre-launch legacy
    response formats are retired.
servers:
  - url: https://api.trajectory.ai
security: []
tags:
  - name: agents
    x-group: Agents
  - name: benchmarks
    x-group: Specs (benchmarks)
  - name: diagnostics
    x-group: Diagnostics
  - name: benchmark-ingestion
    x-group: Spec (benchmark) submissions
  - name: eval
    x-group: Evaluations
  - name: training
    x-group: Training
  - name: deployments
    x-group: Deployments
  - name: model-endpoints
    x-group: Model endpoints
  - name: inference
    x-group: Inference
  - name: trajectories
    x-group: Trajectories
  - name: artifacts
    x-group: Artifacts
  - name: telemetry
    x-group: Telemetry
  - name: supported-models
    x-group: Supported models
  - name: organizations
    x-group: Organizations
  - name: secrets
    x-group: Secrets
paths:
  /api/v1/benchmarks/{bench_id}/tasks/{task_id}/env_resources:
    patch:
      tags:
        - benchmarks
      summary: Update Benchmark Task Env Resources
      description: >-
        Change the CPU, memory, GPU or network settings of one benchmark task's
        sandbox without uploading the task again. Only the fields in the request
        change. Rollouts that start after the change use it; sandboxes already
        running keep the settings they started with.
      operationId: updateBenchmarkTaskEnvResources
      parameters:
        - name: bench_id
          in: path
          required: true
          schema:
            type: string
            title: Bench Id
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBenchmarkTaskEnvResourcesRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BenchmarkTaskEnvResources'
        '404':
          description: >-
            The requested resource does not exist or is not visible to the
            caller.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/RequestId'
            Trajectory-Should-Retry:
              $ref: '#/components/headers/TrajectoryShouldRetry'
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundErrorResponse'
        default:
          $ref: '#/components/responses/ApiErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UpdateBenchmarkTaskEnvResourcesRequest:
      properties:
        cpus:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: 'null'
          title: Cpus
          description: >-
            CPU cores to request. Set `cpus` and `memory_mb` both to null for
            the default.
        memory_mb:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Memory Mb
          description: Memory to request in MiB.
        gpus:
          type: integer
          minimum: 0
          title: Gpus
          description: GPUs to request.
        network_mode:
          $ref: '#/components/schemas/NetworkMode'
          title: Network Mode
          description: >-
            `public`, `allowlist` or `no-network`. Leaving `allowlist` clears
            `allowed_hosts` unless the request also sets it.
        allowed_hosts:
          items:
            type: string
            maxLength: 253
            pattern: >-
              ^(\*\.)?([A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?$
          type: array
          title: Allowed Hosts
          description: >-
            Domain names the sandbox may reach, such as `pypi.org` or
            `*.example.com` for every subdomain; no scheme, port, path or IP
            address. Only valid with `allowlist`.
      additionalProperties: false
      type: object
      title: UpdateBenchmarkTaskEnvResourcesRequest
      description: Fields left out keep their stored value.
    BenchmarkTaskEnvResources:
      properties:
        cpus:
          anyOf:
            - type: number
            - type: 'null'
          title: Cpus
          description: CPU cores requested; null uses the provider default.
        memory_mb:
          anyOf:
            - type: integer
            - type: 'null'
          title: Memory Mb
          description: Memory requested in MiB; null uses the default.
        gpus:
          type: integer
          title: Gpus
          description: GPUs requested.
        network_mode:
          $ref: '#/components/schemas/NetworkMode'
          description: >-
            `public` allows all outbound traffic, `allowlist` allows only
            `allowed_hosts` and the platform's own endpoints, and `no-network`
            allows only the platform's own endpoints.
        allowed_hosts:
          items:
            type: string
          type: array
          title: Allowed Hosts
          description: Domain names the sandbox may reach; only set with `allowlist`.
      type: object
      required:
        - cpus
        - memory_mb
        - gpus
        - network_mode
        - allowed_hosts
      title: BenchmarkTaskEnvResources
    ResourceNotFoundErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ResourceNotFoundErrorBody'
      type: object
      required:
        - error
      title: ResourceNotFoundErrorResponse
    NetworkMode:
      type: string
      enum:
        - no-network
        - public
        - allowlist
      title: NetworkMode
    ResourceNotFoundErrorBody:
      properties:
        type:
          type: string
          const: invalid_request_error
          title: Type
        code:
          type: string
          const: resource_not_found
          title: Code
        message:
          type: string
          title: Message
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
        doc_url:
          type: string
          title: Doc Url
        context:
          $ref: '#/components/schemas/EmptyErrorContext'
      type: object
      required:
        - type
        - code
        - message
        - doc_url
        - context
      title: ResourceNotFoundErrorBody
    ApiErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ApiErrorBody'
      required:
        - error
      title: ApiErrorEnvelope
      type: object
    EmptyErrorContext:
      properties: {}
      additionalProperties: false
      type: object
      title: EmptyErrorContext
    ApiErrorBody:
      properties:
        type:
          $ref: '#/components/schemas/ErrorType'
        code:
          type: string
          title: Code
        message:
          type: string
          title: Message
        param:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Param
        doc_url:
          type: string
          title: Doc Url
        context:
          additionalProperties: true
          title: Context
          type: object
      required:
        - type
        - code
        - message
        - doc_url
        - context
      title: ApiErrorBody
      type: object
    ErrorType:
      enum:
        - invalid_request_error
        - authentication_error
        - permission_error
        - conflict_error
        - billing_error
        - rate_limit_error
        - dependency_error
        - api_error
      title: ErrorType
      type: string
  headers:
    RequestId:
      schema:
        type: string
    TrajectoryShouldRetry:
      schema:
        type: boolean
    RetryAfter:
      schema:
        type: string
  responses:
    ApiErrorResponse:
      description: >-
        Common API error. Possible codes: `authentication_required`,
        `permission_denied`, `validation_error`, `rate_limited`,
        `internal_error`, `service_unavailable`.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
        Trajectory-Should-Retry:
          $ref: '#/components/headers/TrajectoryShouldRetry'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorEnvelope'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Organization API key

````

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