> For the complete documentation index, see [llms.txt](https://max-daunarovich.gitbook.io/flow-network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://max-daunarovich.gitbook.io/flow-network/introduction/accounts/account-creation.md).

# Account Creation

Accounts can be created by calling the `AuthAccount` constructor and passing the account that should pay for the account creation for the `payer` parameter.

The `payer` must have enough funds to be able to create an account. If the account does not have the required funds, the program aborts.

To authorize access to the account, keys can be added using the `addPublicKey` function. Keys can also later be removed using the `removePublicKey` function.

For example, to create an account and have the signer of the transaction pay for the account creation, and authorize one key to access the account:

```
transaction(key: [UInt8]) {
    prepare(signer: AuthAccount) {
        let account = AuthAccount(payer: signer)
        account.addPublicKey(key)
    }
}
```
