Scale service
Set the service’s instance count and, optionally, its autoscaling targets and ceiling.
Request & response examples
curl --fail-with-body --request PATCH \ 'https://app.helicarrier.xyz/api/services/YOUR_ID/scaling' \ -H "Authorization: Bearer $HELI_API_KEY" \ -H 'Content-Type: application/json' \ --data '{ "instances": 2, "maxInstances": 4, "autoscaleEnabled": true, "autoscaleCpuPct": 70}'const response = await fetch( "https://app.helicarrier.xyz/api/services/YOUR_ID/scaling", { method: "PATCH", headers: { Authorization: `Bearer ${process.env.HELI_API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "instances": 2, "maxInstances": 4, "autoscaleEnabled": true, "autoscaleCpuPct": 70 }) });const data = await response.json();if (!response.ok) { throw new Error(`HTTP ${response.status}: ${data.error}`);}// Inspect data; avoid logging secret responses.import osimport requests
response = requests.request( "PATCH", "https://app.helicarrier.xyz/api/services/YOUR_ID/scaling", headers={ "Authorization": f"Bearer {os.environ['HELI_API_KEY']}" }, json={ "instances": 2, "maxInstances": 4, "autoscaleEnabled": True, "autoscaleCpuPct": 70 }, timeout=30,)response.raise_for_status()data = response.json()# Inspect data; avoid logging secret responses.{ "scaling": { "minReplicas": 1, "maxReplicas": 4, "desiredReplicas": 2, "instances": 2, "autoscaleEnabled": true, "autoscaleCpuPct": 70, "autoscaleMemPct": 0, "autoscalable": true }, "redeploying": true}Illustrative values · selected fields
Path parameters
idstringrequiredService id.
Request body
instancesintegeroptionalInstances to run (minimum 1). With autoscaling on this is the floor.
maxInstancesintegeroptionalCeiling autoscaling may grow to. Must be >= instances.
autoscaleEnabledbooleanoptionalTurn autoscaling on or off.
autoscaleCpuPctintegeroptionalTarget CPU utilisation percent per instance (0 = ignore CPU).
autoscaleMemPctintegeroptionalTarget memory utilisation percent per instance (0 = ignore memory).
Response 200
Returns the saved scaling configuration and whether an immediate redeployment was applied. The response uses minReplicas and maxReplicas for the requested floor and ceiling.
Examples show selected response fields with illustrative values. Your response can contain additional fields.
scalingobjectSaved scaling configuration and effective capacity.
Child fields
minReplicasintegerConfigured instance floor.
maxReplicasintegerConfigured autoscaling ceiling.
desiredReplicasintegerDesired instance count selected by the scaler.
instancesintegerEffective number of instances.
autoscaleEnabledbooleanWhether autoscaling is enabled.
autoscaleCpuPctintegerCPU utilization target; zero disables this signal.
autoscaleMemPctintegerMemory utilization target; zero disables this signal.
autoscalablebooleanWhether this service supports autoscaling.
redeployingbooleanWhether the operation applied or queued a redeployment.
Errors
400Invalid parameters. Check the required fields, types, and resource configuration.
401The API key is missing, invalid, or revoked.
403The caller or key scope does not permit this operation.
500The operation could not be completed. Check resource state before retrying a write.
scale_service
Required MCP arguments: id. Send path, query, and body fields together as tool arguments.