---
title: Environments | Runware Docs
url: https://runware.ai/docs/serverless/api-environments
description: Create the environments an organization runs apps in, set their caps and budget, and read the defaults they inherit.
relatedDocuments:
  - https://runware.ai/docs/serverless/api
  - https://runware.ai/docs/serverless/environments
  - https://runware.ai/docs/serverless/api-apps
---
## Introduction

An environment is **the place an app id runs in**, and every other app route takes its name in `environment`. Omitted, they address `production`, which every organization has.

The two halves of this page are separate: an environment carries the caps and the budget set on it, and **the organization carries the defaults an environment inherits** for every field it leaves empty. Each environment reports both, the second under `resolved`.

> [!NOTE]
> `production` is created on the first read that needs it, so an organization that has never opened this page still lists one.

## List environments

GETapi.serverless.runware.ai/v1/environments

Returns the organization's environments, `production` first and then by name. `production` is the environment an operation targets when none is named, and it is created here when the organization does not have it yet, except for an organization whose deletion is pending. `q` narrows the list to names containing it, ignoring case. Each entry carries the values set on the environment and, under `resolved`, the values in force after inheriting the organization defaults.

### [Request](#list-environments-request)

Query

### [q](#list-environments-query-q)

- **Type**: `string`
- **Min**: `1`
- **Max**: `63`

Case-insensitive substring of the environment name. Omit to list every environment.

### [Response](#list-environments-response)

### [data](#list-environments-response-data)

- **Type**: `object[] (16 properties)`
- **Required**: true

#### [name](#list-environments-response-data-name)

- **Type**: `string`
- **Required**: true
- **Min**: `1`
- **Max**: `63`

Lowercase letters, digits, hyphens, underscores and periods, starting with a letter or a digit, at most 63 characters. Unique among the organization's live environments and immutable. `production` is every organization's default.

#### [isDefault](#list-environments-response-data-isdefault)

- **Type**: `boolean`
- **Required**: true

True for `production`, the environment an operation targets when none is named. It cannot be deleted.

#### [maxConcurrentWorkers](#list-environments-response-data-maxconcurrentworkers)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the workers the environment holds, checked when a request adds capacity, as set on the environment. Empty inherits the organization default; `resolved` carries the cap in force.

#### [maxConcurrentGpus](#list-environments-response-data-maxconcurrentgpus)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the GPUs the environment holds, checked when a request adds capacity, as set on the environment. Empty inherits the organization default; `resolved` carries the cap in force.

#### [monthlyBudget](#list-environments-response-data-monthlybudget)

- **Type**: `object (2 properties, nullable)`

Pay-as-you-go spend cap for the calendar month, which resets on the 1st at 00:00 UTC. Spend is read from settlement, which trails usage by a few minutes and a worker's end-of-life adjustment by up to about twenty, and leaves out usage a capacity commitment covers. Empty means no cap.

##### [amount](#list-environments-response-data-monthlybudget-amount)

- **Type**: `string`
- **Required**: true

Amount in major units as an exact decimal string.

##### [currency](#list-environments-response-data-monthlybudget-currency)

- **Type**: `string`
- **Required**: true

ISO 4217 alphabetic code. The platform bills in USD only.

**Possible values**: `USD`

#### [budgetAlertPercents](#list-environments-response-data-budgetalertpercents)

- **Type**: `integer[]`
- **Required**: true

Percentages of the budget at which the organization's users are emailed, ascending. Each is sent at most once per UTC month, even when the budget changes later in the month; percents reached together send one alert, for the highest. A `"0.00"` budget alerts on the first spend above zero. Empty sends no alert.

#### [pauseAtBudget](#list-environments-response-data-pauseatbudget)

- **Type**: `boolean`
- **Required**: true

Whether the environment is paused once its spend this UTC month reaches the budget: its apps are stopped, and invocation and requests that add capacity are refused until the budget is raised past the spend or the month turns. A budget of zero pauses at the first spend.

#### [unauthenticatedAccess](#list-environments-response-data-unauthenticatedaccess)

- **Type**: `string (nullable)`

As set on the environment. Empty inherits the organization default; `resolved` carries the setting in force.

**Possible values**: `allow`

#### [resolved](#list-environments-response-data-resolved)

- **Type**: `object (3 properties)`
- **Required**: true

The values in force after inheritance: the environment's own value where it set one, the organization default otherwise.

