# 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;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.alphaneural.io/best-practices.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
