# Baseten

> Run and look after the AI models you deploy on Baseten: call a model, wake it, activate, deactivate or promote deployments, change autoscaling, read logs and manage environments and secrets. Start a workflow when a model or deployment is added, changes status or is promoted.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/baseten

## Actions

### Activate deployment

Turn an inactive deployment back on so it serves requests. Baseten bills for the hardware while it runs. Nothing changes if it is already active.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.
- Deployment (`deployment_id`, text, required): The deployment: the model's production or development deployment, or one by its ID from an earlier step.

**Outputs**

- `already_active` (true/false): True if it was already active
- `deployment` (object): The deployment, as it is now

**Example output**

```json
{
  "already_active": false,
  "deployment": {
    "active_replica_count": 1,
    "autoscaling_settings": {
      "autoscaling_window": 60,
      "concurrency_target": 2,
      "max_replica": 2,
      "min_replica": 0,
      "scale_down_delay": 900,
      "target_utilization_percentage": 70
    },
    "created_at": "2026-11-01T09:00:00Z",
    "environment": "production",
    "id": "qwer5678",
    "instance_type_name": "1x L4",
    "is_development": false,
    "is_production": true,
    "labels": {},
    "model_id": "abcd1234",
    "name": "deployment-2",
    "status": "ACTIVE"
  }
}
```

### Call model

Send input to one of your deployed models and get its answer, such as a summary or a transcript. Baseten bills for the time it runs.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.
- Input (`model_input`, object, required): The JSON the model expects, such as {"prompt": "Hello"}. Each model defines its own.
- Environment (`environment`, text): The environment to call. Defaults to production.
- Deployment (`deployment_id`, text): A deployment to call instead of an environment, such as the development deployment. Leave empty to use the environment.

**Outputs**

- `called` (text): What was called, such as production environment
- `output` (object): What the model answered
- `request_id` (text): Baseten's ID for the request, to find it in the logs

**Example output**

```json
{
  "called": "production environment",
  "output": {
    "summary": "The customer wants a refund."
  },
  "request_id": "a1b2c3d4e5"
}
```

### Create environment

Add an environment to a model, such as staging, with an address of its own that deployments can be promoted to.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.
- Name (`name`, text, required): The new environment's name, such as staging.
- Minimum replicas (`min_replica`, number): The fewest copies of the model kept running. 0 lets it scale to zero when idle. From 0 to 1000.
- Maximum replicas (`max_replica`, number): The most copies of the model it may run at busy times. From 1 to 1000.

**Outputs**

- `environment` (object): The environment

**Example output**

```json
{
  "environment": {
    "autoscaling_settings": {
      "autoscaling_window": 60,
      "concurrency_target": 2,
      "max_replica": 2,
      "min_replica": 0,
      "scale_down_delay": 900,
      "target_utilization_percentage": 70
    },
    "candidate_deployment": {
      "active_replica_count": 1,
      "autoscaling_settings": {
        "autoscaling_window": 60,
        "concurrency_target": 2,
        "max_replica": 2,
        "min_replica": 0,
        "scale_down_delay": 900,
        "target_utilization_percentage": 70
      },
      "created_at": "2026-11-01T09:00:00Z",
      "environment": "production",
      "id": "zxcv9012",
      "instance_type_name": "1x L4",
      "is_development": false,
      "is_production": true,
      "labels": {},
      "model_id": "abcd1234",
      "name": "deployment-2",
      "status": "DEPLOYING"
    },
    "created_at": "2026-11-02T09:00:00Z",
    "current_deployment": {
      "active_replica_count": 1,
      "autoscaling_settings": {
        "autoscaling_window": 60,
        "concurrency_target": 2,
        "max_replica": 2,
        "min_replica": 0,
        "scale_down_delay": 900,
        "target_utilization_percentage": 70
      },
      "created_at": "2026-11-01T09:00:00Z",
      "environment": "production",
      "id": "qwer5678",
      "instance_type_name": "1x L4",
      "is_development": false,
      "is_production": true,
      "labels": {},
      "model_id": "abcd1234",
      "name": "deployment-2",
      "status": "ACTIVE"
    },
    "in_progress_promotion": {
      "percent_traffic_to_new_version": 0,
      "status": "RELEASING"
    },
    "instance_type": {
      "id": "L4x4x16",
      "name": "1x L4"
    },
    "model_id": "abcd1234",
    "name": "staging",
    "promotion_settings": {
      "rolling_deploy": true
    }
  }
}
```