##### [maxConcurrentWorkers](#list-environments-response-data-resolved-maxconcurrentworkers)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the workers the environment holds, checked when a request adds capacity. Empty means no cap.

##### [maxConcurrentGpus](#list-environments-response-data-resolved-maxconcurrentgpus)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the GPUs the environment holds, checked when a request adds capacity. Empty means no cap.

##### [unauthenticatedAccess](#list-environments-response-data-resolved-unauthenticatedaccess)

- **Type**: `string`
- **Required**: true

Whether a new deployment may expose its endpoints without an API key.

**Possible values**: `deny` `allow`

#### [createdAt](#list-environments-response-data-createdat)

- **Type**: `string (date-time)`
- **Required**: true
- **Format**: `date-time`

#### [updatedAt](#list-environments-response-data-updatedat)

- **Type**: `string (date-time)`
- **Required**: true
- **Format**: `date-time`

### [Errors](#list-environments-errors)

<table><tbody><tr><td data-rw-cid-pz7tphoj="true">Status</td><td data-rw-cid-pz7tphoj="true">When</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">401</code></td><td data-rw-cid-pz7tphoj="true">Missing or invalid credentials</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">422</code></td><td data-rw-cid-pz7tphoj="true">The request was well-formed but semantically invalid (e.g. a missing or out-of-range field). A request that could not be parsed returns <code class="component-Code">400</code>. The <code class="component-Code">errors</code> array carries one entry per offending field.</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">500</code></td><td data-rw-cid-pz7tphoj="true">Unexpected server error</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">503</code></td><td data-rw-cid-pz7tphoj="true">A required service is temporarily unavailable</td></tr></tbody></table>

## Create an environment

POSTapi.serverless.runware.ai/v1/environments

Creates an environment under a name no live environment holds; a deleted environment's name can be reused. A limit left empty inherits the organization default, a budget left empty means no cap, and `unauthenticatedAccess` left empty inherits the organization default. Returns `409` when a live environment already has the name. An organization whose deletion is pending returns `403`.

### [Request](#create-environment-request)

Body

### [name](#create-environment-body-name)

- **Type**: `string`
- **Required**: true
- **Min**: `1`
- **Max**: `63`

Lowercase letters, digits, hyphens, underscores and periods, starting with a letter or a digit, at most 63 characters. Unique among the organization's live environments and immutable. `production` is every organization's default.

### [maxConcurrentWorkers](#create-environment-body-maxconcurrentworkers)

- **Type**: `integer (nullable)`
- **Format**: `int32`
- **Min**: `0`

Cap on the workers the environment holds, checked when a request adds capacity. Omit, or send `null`, to inherit the organization default.

### [maxConcurrentGpus](#create-environment-body-maxconcurrentgpus)

- **Type**: `integer (nullable)`
- **Format**: `int32`
- **Min**: `0`

Cap on the GPUs the environment holds, checked when a request adds capacity. Omit, or send `null`, to inherit the organization default.

### [monthlyBudget](#create-environment-body-monthlybudget)

- **Type**: `object (2 properties, nullable)`

Pay-as-you-go spend cap for the calendar month, which resets on the 1st at 00:00 UTC. USD, written with one to six decimal places (`"500.00"`); `"0.00"` is a cap reached at once. Omit, or send `null`, for no cap.

#### [amount](#create-environment-body-monthlybudget-amount)

- **Type**: `string`
- **Required**: true

Amount in major units as an exact decimal string.

#### [currency](#create-environment-body-monthlybudget-currency)

- **Type**: `string`
- **Required**: true

ISO 4217 alphabetic code. The platform bills in USD only.

**Allowed values**: `USD`

### [budgetAlertPercents](#create-environment-body-budgetalertpercents)

- **Type**: `integer[]`
- **Max items**: `10`

Percentages of the budget at which the organization's users are emailed, each once per month. Stored ascending with duplicates removed; an empty array sends no alert. Omit for 50, 80 and 100.

### [pauseAtBudget](#create-environment-body-pauseatbudget)

- **Type**: `boolean`

Pause the environment once its spend this UTC month reaches the budget: stop its apps, and refuse invocation and requests that add capacity until the budget is raised past the spend or the month turns. Omit for `false`.

### [unauthenticatedAccess](#create-environment-body-unauthenticatedaccess)

- **Type**: `string (nullable)`

Omit, or send `null`, to inherit the organization default.

