Submit a deterministic traffic injection for a simulation
Changes the simulation's traffic level in a single call. Supply targetRps or deltaPercent for deterministic, reproducible results (recommended for agents and controlled scenarios):
- targetRps (absolute, recommended) — sets traffic to exactly this value (clamped 1–500 000 RPS). Takes precedence over deltaPercent. Response mode: "target_rps".
- deltaPercent (relative, recommended) — new traffic is currentTraffic × (1 + deltaPercent/100), rounded (e.g. 75 turns 400 RPS into 700 RPS). Response mode: "delta_percent".
- random: true (explicit random spike) — injects a large random spike of +30 000–50 000 RPS on top of current traffic (mode: "random_spike"; if a ramp pattern is active the call instead advances it by one increment, mode: "ramp_increment"). Not suitable for controlled scenarios or reproducible runs — use only when an uncontrolled spike is intentional.
When targetRps or deltaPercent is supplied before replay identity is finalized, active traffic patterns are deactivated (their names are echoed in deactivatedPatterns) so the injected level persists across subsequent step calls. For the SQS Queue Backlog Saturation scenario, a finalized run with an active pattern instead uses the server-managed runtimeTrafficOverrideActive control: the persisted pattern and replay snapshot stay unchanged, while subsequent steps honor the explicit traffic level. Other finalized simulations with active patterns return 409 Conflict; replay identity finalization cannot be bypassed.
The Redis Cache Crash & Recovery scenario starts at 5,000 RPS by default and has no active traffic pattern. Its create-time traffic value is honored, and this endpoint can change load after stepping without changing finalized replay identity.
Every response echoes the applied outcome: { previousRps, appliedRps, mode, requestedTargetRps?, requestedDeltaPercent? }.
Unknown fields are rejected before payment settlement — if the request body contains any field other than targetRps, deltaPercent, or random (for example the common agent mistakes multiplier, factor, or spike), the endpoint returns a structured 400 with a hint naming the likely intended field and, when the value is numeric, the equivalent deltaPercent expression. An empty body {} also returns 400 with a hint naming all three valid patterns. No USDC charge is settled on a 400 response.
Requires write scope and ownership.
Request
- Base URL: https://www.cloudworldmodel.ai/api
- URL: https://www.cloudworldmodel.ai/api/simulations/{simulationId}/inject-traffic
- Auth: one of:
- HTTP bearer
- API key in header X-PAYMENT
- API key in header PAYMENT-SIGNATURE
Path parameters
Simulation UUID
Request body
Response
Traffic change applied
Example response
{
"simulation": {
"resources": [
{
"id": "ec2-1",
"type": "compute",
"name": "Web Server 1",
"provider": "aws",
"location": {
"regionKey": "us-east-2"
},
"characteristics": {
"workload": "crud",
"appRuntime": "node",
"appWorkerCount": 2,
"appDbPoolSize": 250,
"workloadDatabaseVersion": "8.0",
"workloadDatabaseEngine": "mysql",
"rdsSqlServerBilling": {
"instanceClass": "db.t3.micro",
"storageType": "gp2",
"allocatedStorageGiB": 20,
"durationHours": 480,
"sustainedCpuPercent": 43
},
"serviceFamily": "ec2",
"containerCpu": 0.5,
"containerMemoryGiB": 1,
"runtimeMemoryProfile": {
"workingSetGiB": 0.78125
},
"concurrency": 80,
"requestDurationSeconds": 0.25,
"requestServingTargetUtilizationPct": 70,
"billingState": "stopped",
"size": "m5.large",
"instanceType": "t3.medium",
"ocpus": 4,
"maxThroughput": 2000,
"capacityRps": 100,
"baseLatency": 3,
"maxConnections": 800,
"capacityGB": 500,
"maxIops": 3000,
"inferenceMode": true,
"accelerator": "a10g",
"managedComputePlatform": "nvidia-dgx-cloud",
"openshiftOffering": "rosa-hcp",
"topology": {
"intraNode": "nvlink-nvswitch",
"interNode": "infiniband"
},
"intraNode": "nvlink-nvswitch",
"interNode": "infiniband",
"includesControlPlane": true,
"bundledNetworking": true,
"trainingMode": true,
"tokensPerRequest": 500,
"inputTokensPerRequest": 1000,
"cacheHitRate": 0.85,
"cacheableRequestShare": 0.75,
"asynchronousRequestShare": 0.15,
"queueConsumerCount": 4,
"queueDrainRatePerConsumerRps": 125,
"queueCapacityMessages": 20000,
"queueSimulationStepSeconds": 1,
"autoscaling": true,
"maxInstances": 5,
"minInstances": 2,
"scaleOutCpuThreshold": 60,
"scaleInCpuThreshold": 25,
"nodeCount": 2,
"workerVcpu": 4,
"minNodes": 2,
"maxNodes": 10,
"perNodeRate": 3.2,
"pricingModel": "on-demand",
"nodePools": [
{
"name": "general",
"nodeCount": 2,
"workerVcpu": 8,
"minNodes": 2,
"maxNodes": 10,
"perNodeRate": 0.096,
"maxThroughput": 10000
}
],
"streamShardsCount": 4,
"streamWriteRps": 3500,
"eventNotificationsEnabled": true,
"partitionCount": 8,
"streamPartitions": 4,
"partitionWriteRps": 5000,
"warmupSteps": 5,
"warmupSeverity": 0.8
},
"routedRps": 15,
"availabilityState": "available",
"isRoutable": true,
"failureParkStepsRemaining": 3,
"recoveryPolicy": {
"criticalCpuThreshold": 75,
"criticalSteps": 2,
"warningCpuThreshold": 60,
"warningSteps": 1,
"failureParkSteps": 2
}
}
],
"normalizedConfig": {
"resources": [
{
"rdsSqlServerBilling": {
"input": {
"instanceClass": "db.t3.micro",
"storageType": "gp2",
"allocatedStorageGiB": 20,
"durationHours": 480,
"sustainedCpuPercent": 43
}
},
"rateProvenance": {
"sku": "m7g.large",
"source": "AWS EC2 Price List API (Linux, shared tenancy, on-demand)"
},
"dynamoDbBilling": {
"referenceRequestRateRps": 50000
},
"requestServing": {
"serviceFamily": "lambda"
},
"behaviorModel": {
"latencyPath": "gpu-inference/ttft-decode",
"description": "Token-economics model: TTFT + decode, weighted by throughput and batch pressure.",
"modelingNote": "TTFT and decode-throughput figures are CWM simulation-model estimates, not externally measured hardware benchmarks.",
"topologyThroughputFactor": 0.92,
"topologyThroughputCalibrationStatus": "estimated",
"ibNetworkingCostPerNodePerHour": 2
},
"inferenceWarnings": [
"Resource has inference/GPU characteristics (accelerator: h100, tokensPerRequest: 512) but inferenceMode is not enabled. The generic-kubernetes/load-saturation latency model will be used. Set characteristics.inferenceMode: true to activate gpu-inference/ttft-decode."
]
}
]
},
"resilienceConfig": {
"dependencies": [
{
"id": "web-to-db",
"sourceId": "web-1",
"targetId": "db-1",
"requestRatio": 1,
"authDependencyId": "gateway-to-token-service",
"retryPolicy": {
"maxRetries": 3,
"backoffMs": 100,
"backoffMultiplier": 2,
"jitterRatio": 0.1,
"timeoutMs": 2000,
"retryBudgetRatio": 2,
"retryBudgetRps": 1000,
"retryActorId": "gateway_optimistic_retries"
},
"capacity": {
"maxRps": 10000,
"maxConcurrent": 200,
"meanServiceTimeMs": 100
},
"protection": {
"circuitBreaker": {
"failureRateThreshold": 0.5,
"minimumRequests": 20,
"openSteps": 3,
"halfOpenMaxRequests": 10
},
"rateLimitRps": 5000
}
}
],
"scheduledFaults": [
{
"id": "db-capacity-fault",
"targetResourceId": "db-1",
"dependencyId": "web-to-db",
"startStep": 5,
"endStep": 15,
"capacityPercent": 30,
"maxConcurrent": 5,
"addedLatencyMs": 500,
"errorRate": 0.3,
"trafficMultiplier": 2.25
}
],
"maxCascadeDepth": 4,
"maxGeneratedRps": 100000,
"maxStepWork": 512
}
},
"event": {
"severity": "info",
"message": "Traffic set (target_rps): 400 → 700 RPS (+300 RPS)"
},
"previousRps": 400,
"appliedRps": 700,
"mode": "target_rps"
}Changes
No recorded changes to this operation across all 1 revision of this API.