### Deactivate deployment

Turn a deployment off: it stops serving requests and costing money until it is activated again.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.
- Deployment (`deployment_id`, text, required): The deployment: the model's production or development deployment, or one by its ID from an earlier step.

**Outputs**

- `already_inactive` (true/false): True if it was already inactive
- `deployment` (object): The deployment, as it is now

**Example output**

```json
{
  "already_inactive": false,
  "deployment": {
    "active_replica_count": 1,
    "autoscaling_settings": {
      "autoscaling_window": 60,
      "concurrency_target": 2,
      "max_replica": 2,
      "min_replica": 0,
      "scale_down_delay": 900,
      "target_utilization_percentage": 70
    },
    "created_at": "2026-11-01T09:00:00Z",
    "environment": "production",
    "id": "qwer5678",
    "instance_type_name": "1x L4",
    "is_development": false,
    "is_production": true,
    "labels": {},
    "model_id": "abcd1234",
    "name": "deployment-2",
    "status": "DEACTIVATING"
  }
}
```

### Delete deployment

Delete a deployment for good, such as an old version nobody uses. It can't be undone.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.
- Deployment (`deployment_id`, text, required): The deployment: the model's production or development deployment, or one by its ID from an earlier step.

**Outputs**

- `deleted` (true/false): Always true once done
- `deployment_id` (text): The deployment deleted
- `model_id` (text): Its model

**Example output**

```json
{
  "deleted": true,
  "deployment_id": "zxcv9012",
  "model_id": "abcd1234"
}
```

### Delete environment

Delete an environment other than production. The deployment it served scales down to zero but is kept.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.
- Environment (`environment`, text, required): The environment, such as production or staging.

**Outputs**

- `deleted` (true/false): Always true once done
- `environment` (text): The environment deleted
- `model_id` (text): Its model

**Example output**

```json
{
  "deleted": true,
  "environment": "staging",
  "model_id": "abcd1234"
}
```

### Delete secret

Delete a secret. Models that read it no longer get it.

**Inputs**

- Secret (`secret_name`, text, required): The secret. Pick one, or give its name.

**Outputs**

- `deleted` (true/false): Always true once done
- `secret_name` (text): The secret deleted

**Example output**

```json
{
  "deleted": true,
  "secret_name": "hf_access_token"
}
```

### Get deployment

Get one deployment: its status (such as active or scaled to zero), running replicas, hardware and autoscaling settings.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.
- Deployment (`deployment_id`, text, required): The deployment: the model's production or development deployment, or one by its ID from an earlier step.

**Outputs**

- `deployment` (object): The deployment

**Example output**

```json
{
  "deployment": {
    "active_replica_count": 1,
    "autoscaling_settings": {
      "autoscaling_window": 60,
      "concurrency_target": 2,
      "max_replica": 2,
      "min_replica": 0,
      "scale_down_delay": 900,
      "target_utilization_percentage": 70
    },
    "created_at": "2026-11-01T09:00:00Z",
    "environment": "production",
    "id": "qwer5678",
    "instance_type_name": "1x L4",
    "is_development": false,
    "is_production": true,
    "labels": {},
    "model_id": "abcd1234",
    "name": "deployment-2",
    "status": "ACTIVE"
  }
}
```

### Get deployment logs

Get a deployment's log lines, such as why it failed to start. Without a time window, the last 30 minutes.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.
- Deployment (`deployment_id`, text, required): The deployment: the model's production or development deployment, or one by its ID from an earlier step.
- From (`start`, date and time): Logs from this time. Defaults to 30 minutes before 'To'.
- To (`end`, date and time): Logs up to this time, at most 7 days after 'From'. Defaults to now.
- Level (`min_level`, text): Only lines at this level or more serious. Defaults to every line. One of: `DEBUG` (Debug and up), `INFO` (Info and up), `WARNING` (Warnings and errors), `ERROR` (Errors only).
- Containing (`contains`, text): Only lines containing this text (capitals matter).
- Most lines (`limit`, number): How many lines at most, 1 to 1000. Defaults to 500. From 1 to 1000.
- Newest first (`newest_first`, true/false): List the newest lines first.