**Allowed values**: `allow`

### [Response](#create-environment-response)

### [name](#create-environment-response-name)

- **Type**: `string`
- **Required**: true
- **Min**: `1`
- **Max**: `63`

Lowercase letters, digits, hyphens, underscores and periods, starting with a letter or a digit, at most 63 characters. Unique among the organization's live environments and immutable. `production` is every organization's default.

### [isDefault](#create-environment-response-isdefault)

- **Type**: `boolean`
- **Required**: true

True for `production`, the environment an operation targets when none is named. It cannot be deleted.

### [maxConcurrentWorkers](#create-environment-response-maxconcurrentworkers)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the workers the environment holds, checked when a request adds capacity, as set on the environment. Empty inherits the organization default; `resolved` carries the cap in force.

### [maxConcurrentGpus](#create-environment-response-maxconcurrentgpus)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the GPUs the environment holds, checked when a request adds capacity, as set on the environment. Empty inherits the organization default; `resolved` carries the cap in force.

### [monthlyBudget](#create-environment-response-monthlybudget)

- **Type**: `object (2 properties, nullable)`

Pay-as-you-go spend cap for the calendar month, which resets on the 1st at 00:00 UTC. Spend is read from settlement, which trails usage by a few minutes and a worker's end-of-life adjustment by up to about twenty, and leaves out usage a capacity commitment covers. Empty means no cap.

#### [amount](#create-environment-response-monthlybudget-amount)

- **Type**: `string`
- **Required**: true

Amount in major units as an exact decimal string.

#### [currency](#create-environment-response-monthlybudget-currency)

- **Type**: `string`
- **Required**: true

ISO 4217 alphabetic code. The platform bills in USD only.

**Possible values**: `USD`

### [budgetAlertPercents](#create-environment-response-budgetalertpercents)

- **Type**: `integer[]`
- **Required**: true

Percentages of the budget at which the organization's users are emailed, ascending. Each is sent at most once per UTC month, even when the budget changes later in the month; percents reached together send one alert, for the highest. A `"0.00"` budget alerts on the first spend above zero. Empty sends no alert.

### [pauseAtBudget](#create-environment-response-pauseatbudget)

- **Type**: `boolean`
- **Required**: true

Whether the environment is paused once its spend this UTC month reaches the budget: its apps are stopped, and invocation and requests that add capacity are refused until the budget is raised past the spend or the month turns. A budget of zero pauses at the first spend.

### [unauthenticatedAccess](#create-environment-response-unauthenticatedaccess)

- **Type**: `string (nullable)`

As set on the environment. Empty inherits the organization default; `resolved` carries the setting in force.

**Possible values**: `allow`

### [resolved](#create-environment-response-resolved)

- **Type**: `object (3 properties)`
- **Required**: true

The values in force after inheritance: the environment's own value where it set one, the organization default otherwise.

#### [maxConcurrentWorkers](#create-environment-response-resolved-maxconcurrentworkers)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the workers the environment holds, checked when a request adds capacity. Empty means no cap.

#### [maxConcurrentGpus](#create-environment-response-resolved-maxconcurrentgpus)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the GPUs the environment holds, checked when a request adds capacity. Empty means no cap.

#### [unauthenticatedAccess](#create-environment-response-resolved-unauthenticatedaccess)

- **Type**: `string`
- **Required**: true

Whether a new deployment may expose its endpoints without an API key.

**Possible values**: `deny` `allow`

### [createdAt](#create-environment-response-createdat)

- **Type**: `string (date-time)`
- **Required**: true
- **Format**: `date-time`

### [updatedAt](#create-environment-response-updatedat)

- **Type**: `string (date-time)`
- **Required**: true
- **Format**: `date-time`

### [Errors](#create-environment-errors)

