# Installing

Chạy lệnh sau để cài `smtp-py`:

```bash
python -m pip install smtp-py
```

### Xác thực (API key)

Tạo API key tại `https://smtp.dev/tokens/`.

Bạn có 2 cách cấu hình nhanh:

1. Truyền thẳng `api_key` khi khởi tạo `SMTPDevClient`.
2. Set biến môi trường `XAPIKEY` hoặc `X_API_KEY` (khuyến nghị).

{% code title=".env" %}

```env
XAPIKEY=your_api_key_here
```

{% endcode %}

Sau đó xem tiếp [Usage](/smtp-py/getting-started/usage.md).


---

# 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://reno.gitbook.io/smtp-py/getting-started/publish-your-docs.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.
