> For the complete documentation index, see [llms.txt](https://docs.alphaneural.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.alphaneural.io/best-practices.md).

# Best Practices

#### 1. Use Environment Variables

Never hardcode your API key.

#### 2. Implement Retries

Retry on:

<sub>- 429 (rate limit)</sub> &#x20;

<sub>- 500 (server error)</sub> &#x20;

#### 3. Log Token Usage

Include:

<sub>- model</sub> &#x20;

<sub>- prompt tokens</sub> &#x20;

<sub>- completion tokens</sub> &#x20;

<sub>- total tokens</sub> &#x20;

#### 4. Separate API Keys

Use different keys for:

<sub>- development</sub> &#x20;

<sub>- staging</sub> &#x20;

<sub>- production</sub> &#x20;