<table><tbody><tr><td data-rw-cid-pz7tphoj="true">Status</td><td data-rw-cid-pz7tphoj="true">When</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">400</code></td><td data-rw-cid-pz7tphoj="true">The request was malformed and could not be parsed (e.g. invalid JSON). A well-formed request that fails validation returns <code class="component-Code">422</code> instead.</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">401</code></td><td data-rw-cid-pz7tphoj="true">Missing or invalid credentials</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">403</code></td><td data-rw-cid-pz7tphoj="true">Authenticated but not permitted to access this resource</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">409</code></td><td data-rw-cid-pz7tphoj="true">Resource already exists or the request conflicts with its current state</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">413</code></td><td data-rw-cid-pz7tphoj="true">The request body exceeds its size limit: 10 MiB on <code class="component-Code">invoke-sync</code> and <code class="component-Code">invoke-async</code>, whose body carries the endpoint's payload, and 1 MiB on the other operations that answer with this response. <code class="component-Code">detail</code> names the limit in bytes.</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">415</code></td><td data-rw-cid-pz7tphoj="true">The request body arrived with a Content-Type this operation does not accept. The body was not decoded, so this is not a schema failure. A body of <code class="component-Code">application/json</code> that cannot be parsed returns <code class="component-Code">400</code>. One that parses and breaks the schema returns <code class="component-Code">422</code>. A body sent with no Content-Type is the same refusal.</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">422</code></td><td data-rw-cid-pz7tphoj="true">The request was well-formed but semantically invalid (e.g. a missing or out-of-range field). A request that could not be parsed returns <code class="component-Code">400</code>. The <code class="component-Code">errors</code> array carries one entry per offending field.</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">500</code></td><td data-rw-cid-pz7tphoj="true">Unexpected server error</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">503</code></td><td data-rw-cid-pz7tphoj="true">A required service is temporarily unavailable</td></tr></tbody></table>

## Get an environment

GETapi.serverless.runware.ai/v1/environments/{environmentName}

Returns one environment, with the values set on it and the values in force after inheritance. `production` is created here when the organization does not have it yet.

### [Request](#get-environment-request)

Path

### [environmentName](#get-environment-path-environmentname)

- **Type**: `string`
- **Required**: true
- **Min**: `1`
- **Max**: `63`

Name of one of the authenticated organization's live environments.

### [Response](#get-environment-response)

### [name](#get-environment-response-name)

- **Type**: `string`
- **Required**: true
- **Min**: `1`
- **Max**: `63`

Lowercase letters, digits, hyphens, underscores and periods, starting with a letter or a digit, at most 63 characters. Unique among the organization's live environments and immutable. `production` is every organization's default.

### [isDefault](#get-environment-response-isdefault)

- **Type**: `boolean`
- **Required**: true

True for `production`, the environment an operation targets when none is named. It cannot be deleted.

### [maxConcurrentWorkers](#get-environment-response-maxconcurrentworkers)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the workers the environment holds, checked when a request adds capacity, as set on the environment. Empty inherits the organization default; `resolved` carries the cap in force.

### [maxConcurrentGpus](#get-environment-response-maxconcurrentgpus)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the GPUs the environment holds, checked when a request adds capacity, as set on the environment. Empty inherits the organization default; `resolved` carries the cap in force.

### [monthlyBudget](#get-environment-response-monthlybudget)

- **Type**: `object (2 properties, nullable)`

Pay-as-you-go spend cap for the calendar month, which resets on the 1st at 00:00 UTC. Spend is read from settlement, which trails usage by a few minutes and a worker's end-of-life adjustment by up to about twenty, and leaves out usage a capacity commitment covers. Empty means no cap.

#### [amount](#get-environment-response-monthlybudget-amount)

- **Type**: `string`
- **Required**: true

Amount in major units as an exact decimal string.

#### [currency](#get-environment-response-monthlybudget-currency)

- **Type**: `string`
- **Required**: true

ISO 4217 alphabetic code. The platform bills in USD only.

**Possible values**: `USD`

### [budgetAlertPercents](#get-environment-response-budgetalertpercents)

- **Type**: `integer[]`
- **Required**: true

Percentages of the budget at which the organization's users are emailed, ascending. Each is sent at most once per UTC month, even when the budget changes later in the month; percents reached together send one alert, for the highest. A `"0.00"` budget alerts on the first spend above zero. Empty sends no alert.

### [pauseAtBudget](#get-environment-response-pauseatbudget)

- **Type**: `boolean`
- **Required**: true

Whether the environment is paused once its spend this UTC month reaches the budget: its apps are stopped, and invocation and requests that add capacity are refused until the budget is raised past the spend or the month turns. A budget of zero pauses at the first spend.

### [unauthenticatedAccess](#get-environment-response-unauthenticatedaccess)

- **Type**: `string (nullable)`

As set on the environment. Empty inherits the organization default; `resolved` carries the setting in force.

**Possible values**: `allow`

### [resolved](#get-environment-response-resolved)

- **Type**: `object (3 properties)`
- **Required**: true

