> 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/reference/models.md).

# Result Models

Every high-level method returns a typed model, so you can rely on predictable fields instead of raw payload parsing.

Exported result models:

* `CookieResult(cookies, expires)`
* `StarsResult(transaction_id, username, amount)`
* `PremiumResult(transaction_id, username, amount)`
* `AdsTopupResult(transaction_id, username, amount)`
* `AdsRechargeResult(transaction_id, amount)`
* `StarsGiveawayResult(transaction_id, channel, winners, amount)`
* `PremiumGiveawayResult(transaction_id, channel, winners, amount)`
* `WalletInfo(address, state, gram_balance, usdt_balance)`
* `LoginCodeResult(number, code, active_sessions)`
* `TerminateSessionsResult(number, message)`
* `UsernamesResult(items, next_offset_id)`
* `NumbersResult(items, next_offset_id)`
* `GiftsResult(items, next_offset)`

Most high-level methods return one of these dataclasses.

## Where they are used

* `purchase_stars()`: `StarsResult`
* `purchase_premium()`: `PremiumResult`
* `giveaway_stars()`: `StarsGiveawayResult`
* `giveaway_premium()`: `PremiumGiveawayResult`
* `topup_gram()`: `AdsTopupResult`
* `recharge_ads()`: `AdsRechargeResult`
* `get_wallet()`: `WalletInfo`
* `get_login_code()`: `LoginCodeResult`
* `terminate_sessions()`: `TerminateSessionsResult`
* `search_usernames()`: `UsernamesResult`
* `search_numbers()`: `NumbersResult`
* `search_gifts()`: `GiftsResult`

## Methods without dataclass return

* `toggle_login_codes()`: returns `None`
* `call()`: returns `dict[str, Any]` (raw Fragment API response)

## Cookie helper

`CookieResult` is returned by `get_cookies_from_browser()`, not by `FragmentClient` methods.

**Use these models directly in your app layer and avoid passing raw dictionaries around.**


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://bohd4nx.gitbook.io/pyfragment/reference/models.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
