> For the complete documentation index, see [llms.txt](https://bohd4nx.gitbook.io/pyfragment/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bohd4nx.gitbook.io/pyfragment/setup-guide/quickstart.md).

# Quick Start

Use this minimal example to verify that your credentials, cookies, and wallet setup are correct.

```python
import asyncio

from pyfragment import FragmentClient
from pyfragment.enums import PaymentMethod


async def main() -> None:
    async with FragmentClient(
        seed="word1 word2 ... word24",
        api_key="YOUR_API_KEY",  # tonconsole.com (tonapi, default) or t.me/toncenter
        cookies={
            "stel_ssid": "...",
            "stel_dt": "...",
            "stel_token": "...",
            "stel_ton_token": "...",
        },
        wallet_version="V5R1",   # or "V4R2", "HighloadV2", "HighloadV3R1"
        api_provider="tonapi",   # or "toncenter"
    ) as client:
        wallet = await client.get_wallet()
        print("GRAM: %s | USDT: %s" % (wallet.gram_balance, wallet.usdt_balance))

        recipient = "https://t.me/username"  # also: @username, username

        stars = await client.purchase_stars(recipient, amount=500, payment_method=PaymentMethod.USDT_GRAM)
        print("Sent %s Stars to %s | tx: %s" % (stars.amount, stars.username, stars.transaction_id))

        premium = await client.purchase_premium(recipient, months=6, payment_method=PaymentMethod.GRAM)
        print("Sent Premium %sm to %s | tx: %s" % (premium.amount, premium.username, premium.transaction_id))


asyncio.run(main())
```

If this script returns wallet data, your setup is healthy.

Then move to feature pages:

* Stars: [Purchase](https://github.com/bohd4nx/pyfragment/tree/docs/docs/getting-started/client/stars/purchase.md), [Giveaway](https://github.com/bohd4nx/pyfragment/tree/docs/docs/getting-started/client/stars/giveaway.md)
* Premium: [Purchase](https://github.com/bohd4nx/pyfragment/tree/docs/docs/getting-started/client/premium/purchase.md), [Giveaway](https://github.com/bohd4nx/pyfragment/tree/docs/docs/getting-started/client/premium/giveaway.md)
* Marketplace: [Overview](https://github.com/bohd4nx/pyfragment/tree/docs/docs/getting-started/client/marketplace/overview.md), Ads: [Overview](https://github.com/bohd4nx/pyfragment/tree/docs/docs/getting-started/client/ads/overview.md)
* Numbers: [Anonymous Numbers](https://github.com/bohd4nx/pyfragment/tree/docs/docs/getting-started/client/anonymous-numbers/overview.md)
* Utility operations: [Raw API Calls](https://github.com/bohd4nx/pyfragment/tree/docs/docs/getting-started/client/raw-call.md)