The values in force after inheritance: the environment's own value where it set one, the organization default otherwise.

#### [maxConcurrentWorkers](#get-environment-response-resolved-maxconcurrentworkers)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the workers the environment holds, checked when a request adds capacity. Empty means no cap.

#### [maxConcurrentGpus](#get-environment-response-resolved-maxconcurrentgpus)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the GPUs the environment holds, checked when a request adds capacity. Empty means no cap.

#### [unauthenticatedAccess](#get-environment-response-resolved-unauthenticatedaccess)

- **Type**: `string`
- **Required**: true

Whether a new deployment may expose its endpoints without an API key.

**Possible values**: `deny` `allow`

### [createdAt](#get-environment-response-createdat)

- **Type**: `string (date-time)`
- **Required**: true
- **Format**: `date-time`

### [updatedAt](#get-environment-response-updatedat)

- **Type**: `string (date-time)`
- **Required**: true
- **Format**: `date-time`

### [Errors](#get-environment-errors)

<table><tbody><tr><td data-rw-cid-pz7tphoj="true">Status</td><td data-rw-cid-pz7tphoj="true">When</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">401</code></td><td data-rw-cid-pz7tphoj="true">Missing or invalid credentials</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">404</code></td><td data-rw-cid-pz7tphoj="true">Resource not found</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">422</code></td><td data-rw-cid-pz7tphoj="true">The request was well-formed but semantically invalid (e.g. a missing or out-of-range field). A request that could not be parsed returns <code class="component-Code">400</code>. The <code class="component-Code">errors</code> array carries one entry per offending field.</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">500</code></td><td data-rw-cid-pz7tphoj="true">Unexpected server error</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">503</code></td><td data-rw-cid-pz7tphoj="true">A required service is temporarily unavailable</td></tr></tbody></table>

## Update an environment

PATCHapi.serverless.runware.ai/v1/environments/{environmentName}

Changes the fields the body names and leaves the rest as they are. A field sent as `null` is cleared: a limit inherits the organization default again, the budget is removed, and `unauthenticatedAccess` inherits the organization default again. The name cannot change. `production` takes every change an environment takes. An organization whose deletion is pending returns `403`.

### [Request](#update-environment-request)

Path

### [environmentName](#update-environment-path-environmentname)

- **Type**: `string`
- **Required**: true
- **Min**: `1`
- **Max**: `63`

Name of one of the authenticated organization's live environments.

Body

### [maxConcurrentWorkers](#update-environment-body-maxconcurrentworkers)

- **Type**: `integer (nullable)`
- **Format**: `int32`
- **Min**: `0`

Cap on the workers the environment holds, checked when a request adds capacity. `null` inherits the organization default again.

### [maxConcurrentGpus](#update-environment-body-maxconcurrentgpus)

- **Type**: `integer (nullable)`
- **Format**: `int32`
- **Min**: `0`

Cap on the GPUs the environment holds, checked when a request adds capacity. `null` inherits the organization default again.

### [monthlyBudget](#update-environment-body-monthlybudget)

- **Type**: `object (2 properties, nullable)`

Pay-as-you-go spend cap for the calendar month, which resets on the 1st at 00:00 UTC. USD, written with one to six decimal places (`"500.00"`); `"0.00"` is a cap reached at once. `null` removes the cap.

#### [amount](#update-environment-body-monthlybudget-amount)

- **Type**: `string`
- **Required**: true

Amount in major units as an exact decimal string.

#### [currency](#update-environment-body-monthlybudget-currency)

- **Type**: `string`
- **Required**: true

ISO 4217 alphabetic code. The platform bills in USD only.

**Allowed values**: `USD`

### [budgetAlertPercents](#update-environment-body-budgetalertpercents)

- **Type**: `integer[]`
- **Max items**: `10`

Percentages of the budget at which the organization's users are emailed, each once per month. Stored ascending with duplicates removed; an empty array sends no alert.

### [pauseAtBudget](#update-environment-body-pauseatbudget)

- **Type**: `boolean`

Pause the environment once its spend this UTC month reaches the budget: stop its apps, and refuse invocation and requests that add capacity until the budget is raised past the spend or the month turns.

### [unauthenticatedAccess](#update-environment-body-unauthenticatedaccess)

- **Type**: `string (nullable)`

`null` inherits the organization default again.

**Allowed values**: `allow`

### [Response](#update-environment-response)

