# Authentication (/api/using-the-api/authentication)

Create API keys in Connect and send them as Bearer or Basic credentials.

Every Connect API request must be authenticated with an API key.

## Creating API keys

API keys are created and expired from the **Integrations** page in your Connect
settings, by retailer admins. You can have up to 5 active keys at a time.
Expired keys don't count towards the limit.

Treat your keys as secrets: don't embed them in client-side code, and expire
any key you suspect has leaked.

## Using your key

Pass the key in the `Authorization` header. Both the `Bearer` and `Basic`
schemes are accepted:

```
Authorization: Bearer <api-key>
```

```
Authorization: Basic <base64(<api-key>:)>
```

For `Basic`, use the API key as the username and leave the password empty.
`curl` builds the encoded header for you with `-u "<api-key>:"`:

```bash
curl "https://api.spoke.com/connect/v1/orders" -u "<api-key>:"
```

## Authentication errors

Requests with a missing, invalid, or expired key are rejected with a
`401 Unauthorized` response.