**Outputs**

- `count` (number): How many
- `logs` (list): The log lines

**Example output**

```json
{
  "count": 1,
  "logs": [
    {
      "level": "INFO",
      "message": "Model loaded",
      "replica": "a1b2c",
      "request_id": "",
      "time": "2026-11-06T09:00:00.000Z",
      "timestamp": "1793955600000000000"
    }
  ]
}
```

### Get environment

Get one environment: the deployment it serves, any promotion under way, and its autoscaling settings.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.
- Environment (`environment`, text, required): The environment, such as production or staging.

**Outputs**

- `environment` (object): The environment

**Example output**

```json
{
  "environment": {
    "autoscaling_settings": {
      "autoscaling_window": 60,
      "concurrency_target": 2,
      "max_replica": 2,
      "min_replica": 0,
      "scale_down_delay": 900,
      "target_utilization_percentage": 70
    },
    "candidate_deployment": {
      "active_replica_count": 1,
      "autoscaling_settings": {
        "autoscaling_window": 60,
        "concurrency_target": 2,
        "max_replica": 2,
        "min_replica": 0,
        "scale_down_delay": 900,
        "target_utilization_percentage": 70
      },
      "created_at": "2026-11-01T09:00:00Z",
      "environment": "production",
      "id": "zxcv9012",
      "instance_type_name": "1x L4",
      "is_development": false,
      "is_production": true,
      "labels": {},
      "model_id": "abcd1234",
      "name": "deployment-2",
      "status": "DEPLOYING"
    },
    "created_at": "2026-11-02T09:00:00Z",
    "current_deployment": {
      "active_replica_count": 1,
      "autoscaling_settings": {
        "autoscaling_window": 60,
        "concurrency_target": 2,
        "max_replica": 2,
        "min_replica": 0,
        "scale_down_delay": 900,
        "target_utilization_percentage": 70
      },
      "created_at": "2026-11-01T09:00:00Z",
      "environment": "production",
      "id": "qwer5678",
      "instance_type_name": "1x L4",
      "is_development": false,
      "is_production": true,
      "labels": {},
      "model_id": "abcd1234",
      "name": "deployment-2",
      "status": "ACTIVE"
    },
    "in_progress_promotion": {
      "percent_traffic_to_new_version": 0,
      "status": "RELEASING"
    },
    "instance_type": {
      "id": "L4x4x16",
      "name": "1x L4"
    },
    "model_id": "abcd1234",
    "name": "staging",
    "promotion_settings": {
      "rolling_deploy": true
    }
  }
}
```

### Get model

Get one model: its name, how many deployments it has and which ones are in production and development.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.

**Outputs**

- `model` (object): The model

**Example output**

```json
{
  "model": {
    "created_at": "2026-10-01T09:00:00Z",
    "deployments_count": 2,
    "development_deployment_id": "zxcv9012",
    "id": "abcd1234",
    "instance_type_name": "1x L4",
    "name": "Support summarizer",
    "production_deployment_id": "qwer5678",
    "team_name": "Default"
  }
}
```

### List deployments

List a model's deployments with their status, running replicas and autoscaling settings.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.
- Status (`status`, text): Only deployments in this status. One of: `ACTIVE`, `SCALED_TO_ZERO` (Scaled to zero), `WAKING_UP` (Waking up), `INACTIVE`, `BUILDING`, `DEPLOYING`, `LOADING_MODEL` (Loading model), `UPDATING`, `DEACTIVATING`, `UNHEALTHY`, and 4 more.
- Name (`name`, text): Only the deployment with exactly this name.

**Outputs**

- `count` (number): How many
- `deployments` (list): The deployments

**Example output**

```json
{
  "count": 1,
  "deployments": [
    {
      "active_replica_count": 1,
      "autoscaling_settings": {
        "autoscaling_window": 60,
        "concurrency_target": 2,
        "max_replica": 2,
        "min_replica": 0,
        "scale_down_delay": 900,
        "target_utilization_percentage": 70
      },
      "created_at": "2026-11-01T09:00:00Z",
      "environment": "production",
      "id": "qwer5678",
      "instance_type_name": "1x L4",
      "is_development": false,
      "is_production": true,
      "labels": {},
      "model_id": "abcd1234",
      "name": "deployment-2",
      "status": "ACTIVE"
    }
  ]
}
```