### [name](#update-environment-response-name)

- **Type**: `string`
- **Required**: true
- **Min**: `1`
- **Max**: `63`

Lowercase letters, digits, hyphens, underscores and periods, starting with a letter or a digit, at most 63 characters. Unique among the organization's live environments and immutable. `production` is every organization's default.

### [isDefault](#update-environment-response-isdefault)

- **Type**: `boolean`
- **Required**: true

True for `production`, the environment an operation targets when none is named. It cannot be deleted.

### [maxConcurrentWorkers](#update-environment-response-maxconcurrentworkers)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the workers the environment holds, checked when a request adds capacity, as set on the environment. Empty inherits the organization default; `resolved` carries the cap in force.

### [maxConcurrentGpus](#update-environment-response-maxconcurrentgpus)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the GPUs the environment holds, checked when a request adds capacity, as set on the environment. Empty inherits the organization default; `resolved` carries the cap in force.

### [monthlyBudget](#update-environment-response-monthlybudget)

- **Type**: `object (2 properties, nullable)`

Pay-as-you-go spend cap for the calendar month, which resets on the 1st at 00:00 UTC. Spend is read from settlement, which trails usage by a few minutes and a worker's end-of-life adjustment by up to about twenty, and leaves out usage a capacity commitment covers. Empty means no cap.

#### [amount](#update-environment-response-monthlybudget-amount)

- **Type**: `string`
- **Required**: true

Amount in major units as an exact decimal string.

#### [currency](#update-environment-response-monthlybudget-currency)

- **Type**: `string`
- **Required**: true

ISO 4217 alphabetic code. The platform bills in USD only.

**Possible values**: `USD`

### [budgetAlertPercents](#update-environment-response-budgetalertpercents)

- **Type**: `integer[]`
- **Required**: true

Percentages of the budget at which the organization's users are emailed, ascending. Each is sent at most once per UTC month, even when the budget changes later in the month; percents reached together send one alert, for the highest. A `"0.00"` budget alerts on the first spend above zero. Empty sends no alert.

### [pauseAtBudget](#update-environment-response-pauseatbudget)

- **Type**: `boolean`
- **Required**: true

Whether the environment is paused once its spend this UTC month reaches the budget: its apps are stopped, and invocation and requests that add capacity are refused until the budget is raised past the spend or the month turns. A budget of zero pauses at the first spend.

### [unauthenticatedAccess](#update-environment-response-unauthenticatedaccess)

- **Type**: `string (nullable)`

As set on the environment. Empty inherits the organization default; `resolved` carries the setting in force.

**Possible values**: `allow`

### [resolved](#update-environment-response-resolved)

- **Type**: `object (3 properties)`
- **Required**: true

The values in force after inheritance: the environment's own value where it set one, the organization default otherwise.

#### [maxConcurrentWorkers](#update-environment-response-resolved-maxconcurrentworkers)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the workers the environment holds, checked when a request adds capacity. Empty means no cap.

#### [maxConcurrentGpus](#update-environment-response-resolved-maxconcurrentgpus)

- **Type**: `integer (nullable)`
- **Format**: `int32`

Cap on the GPUs the environment holds, checked when a request adds capacity. Empty means no cap.

#### [unauthenticatedAccess](#update-environment-response-resolved-unauthenticatedaccess)

- **Type**: `string`
- **Required**: true

Whether a new deployment may expose its endpoints without an API key.

**Possible values**: `deny` `allow`

### [createdAt](#update-environment-response-createdat)

- **Type**: `string (date-time)`
- **Required**: true
- **Format**: `date-time`

### [updatedAt](#update-environment-response-updatedat)

- **Type**: `string (date-time)`
- **Required**: true
- **Format**: `date-time`

### [Errors](#update-environment-errors)

