Optimize & Predict

Generate optimal autoscaling thresholds

Tests multiple threshold combinations to find the best autoscaling configuration for the predicted traffic pattern.

When a webhookUrl is provided, the following payload is POSTed to that URL when the job completes (example shown for the AWS EC2 Auto Scaling request above):

{
  "event": "prediction.completed",
  "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "jobType": "prediction_optimization",
  "status": "completed",
  "completedAt": "2025-11-23T10:35:00Z",
  "data": {
    "bestThresholds": {
      "scaleOutCpuThreshold": 70,
      "scaleInCpuThreshold": 30,
      "scaleOutThroughputThreshold": 75,
      "scaleInThroughputThreshold": 35,
      "scaleOutLatencyThreshold": 120,
      "cooldownSeconds": 180,
      "minInstances": 3,
      "maxInstances": 15
    }
  }
}

The request is signed with HMAC-SHA256; verify the X-Webhook-Signature header against your webhookSecret before processing the payload.

post/predictions/optimize-thresholds

Request

  • Base URL: https://www.cloudworldmodel.ai/api
  • URL: https://www.cloudworldmodel.ai/api/predictions/optimize-thresholds
  • Auth: one of:
    • HTTP bearer
    • API key in header X-PAYMENT
    • API key in header PAYMENT-SIGNATURE

Request body

simulationIdstring required

ID of simulation to optimize

testStepsinteger

Number of simulation steps to run per test

webhookUrlstring uri

Optional HTTPS URL to receive webhook notification when job completes

webhookSecretstring

Optional secret for HMAC-SHA256 webhook signature verification

Example request

{
  "simulationId": "sim-abc123",
  "trafficForecast": {
    "name": "Peak Traffic Test",
    "dataPoints": [
      {
        "timestamp": 0,
        "rps": 2000,
        "label": "Baseline"
      },
      {
        "timestamp": 60,
        "rps": 12000,
        "label": "Peak"
      }
    ]
  },
  "testSteps": 100
}

Response

Optimization job accepted

messagestring

Example response

{
  "job": {
    "type": "threshold_optimization"
  },
  "message": "Threshold optimization job started. Poll /predictions/jobs/{id} for status."
}

Changes

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