> ## Documentation Index
> Fetch the complete documentation index at: https://beta-docs.nevermind.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Agent

> Retrieves information about a registered AI agent, including metadata and associated payment plans.

Retrieves information about a registered AI agent, including metadata and associated payment plans.

## Path Parameters

| Name    | Type   | Required | Description                                    |
| ------- | ------ | -------- | ---------------------------------------------- |
| agentId | string | Yes      | The unique identifier of the agent to retrieve |

## Example Request

```ts theme={null}
const agent: Agent = await payments.getAgent(agentId)
```

## Response Structure

```typescript theme={null}
interface Agent {
  agentId: string
  metadata: AgentMetadata
  plans: PaymentPlan[]
}

interface AgentMetadata {
  name: string
  tags: string[]
  dateCreated: string
}

interface PaymentPlan {
  planId: string
  metadata: PlanMetadata
  price: PriceConfig
  credits: CreditsConfig
  nftAddress: string
}
```

## Example Response

```json theme={null}
{
  "agentId": "0xabc123...",
  "metadata": {
    "name": "Legal Assistant",
    "tags": ["legal", "ai"],
    "dateCreated": "2024-01-10T00:00:00Z"
  },
  "plans": [
    {
      "planId": "0xdef456...",
      "metadata": {
        "name": "Premium Legal Plan",
        "description": "Monthly subscription for legal assistance"
      },
      "price": {
        "priceType": "FIXED_PRICE",
        "tokenAddress": "0xUSDC...",
        "amounts": [10000000],
        "receivers": ["0xbuilderAddress"]
      },
      "credits": {
        "creditsType": "EXPIRABLE",
        "amount": 1,
        "durationOfThePlan": 2592000
      },
      "nftAddress": "0x..."
    }
  ]
}
```

## Notes

* You must initialize the `Payments` client with a valid `nvmApiKey` before calling `getAgent`.
* The returned object includes all plans currently associated with the agent.


## OpenAPI

````yaml GET /agent/{agentId}
openapi: 3.1.0
info:
  title: Nevermined API
  description: >-
    API for managing AI agents, payment plans, and subscriptions in the
    Nevermined ecosystem
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: http://sandbox.mintlify.com
security:
  - bearerAuth: []
paths:
  /agent/{agentId}:
    get:
      tags:
        - Agents
      summary: Get Agent
      description: >-
        Retrieves information about a registered AI agent, including metadata
        and associated payment plans.
      operationId: getAgent
      parameters:
        - name: agentId
          in: path
          description: The unique identifier of the agent to retrieve
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Agent information response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '404':
          description: Agent not found
components:
  schemas:
    Agent:
      type: object
      properties:
        agentId:
          type: string
        metadata:
          $ref: '#/components/schemas/AgentMetadata'
        plans:
          type: array
          items:
            $ref: '#/components/schemas/Plan'
    AgentMetadata:
      type: object
      properties:
        name:
          type: string
        tags:
          type: array
          items:
            type: string
        dateCreated:
          type: string
          format: date-time
    Plan:
      type: object
      properties:
        planId:
          type: string
        metadata:
          type: object
          properties:
            name:
              type: string
            description:
              type: string
        price:
          type: object
          properties:
            priceType:
              type: string
            tokenAddress:
              type: string
            amounts:
              type: array
              items:
                type: integer
            receivers:
              type: array
              items:
                type: string
        credits:
          type: object
          properties:
            creditsType:
              type: string
            amount:
              type: integer
            durationOfThePlan:
              type: integer
        nftAddress:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````