# iai services update

Update a service in a project

## Synopsis

Update a service in a specific project.

Only the flags you pass are applied; everything else is left at its current value.

Lists (--env, --secret) replace the entire current list when provided — pass every value you want to keep.

Replicas and autoscaling are mutually exclusive: passing --replicas disables autoscaling, and passing any --autoscaling-\* flag switches back to autoscaling.

For schedules, passing --schedule-uptime auto-clears any existing downtime, and --schedule-downtime auto-clears any existing uptime. Pass --schedule-timezone alongside either to change the timezone.

Use --clear-env, --clear-secret, --clear-healthcheck, --clear-schedule, or --clear-stack-id to remove those configurations entirely.

Examples: iai services update my-svc --image-tag v2 iai services update my-svc --memory 1G --cpu 0.5 iai services update my-svc --replicas 3 iai services update my-svc --autoscaling-max-replicas 8 iai services update my-svc --schedule-downtime "Sat-Sun 00:00-24:00" iai services update my-svc --clear-healthcheck iai services update my-svc --stack-id my-stack iai services update my-svc --clear-stack-id

```
iai services update <service_name> [flags]
```

## Options

```
      --autoscaling-cpu-percentage int      CPU percentage threshold for autoscaling
      --autoscaling-max-replicas int        Maximum number of replicas for autoscaling
      --autoscaling-memory-percentage int   Memory percentage threshold for autoscaling
      --autoscaling-min-replicas int        Minimum number of replicas for autoscaling
      --clear-env                           Remove all environment variables from the service
      --clear-healthcheck                   Remove the healthcheck configuration from the service
      --clear-schedule                      Remove the schedule configuration from the service
      --clear-secret                        Remove all secret references from the service
      --clear-stack-id                      Remove the service from its stack
      --cpu string                          CPU cores or millicores (e.g. 0.5, 1, 2, 500m, 1000m)
      --endpoint                            Expose the service at <service-name>-<project-hash>.interactive.ai
      --env stringArray                     Environment variable (NAME=VALUE); can be repeated
      --healthcheck-initial-delay int       Initial delay in seconds before starting healthchecks
      --healthcheck-path string             HTTP path for healthcheck endpoint (e.g. /health)
  -h, --help                                help for update
      --image-name string                   Container image name
      --image-repository string             Container image repository (external images only)
      --image-tag string                    Container image tag
      --image-type string                   Image type: 'external' (Docker Hub, ghcr.io) or 'internal' (InteractiveAI private registry)
      --memory string                       Memory in megabytes (M) or gigabytes (G) (e.g. 128M, 512M, 1G, 1.5G)
  -o, --organization string                 Organization name that owns the project
      --port int                            Service port to expose
  -p, --project string                      Project name to update the service in
      --replicas int                        Number of replicas for the service (mutually exclusive with autoscaling)
      --schedule-downtime string            When the service should be scaled down (mutually exclusive with --schedule-uptime). Format: comma-separated entries of DAY_FROM-DAY_TO HH:MM-HH:MM. Weekdays: Mon, Tue, Wed, Thu, Fri, Sat, Sun (case-insensitive). Times in 24h format; start: 00:00-23:59, end: 00:00-24:00 (24:00 = end of day). Example: 'Sat-Sun 00:00-24:00'
      --schedule-timezone string            IANA timezone for the schedule (e.g. Europe/Berlin, US/Eastern, UTC); required with --schedule-uptime or --schedule-downtime
      --schedule-uptime string              When the service should be running (mutually exclusive with --schedule-downtime). Format: comma-separated entries of DAY_FROM-DAY_TO HH:MM-HH:MM. Weekdays: Mon, Tue, Wed, Thu, Fri, Sat, Sun (case-insensitive). Times in 24h format; start: 00:00-23:59, end: 00:00-24:00 (24:00 = end of day). Example: 'Mon-Fri 07:30-20:30' or 'Mon-Fri 08:00-18:00, Sat 10:00-14:00'
      --secret stringArray                  Secrets to be loaded as env vars; can be repeated
      --stack-id string                     Stack ID to assign the service to
```

## Options inherited from parent commands

```
      --api-key string               API key for authentication
      --cfg-file string              Path to YAML config file with organization, project, and optional service definitions
      --deployment-hostname string   Hostname for the deployment API (default "https://deployment.interactive.ai")
      --hostname string              Hostname for the API (default "https://app.interactive.ai")
```

## SEE ALSO

* [iai services](/cli/iai_services.md) - Deploy and manage HTTP services


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.interactive.ai/cli/iai_services_update.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
