RL Environments

Submit an eval-episode job for asynchronous execution

Replays one or more ordered action sequences through a fresh episode reset and returns per-episode cumulative rewards computed with evalCostOverrides applied. Use this to detect reward blind spots: policies trained without egress or cross-AZ cost pricing will show a significant reward drop (reward_collapse) when those dimensions are priced.

The endpoint does not mutate any stored environment or simulation state — all episode rollouts are in-memory and ephemeral.

Async mode (default): Returns 202 Accepted immediately with a jobId. Poll GET /rl/environments/{environmentId}/eval-episodes/{jobId} until status is completed or failed.

Sync mode (?sync=true): Runs the rollout in-process and returns the full result inline with 200 OK. Suitable for small workloads (≤ 3 episodes, ≤ 20 steps each).

reward_collapse logic: reward_collapse is true when meanEvalReward < trainingTotalReward − collapseThreshold × |trainingTotalReward|. With the default threshold of 0.20, any policy whose eval reward is more than 20 % below its training reward is flagged as collapsing.

post/rl/environments/{environmentId}/eval-episodes

Request

  • Base URL: https://www.cloudworldmodel.ai/api
  • URL: https://www.cloudworldmodel.ai/api/rl/environments/{environmentId}/eval-episodes
  • Auth: one of:
    • HTTP bearer
    • API key in header X-PAYMENT
    • API key in header PAYMENT-SIGNATURE

Path parameters

environmentIdstring uuid required

ID of the RL environment whose training reward is used as the baseline

Query parameters

syncboolean

When true, run the eval synchronously and return the full result inline with 200 OK. When omitted or false (default), create a background job and return 202 Accepted with a jobId.

Request body

collapseThresholdnumber

Fractional drop in reward that triggers reward_collapse. Default is 0.20 (collapse when mean eval reward is more than 20 % below training total reward).

evalCostOverridesobject

Per-dimension cost override rates in USD per 1 000 RPS per hour. Supported keys: egress (any simulation with traffic > 0) and cross_az_traffic (simulations with resources in distinct Availability Zones). These rates inflate costPerHour before the reward cost score is computed, revealing policies that exploit unpriced cost blind spots.

Example request

{
  "actions": [
    [
      {
        "parameters": {
          "cpuThreshold": 70,
          "throughputThreshold": 75,
          "latencyThreshold": 180
        }
      }
    ]
  ],
  "evalCostOverrides": {
    "egress": 0.5,
    "cross_az_traffic": 0.3
  }
}

Response

Eval episodes completed synchronously (only returned when ?sync=true is set).

meanEvalRewardnumber required

Mean of totalReward across all eval episodes

trainingTotalRewardnumber required

Stored cumulative training reward from the environment (the baseline being compared against)

collapseThresholdnumber required

The collapse threshold used for this evaluation (echoed from request)

reward_collapseboolean required

true when meanEvalReward falls more than collapseThreshold × |trainingTotalReward| below trainingTotalReward. Indicates the policy exploits cost dimensions unpriced during training.

Changes

No recorded changes to this operation across all 1 revision of this API.