> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://rockwell.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://rockwell.ferndocs.com/_mcp/server.

# Best Practices for Using API Keys

API keys are required for apps and projects that use Plex APIs. Secure your API keys when you create them for maximum security.

It's possible to secure API keys after they're created and in use, but there can be different constraints based on how the key is used. Protect against unauthorized access by selecting the products it's used for and regularly replacing keys.

> **Info**
>
> The best time to secure your API keys is when you first create them. Retroactively applying restrictions may require updating existing applications.

## Key security practices

* **[Restrict API Keys](/best-practices/restrict-api-keys)** — Limit keys to only the APIs they need access to and set expiration dates
* **[Restrict Developer Portal Account Access](/best-practices/restrict-developer-portal-account-access)** — Control who can create and manage API keys
* **[Regularly Audit Your API Keys](/best-practices/regularly-audit-your-api-keys)** — Review key usage and permissions on a regular cadence
* **[Use Independent API Keys for Different Apps](/best-practices/use-independent-api-keys-for-different-apps)** — Isolate access per application for better security
* **[Regenerate API Keys Regularly](/best-practices/regenerate-api-keys-regularly)** — Rotate keys to minimize the impact of compromised credentials
* **[Store API Keys in a Secure Location](/best-practices/store-api-keys-in-a-secure-location)** — Never hardcode keys in source files
* **[Encrypt Keys on Code Repositories](/best-practices/encrypt-keys-on-code-repositories)** — Use encryption and secrets management for stored keys