> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baseten.co/llms.txt
> Use this file to discover all available pages before exploring further.

# baseten grid connection

> Manage provider connections (PRE-RELEASE)

> [!NOTE]
>
> Grid commands are in pre-release and support macOS and Linux. Their arguments, flags, and output can change.

A connection lets routes use an external provider without storing that provider's API key in each route. It points to an existing team secret. To rotate credentials for every route that uses a connection, update the connection to point to another secret; the routes don't change.

## `list`

```sh theme={"system"}
baseten grid connection list [OPTIONS]
```

List connections across your teams; use `--team` to select one. In scripts that expect results from one team, always pass `--team`.

### Options

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--team** `TEXT`

Team name or ID. Omit to list across all accessible teams.

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

List connections across your teams:

```sh theme={"system"}
baseten grid connection list
```

### Filter output with `--jq`

Print connection IDs:

```sh theme={"system"}
baseten grid connection list --jq '.items[].id'
```

### Output

**Text mode (`--output text`):** Table with ID, TEAM ID, TEAM NAME, PROVIDER, and SECRET NAME columns. Lists all pages; secret values are never returned.

**JSON mode (`--output json`):** Returns an `items` array of connections.

## `create`

```sh theme={"system"}
baseten grid connection create [OPTIONS]
```

The secret must belong to the connection's team. Creating a connection requires team admin. If you belong to one team, `--team` is optional. If you belong to several, specify a team.

### Options

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--provider** `TEXT` *required*

Upstream provider.

One of: `anthropic`, `openai`, `xai`

**--secret-name** `TEXT` *required*

Name of an existing secret in the connection's team.

**--team** `TEXT`

Team name or ID. Omit to use your only team; required when you belong to several.

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

Connect Anthropic using a team secret:

```sh theme={"system"}
baseten grid connection create --provider anthropic --secret-name <name>
```

### Filter output with `--jq`

Print the new connection ID:

```sh theme={"system"}
baseten grid connection create --provider openai --secret-name <name> --jq '.id'
```

### Output

**Text mode (`--output text`):** Confirmation on stderr; JSON contains the created connection.

**JSON mode (`--output json`):** Returns the created connection.

## `update`

```sh theme={"system"}
baseten grid connection update [OPTIONS]
```

Updating a connection requires team admin. The provider must match the existing connection. You can't change the provider or owning team.

### Options

**--id** `TEXT` *required*

Connection ID.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--provider** `TEXT` *required*

Upstream provider.

One of: `anthropic`, `openai`, `xai`

**--secret-name** `TEXT` *required*

Name of an existing secret in the connection's team.

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

Change the secret used by a connection:

```sh theme={"system"}
baseten grid connection update --id <id> --provider anthropic --secret-name <name>
```

### Filter output with `--jq`

Print the updated secret metadata:

```sh theme={"system"}
baseten grid connection update --id <id> --provider anthropic --secret-name <name> --jq '.config'
```

### Output

**Text mode (`--output text`):** Confirmation on stderr; JSON contains the updated connection.

**JSON mode (`--output json`):** Returns the updated connection.

## `delete`

```sh theme={"system"}
baseten grid connection delete [OPTIONS]
```

Requires team admin. Leaves the referenced secret in place. Pass `--yes` to skip confirmation.

### Options

**--id** `TEXT` *required*

Connection ID.

**-q, --jq** `TEXT`

Filter JSON output with a jq expression; implies --output json (or jsonl for streamed commands)

**-o, --output** `TEXT` (default: text)

Output format

One of: `text`, `json`, `jsonl`, `none`

**--profile** `TEXT`

Use a specific stored profile for this command, overriding BASETEN\_PROFILE and the current profile

**--yes** `BOOL`

Skip confirmation; required when stdin is not a terminal.

**-v, --verbose** `BOOL`

Enable verbose logging

### Examples

Delete a connection:

```sh theme={"system"}
baseten grid connection delete --id <id> --yes
```

### Filter output with `--jq`

Print the deleted ID:

```sh theme={"system"}
baseten grid connection delete --id <id> --yes --jq '.id'
```

### Output

**Text mode (`--output text`):** Confirmation on stderr; JSON contains the deleted connection ID.

**JSON mode (`--output json`):** Returns the deleted connection's ID.