### List environments

List a model's environments, such as production and staging, with the deployment each one serves.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.

**Outputs**

- `count` (number): How many
- `environments` (list): The environments

**Example output**

```json
{
  "count": 1,
  "environments": [
    {
      "autoscaling_settings": {
        "autoscaling_window": 60,
        "concurrency_target": 2,
        "max_replica": 2,
        "min_replica": 0,
        "scale_down_delay": 900,
        "target_utilization_percentage": 70
      },
      "candidate_deployment": {
        "active_replica_count": 1,
        "autoscaling_settings": {
          "autoscaling_window": 60,
          "concurrency_target": 2,
          "max_replica": 2,
          "min_replica": 0,
          "scale_down_delay": 900,
          "target_utilization_percentage": 70
        },
        "created_at": "2026-11-01T09:00:00Z",
        "environment": "production",
        "id": "zxcv9012",
        "instance_type_name": "1x L4",
        "is_development": false,
        "is_production": true,
        "labels": {},
        "model_id": "abcd1234",
        "name": "deployment-2",
        "status": "DEPLOYING"
      },
      "created_at": "2026-11-02T09:00:00Z",
      "current_deployment": {
        "active_replica_count": 1,
        "autoscaling_settings": {
          "autoscaling_window": 60,
          "concurrency_target": 2,
          "max_replica": 2,
          "min_replica": 0,
          "scale_down_delay": 900,
          "target_utilization_percentage": 70
        },
        "created_at": "2026-11-01T09:00:00Z",
        "environment": "production",
        "id": "qwer5678",
        "instance_type_name": "1x L4",
        "is_development": false,
        "is_production": true,
        "labels": {},
        "model_id": "abcd1234",
        "name": "deployment-2",
        "status": "ACTIVE"
      },
      "in_progress_promotion": {
        "percent_traffic_to_new_version": 0,
        "status": "RELEASING"
      },
      "instance_type": {
        "id": "L4x4x16",
        "name": "1x L4"
      },
      "model_id": "abcd1234",
      "name": "staging",
      "promotion_settings": {
        "rolling_deploy": true
      }
    }
  ]
}
```

### List models

List the models in your Baseten workspace, with their production and development deployments.

**Inputs**

- Name (`name`, text): Only the model with exactly this name.

**Outputs**

- `count` (number): How many
- `models` (list): The models

**Example output**

```json
{
  "count": 1,
  "models": [
    {
      "created_at": "2026-10-01T09:00:00Z",
      "deployments_count": 2,
      "development_deployment_id": "zxcv9012",
      "id": "abcd1234",
      "instance_type_name": "1x L4",
      "name": "Support summarizer",
      "production_deployment_id": "qwer5678",
      "team_name": "Default"
    }
  ]
}
```

### List secrets

List the names of the secrets your models can read, such as access tokens. Their values are never shown.

**Inputs**: None.

**Outputs**

- `count` (number): How many
- `secrets` (list): The secrets

**Example output**

```json
{
  "count": 1,
  "secrets": [
    {
      "created_at": "2026-11-01T09:00:00Z",
      "id": "sec123",
      "name": "hf_access_token",
      "team_name": "Default"
    }
  ]
}
```

### Promote deployment

Make a deployment the one an environment serves, such as moving a tested deployment into production.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.
- Deployment (`deployment_id`, text, required): The deployment: the model's production or development deployment, or one by its ID from an earlier step.
- Environment (`environment`, text): The environment to promote it to. Defaults to production.
- Scale down the one it replaces (`scale_down_previous`, true/false): Scale the deployment the environment served before down to zero. Baseten does this unless told not to.

**Outputs**

- `deployment` (object): The promoted deployment
- `environment` (text): The environment it was promoted to

**Example output**

```json
{
  "deployment": {
    "active_replica_count": 1,
    "autoscaling_settings": {
      "autoscaling_window": 60,
      "concurrency_target": 2,
      "max_replica": 2,
      "min_replica": 0,
      "scale_down_delay": 900,
      "target_utilization_percentage": 70
    },
    "created_at": "2026-11-01T09:00:00Z",
    "environment": "production",
    "id": "qwer5678",
    "instance_type_name": "1x L4",
    "is_development": false,
    "is_production": true,
    "labels": {},
    "model_id": "abcd1234",
    "name": "deployment-2",
    "status": "ACTIVE"
  },
  "environment": "production"
}
```