<table><tbody><tr><td data-rw-cid-pz7tphoj="true">Status</td><td data-rw-cid-pz7tphoj="true">When</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">400</code></td><td data-rw-cid-pz7tphoj="true">The request was malformed and could not be parsed (e.g. invalid JSON). A well-formed request that fails validation returns <code class="component-Code">422</code> instead.</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">401</code></td><td data-rw-cid-pz7tphoj="true">Missing or invalid credentials</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">403</code></td><td data-rw-cid-pz7tphoj="true">Authenticated but not permitted to access this resource</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">404</code></td><td data-rw-cid-pz7tphoj="true">Resource not found</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">413</code></td><td data-rw-cid-pz7tphoj="true">The request body exceeds its size limit: 10 MiB on <code class="component-Code">invoke-sync</code> and <code class="component-Code">invoke-async</code>, whose body carries the endpoint's payload, and 1 MiB on the other operations that answer with this response. <code class="component-Code">detail</code> names the limit in bytes.</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">415</code></td><td data-rw-cid-pz7tphoj="true">The request body arrived with a Content-Type this operation does not accept. The body was not decoded, so this is not a schema failure. A body of <code class="component-Code">application/json</code> that cannot be parsed returns <code class="component-Code">400</code>. One that parses and breaks the schema returns <code class="component-Code">422</code>. A body sent with no Content-Type is the same refusal.</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">422</code></td><td data-rw-cid-pz7tphoj="true">The request was well-formed but semantically invalid (e.g. a missing or out-of-range field). A request that could not be parsed returns <code class="component-Code">400</code>. The <code class="component-Code">errors</code> array carries one entry per offending field.</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">500</code></td><td data-rw-cid-pz7tphoj="true">Unexpected server error</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">503</code></td><td data-rw-cid-pz7tphoj="true">A required service is temporarily unavailable</td></tr></tbody></table>

## Delete an environment

DELETEapi.serverless.runware.ai/v1/environments/{environmentName}

Deletes an environment that has no live app and no secret. An environment that still has either answers `409`, and so does `production`, which every organization keeps. The name becomes available to a new environment; a deleted app's history still names the environment it ran in. An organization whose deletion is pending returns `403`.

### [Request](#delete-environment-request)

Path

### [environmentName](#delete-environment-path-environmentname)

- **Type**: `string`
- **Required**: true
- **Min**: `1`
- **Max**: `63`

Name of one of the authenticated organization's live environments.

### [Errors](#delete-environment-errors)

<table><tbody><tr><td data-rw-cid-pz7tphoj="true">Status</td><td data-rw-cid-pz7tphoj="true">When</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">401</code></td><td data-rw-cid-pz7tphoj="true">Missing or invalid credentials</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">403</code></td><td data-rw-cid-pz7tphoj="true">Authenticated but not permitted to access this resource</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">404</code></td><td data-rw-cid-pz7tphoj="true">Resource not found</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">409</code></td><td data-rw-cid-pz7tphoj="true">Resource already exists or the request conflicts with its current state</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">422</code></td><td data-rw-cid-pz7tphoj="true">The request was well-formed but semantically invalid (e.g. a missing or out-of-range field). A request that could not be parsed returns <code class="component-Code">400</code>. The <code class="component-Code">errors</code> array carries one entry per offending field.</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">500</code></td><td data-rw-cid-pz7tphoj="true">Unexpected server error</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">503</code></td><td data-rw-cid-pz7tphoj="true">A required service is temporarily unavailable</td></tr></tbody></table>

## Get the organization defaults

GETapi.serverless.runware.ai/v1/environment-defaults

Returns the limits and the access setting an environment inherits for every field it leaves empty. An organization that has never set them has no caps and allows unauthenticated access. The worker and GPU caps are checked on create, on a source change to an initializing, active or failed app, on a configuration change that adds workers or GPUs or restarts a failed app, on a deploy that rolls out, and on resume, against each app's larger of its live workers and its keep-warm floor; they do not bound autoscaling. Unauthenticated access is stored but not yet enforced.

### [Response](#get-environment-defaults-response)

### [maxConcurrentWorkers](#get-environment-defaults-response-maxconcurrentworkers)

- **Type**: `integer (nullable)`
- **Format**: `int32`
- **Min**: `0`

Worker cap of an environment that sets none of its own, checked when a request adds capacity. Empty means no cap.

### [maxConcurrentGpus](#get-environment-defaults-response-maxconcurrentgpus)

- **Type**: `integer (nullable)`
- **Format**: `int32`
- **Min**: `0`

GPU cap of an environment that sets none of its own, checked when a request adds capacity. Empty means no cap.

### [unauthenticatedAccess](#get-environment-defaults-response-unauthenticatedaccess)

- **Type**: `string`
- **Required**: true

Whether a new deployment in an environment that sets nothing of its own may expose its endpoints without an API key.

**Possible values**: `deny` `allow`

### [Errors](#get-environment-defaults-errors)

