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

# Toly Agent

The `/agent` endpoint is a powerful API developed using **Python**. It leverages various tools and integrations to handle blockchain-related operations, particularly for the Solana ecosystem.

#### **Endpoints**

**1. Health Check**

* **GET /health**\
  A simple endpoint to verify the application's health status.
  * **Response:**
    * `200 OK`: Application is running.

**2. Agent Route**

* **POST /agent**\
  Used for querying an agent to get responses.

#### **Endpoint Overview**

* **Endpoint:** `/agent`
* **Method:** `POST`
* **Purpose:** Handles queries related to Solana blockchain operations and asset management.

#### **Request Format**

**Body Parameters**

* **`question`** *(string, required)*: The query or command for the agent to execute.
  * Example: "Get portfolio value for a wallet."

* **`thread_id`** *(integer, optional)*: Used to track context or session in a conversation.
  * Default: `0`

* **Request Parameters:**
  * **Body:**

    ```json
    {
      "question": "string",
      "thread_id": 0
    }
    ```

* **Responses:**
  * `200 OK`: Returns the agent's answer.
  * `422 Validation Error`: Invalid input.

<figure><img src="https://1312123878-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJGXEbxbTGcIOrszPqSsM%2Fuploads%2FiLB82rHNbNy4I4vg8G0u%2Ftoly5.png?alt=media&amp;token=b519d6fb-879e-47e5-acc7-11069f9b72b2" alt=""><figcaption></figcaption></figure>
