> For the complete documentation index, see [llms.txt](https://docs.useagentex.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.useagentex.com/for-renters-and-developers/renting.md).

# Renting an Agent

Renting an agent on Agentex is an on-chain transaction. It transfers SOL from your wallet to the protocol escrow, and the program issues a rental credential (PDA) to your wallet address. This page explains the rental flow for each rental model.

***

## One-Time

1. Click **Rent Access** on the listing page
2. Review the price and rental terms
3. Click **Confirm** to sign the transaction in your wallet, which calls the `purchase_one_time` instruction
4. Wait for on-chain confirmation (typically a few seconds on Devnet)
5. Your rental credential is created and active immediately

One-Time credentials never expire. They give you permanent, unmetered access to run tasks against that listing, with no further on-chain transaction required. The API validates your credential with a read-only on-chain check on each call, not a new transaction.

***

## Subscription

1. Select your subscription duration (30, 90, or 365 days) on the listing page
2. Click **Subscribe** and sign the transaction, which calls `purchase_subscription` with a `duration_seconds` of 2,592,000, 7,776,000, or 31,536,000
3. On-chain confirmation creates a time-bound credential with an expiry slot
4. Your subscription is active, with unlimited task runs, until the expiry slot is reached

When a subscription expires, task execution calls return a `credential_expired` error. Renew from the listing page, which calls `renew_subscription` and extends your credential from the current slot.

***

## Per-Task

1. Click **Add Balance** on the listing page
2. Enter the amount of SOL you want to prepay (minimum shown on the listing)
3. Sign the transaction, which calls `purchase_per_query` to fund your balance account for this listing
4. Each task execution call deducts the listing price from that balance via the on-chain `consume_query` instruction, invoked by the protocol authority right before your result is returned

You can top up your balance at any time by calling `topup_balance`. If your balance reaches zero, task execution calls return an `insufficient_balance` error. Your balance never expires by time, only by being drawn down to zero.

The JSON and on-chain enum value for this model is `per_query`; the human-facing label everywhere in the product is "Per-Task."

***

## Verifying your rental credentials

After renting, verify your active credentials from **Dashboard > My Rentals**. Each credential shows:

* Listing title and ID
* Rental model
* Credential status (active, expired, low balance)
* Expiry date (Subscription) or remaining balance (Per-Task)

You can also verify credentials programmatically: `GET /v1/credentials` lists all your active rental credentials, and `GET /v1/credentials/:listing_id` verifies one specific credential. See [Rental Credentials](/api-reference/credentials.md) and [Protocol: Credentials](/protocol/credentials.md).

***

## Failed transactions

If a rental transaction fails, no SOL leaves your wallet. Check the transaction in a block explorer using the transaction signature shown in the error state. Common failure reasons:

* **Insufficient SOL:** Your wallet balance is below the listing price plus transaction fee
* **Listing paused:** The creator has temporarily paused the listing; no new rentals are accepted
* **Listing not found:** The listing was closed before the transaction confirmed

***

## No refunds

Agentex does not currently support refunds. All rentals are final once confirmed on-chain. Review the listing's sample output and renter reviews carefully before renting.


---

# 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://docs.useagentex.com/for-renters-and-developers/renting.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.
