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

# set_synthesize_token

> Set Synthesize Bio API Token.

Securely prompts for and stores the Synthesize Bio API token in the
environment. This function uses getPass to securely handle the token input without
displaying it in the console. The token is stored in the SYNTHESIZE\_API\_KEY
environment variable for the current R session.

## Usage

```r theme={null}
set_synthesize_token(use_keyring = FALSE, token = NULL)
```

## Arguments

* **`use_keyring`**: Logical, whether to also store the token securely in the system
  keyring for future sessions. Defaults to FALSE.
* **`token`**: Character, optional. If provided, uses this token instead of prompting.
  This parameter should only be used in non-interactive scripts.

## Returns

Invisibly returns TRUE if successful.

## Examples

```r theme={null}
# Interactive prompt for token
set_synthesize_token()

# Provide token directly (less secure, not recommended for interactive use)
set_synthesize_token(token = "your-token-here")

# Store in system keyring for future sessions
set_synthesize_token(use_keyring = TRUE)
```

## Source

Generated from [`R/key-handlers.R`](https://github.com/synthesizebio/rsynthbio/blob/main/R/key-handlers.R) and the package help files in `man/`.