<table><tbody><tr><td data-rw-cid-pz7tphoj="true">Status</td><td data-rw-cid-pz7tphoj="true">When</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">401</code></td><td data-rw-cid-pz7tphoj="true">Missing or invalid credentials</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">500</code></td><td data-rw-cid-pz7tphoj="true">Unexpected server error</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">503</code></td><td data-rw-cid-pz7tphoj="true">A required service is temporarily unavailable</td></tr></tbody></table>

## Replace the organization defaults

PUTapi.serverless.runware.ai/v1/environment-defaults

Replaces the organization defaults as a whole: a limit left out of the body means no cap. The change reaches every environment that inherits the field at once; it does not roll apps already running. An organization whose deletion is pending returns `403`.

### [Request](#put-environment-defaults-request)

Body

### [maxConcurrentWorkers](#put-environment-defaults-body-maxconcurrentworkers)

- **Type**: `integer (nullable)`
- **Format**: `int32`
- **Min**: `0`

Worker cap of an environment that sets none of its own, checked when a request adds capacity. Empty means no cap.

### [maxConcurrentGpus](#put-environment-defaults-body-maxconcurrentgpus)

- **Type**: `integer (nullable)`
- **Format**: `int32`
- **Min**: `0`

GPU cap of an environment that sets none of its own, checked when a request adds capacity. Empty means no cap.

### [unauthenticatedAccess](#put-environment-defaults-body-unauthenticatedaccess)

- **Type**: `string`
- **Required**: true

Whether a new deployment in an environment that sets nothing of its own may expose its endpoints without an API key.

**Allowed values**: `deny` `allow`

### [Response](#put-environment-defaults-response)

### [maxConcurrentWorkers](#put-environment-defaults-response-maxconcurrentworkers)

- **Type**: `integer (nullable)`
- **Format**: `int32`
- **Min**: `0`

Worker cap of an environment that sets none of its own, checked when a request adds capacity. Empty means no cap.

### [maxConcurrentGpus](#put-environment-defaults-response-maxconcurrentgpus)

- **Type**: `integer (nullable)`
- **Format**: `int32`
- **Min**: `0`

GPU cap of an environment that sets none of its own, checked when a request adds capacity. Empty means no cap.

### [unauthenticatedAccess](#put-environment-defaults-response-unauthenticatedaccess)

- **Type**: `string`
- **Required**: true

Whether a new deployment in an environment that sets nothing of its own may expose its endpoints without an API key.

**Possible values**: `deny` `allow`

### [Errors](#put-environment-defaults-errors)

<table><tbody><tr><td data-rw-cid-pz7tphoj="true">Status</td><td data-rw-cid-pz7tphoj="true">When</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">400</code></td><td data-rw-cid-pz7tphoj="true">The request was malformed and could not be parsed (e.g. invalid JSON). A well-formed request that fails validation returns <code class="component-Code">422</code> instead.</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">401</code></td><td data-rw-cid-pz7tphoj="true">Missing or invalid credentials</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">403</code></td><td data-rw-cid-pz7tphoj="true">Authenticated but not permitted to access this resource</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">413</code></td><td data-rw-cid-pz7tphoj="true">The request body exceeds its size limit: 10 MiB on <code class="component-Code">invoke-sync</code> and <code class="component-Code">invoke-async</code>, whose body carries the endpoint's payload, and 1 MiB on the other operations that answer with this response. <code class="component-Code">detail</code> names the limit in bytes.</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">415</code></td><td data-rw-cid-pz7tphoj="true">The request body arrived with a Content-Type this operation does not accept. The body was not decoded, so this is not a schema failure. A body of <code class="component-Code">application/json</code> that cannot be parsed returns <code class="component-Code">400</code>. One that parses and breaks the schema returns <code class="component-Code">422</code>. A body sent with no Content-Type is the same refusal.</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">422</code></td><td data-rw-cid-pz7tphoj="true">The request was well-formed but semantically invalid (e.g. a missing or out-of-range field). A request that could not be parsed returns <code class="component-Code">400</code>. The <code class="component-Code">errors</code> array carries one entry per offending field.</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">500</code></td><td data-rw-cid-pz7tphoj="true">Unexpected server error</td></tr><tr><td data-rw-cid-pz7tphoj="true"><code data-rw-cid-pz7tphoj="">503</code></td><td data-rw-cid-pz7tphoj="true">A required service is temporarily unavailable</td></tr></tbody></table>