### Retry failed deployment

Build and deploy a failed deployment again. If it can't be retried, the result says why.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.
- Deployment (`deployment_id`, text, required): The deployment: the model's production or development deployment, or one by its ID from an earlier step.

**Outputs**

- `deployment` (object): The deployment
- `reason` (text): Why it couldn't be retried, if it wasn't
- `retried` (true/false): True if the retry started

**Example output**

```json
{
  "deployment": {
    "active_replica_count": 1,
    "autoscaling_settings": {
      "autoscaling_window": 60,
      "concurrency_target": 2,
      "max_replica": 2,
      "min_replica": 0,
      "scale_down_delay": 900,
      "target_utilization_percentage": 70
    },
    "created_at": "2026-11-01T09:00:00Z",
    "environment": "production",
    "id": "qwer5678",
    "instance_type_name": "1x L4",
    "is_development": false,
    "is_production": true,
    "labels": {},
    "model_id": "abcd1234",
    "name": "deployment-2",
    "status": "BUILDING"
  },
  "reason": "",
  "retried": true
}
```

### Save secret

Add a secret your models can read, or replace the value of the one with that name. Running deployments get the new value at once.

**Inputs**

- Name (`name`, text, required): The secret's name, such as hf_access_token. Baseten treats hf_access_token and hf-access-token as the same name.
- Value (`value`, text, required): The secret's value.

**Outputs**

- `secret` (object): The secret, without its value

**Example output**

```json
{
  "secret": {
    "created_at": "2026-11-01T09:00:00Z",
    "id": "sec123",
    "name": "hf_access_token",
    "team_name": "Default"
  }
}
```

### Update autoscaling

Change how many replicas a deployment runs and when it adds or removes them. Only the settings you fill in change; the rest keep their values.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.
- Deployment (`deployment_id`, text, required): The deployment: the model's production or development deployment, or one by its ID from an earlier step.
- Minimum replicas (`min_replica`, number): The fewest copies of the model kept running. 0 lets it scale to zero when idle. From 0 to 1000.
- Maximum replicas (`max_replica`, number): The most copies of the model it may run at busy times. From 1 to 1000.
- Requests per replica (`concurrency_target`, number): How many requests one replica handles at once before another is added. From 1 to 100000.
- Target utilization (%) (`target_utilization_percentage`, number): How much of the requests-per-replica figure to aim for, 1 to 100, leaving headroom for bursts. From 1 to 100.
- Autoscaling window (seconds) (`autoscaling_window`, number): How many seconds of recent traffic to look at when deciding to scale. From 1 to 86400.
- Scale-down delay (seconds) (`scale_down_delay`, number): How many seconds to wait before removing a replica once traffic drops. From 0 to 86400.

**Outputs**

- `autoscaling_settings` (object): The settings once the change applies
- `changed` (list): The settings that changed
- `message` (text): What Baseten said
- `status` (text): ACCEPTED, QUEUED or UNCHANGED

**Example output**

```json
{
  "autoscaling_settings": {
    "autoscaling_window": 60,
    "concurrency_target": 2,
    "max_replica": 2,
    "min_replica": 1,
    "scale_down_delay": 900,
    "target_utilization_percentage": 70
  },
  "changed": [
    "min_replica"
  ],
  "message": "Autoscaling settings update accepted",
  "status": "ACCEPTED"
}
```

### Wake model

Start a model that has scaled to zero, ahead of the requests you expect, so nobody waits for it to load. Returns at once.

**Inputs**

- Model (`model_id`, text, required): The model. Pick one, or give its ID from an earlier step.
- Environment (`environment`, text): The environment to wake. Defaults to production.
- Deployment (`deployment_id`, text): A deployment to wake instead of an environment, such as the development deployment. Leave empty to use the environment.

**Outputs**

- `called` (text): What was called, such as production environment
- `woken` (true/false): Always true once asked

**Example output**

```json
{
  "called": "production environment",
  "woken": true
}
```
