# gram upload

The `upload` command uploads one asset — an OpenAPI document or a functions
bundle — and deploys it in a single step. Where [`gram
stage`](/docs/ai-control-plane/reference/command-line/stage) and [`gram
push`](/docs/ai-control-plane/reference/command-line/push) work from a
`gram.deploy.json` file describing several sources, `upload` takes the asset's
details as flags, so it needs no configuration file.

If the project already has a deployment, the uploaded asset evolves it (the
previous deployment is cloned with the new asset added). If the project has no
deployment yet, a new one is created.

> The `gram upload` command requires an API key, an organization slug, and a
> project slug. After running `gram auth`, these values come from the local
> profile. For more information on these values, see the [global CLI
> options](/docs/ai-control-plane/reference/command-line#global-cli-options).

## Usage

```bash
gram upload --type openapiv3 \
  --location https://raw.githubusercontent.com/my/spec.yaml \
  --name "My API" \
  --slug my-api
```

## Options

### type (required)

The type of asset to upload: `openapiv3` or `functions`.

### location (required)

The location of the asset, as a local file path or a URL.

### name (required)

The human-readable name of the asset.

### slug (required)

The URL-friendly slug for the asset. Names and slugs must be unique across all
sources in the target project.

### runtime

The runtime to use for function execution. Required when the type is
`functions`.

```bash
gram upload --type functions --runtime nodejs:22 [command options]
```

### scale

The number of instances to run for a function.

### memory-mib

The amount of memory, in MiB, to allocate for the function.
