# kosa8 cloud ai keys set

Store or replace a provider's key (from a hidden prompt, stdin or --from-env)

## Usage

```
kosa8 cloud ai keys set PROVIDER
```

Stores PROVIDER's API key for the organization, sealed. It is used only to
call PROVIDER through the gateway and is never returned: kosa8 cloud ai keys ls
shows its last 4 characters. The key is read from a hidden prompt at a terminal,
else from stdin, or from the variable --from-env names; never from argv.

Also known as: `put`, `add`

## Flags

| Flag | Type | What it does | Default |
|---|---|---|---|
| `--from-env` | string | read the key from this environment variable of this shell |  |

## Example

```
  kosa8 cloud ai keys set openai
  printf %s "$ANTHROPIC_API_KEY" | kosa8 cloud ai keys set anthropic
  kosa8 cloud ai keys set groq --from-env GROQ_API_KEY
```

---
Source: https://docs.kosa8.com/reference/cloud-ai-keys-set/
