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

# List Agents



## OpenAPI

````yaml /api-v2.json get /agents
openapi: 3.1.0
info:
  title: Meibel AI API
  summary: Meibel Gateway Service
  description: >-
    Our API allows you to interact with our services. Read the
    [docs](https://docs.meibel.ai) to learn how to use it.
  version: 0.6.4
servers:
  - url: https://api.meibel.ai/v2
    description: Meibel API (v2)
  - url: https://api.dev.meibel.ai/v2
    description: Meibel Dev API (v2)
  - url: http://localhost:8000/v2
    description: Local Development
security: []
tags:
  - name: Datasources
    description: v2 datasource management
  - name: Data Elements
    description: v2 data element CRUD and search
  - name: File Upload
    description: Upload files to a datasource and track upload progress
  - name: Ingest
    description: Trigger and monitor datasource ingestion
  - name: Datasource Downloads
    description: Export all datasource content as a zip archive
  - name: Table Descriptions
    description: v2 table and column descriptions
  - name: Metadata Model Catalog
    description: v2 metadata model catalog
  - name: Confidence Scoring
    description: v2 confidence scoring jobs and summaries
  - name: Documents
    description: Parse and transform documents into structured data
  - name: Agents
    description: Agent definition management
  - name: Sessions
    description: Agent session (execution) management and chat
  - name: Execution Policies
    description: Data access and tool usage constraints scoped to agent sessions
  - name: Artifact Schemas
    description: Agent artifact schema management
paths:
  /agents:
    get:
      tags:
        - Agents
      summary: List Agents
      operationId: listAgents
      parameters:
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Number of items to skip
            default: 0
            title: Offset
          description: Number of items to skip
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Maximum number of items to return
            default: 20
            title: Limit
          description: Maximum number of items to return
        - name: sort_by
          in: query
          required: false
          schema:
            type: string
            description: 'Field to sort by: created_at, name, display_name'
            default: created_at
            title: Sort By
          description: 'Field to sort by: created_at, name, display_name'
        - name: sort_order
          in: query
          required: false
          schema:
            type: string
            pattern: ^(asc|desc)$
            description: 'Sort order: asc or desc'
            default: desc
            title: Sort Order
          description: 'Sort order: asc or desc'
        - name: published_only
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              If true, return only published agents (latest published version
              per name)
            default: false
            title: Published Only
          description: >-
            If true, return only published agents (latest published version per
            name)
        - name: datasource_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Return only agents whose latest version uses this datasource ID
            title: Datasource Id
          description: Return only agents whose latest version uses this datasource ID
        - name: artifact_schema_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Return only agents whose latest version produces this artifact
              (catalog URN)
            title: Artifact Schema Id
          description: >-
            Return only agents whose latest version produces this artifact
            (catalog URN)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
      x-codeSamples:
        - lang: Python
          label: Python
          source: |-
            import os
            from meibel import MeibelClient

            client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])

            for agent in client.agents.list():
                print(f"{agent.name} (v{agent.version}) - {agent.type}")
        - lang: TypeScript
          label: TypeScript
          source: >-
            import { MeibelClient } from "meibel";


            const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY
            });


            for await (const agent of client.agents.list()) {
              console.log(`${agent.id}: ${agent.display_name} (v${agent.version}, ${agent.type})`);
            }
        - lang: Go
          label: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\tv2 \"github.com/meibel-ai/meibel-go/v2\"\n)\n\nfunc main() {\n\tclient := v2.NewClient(v2.WithAPIKey(os.Getenv(\"MEIBEL_API_KEY\")))\n\n\titer := client.Agents.List(context.Background(), v2.AgentListParams{})\n\tfor iter.Next() {\n\t\tagent := iter.Current()\n\t\tfmt.Printf(\"%s (%s) - %s\\n\", agent.DisplayName, agent.Version, agent.Type)\n\t}\n\tif err := iter.Err(); err != nil {\n\t\tpanic(err)\n\t}\n}"
components:
  schemas:
    AgentListResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/AgentSummary'
          type: array
          title: Data
        total:
          type: integer
          title: Total
        offset:
          type: integer
          title: Offset
        limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Limit
      type: object
      required:
        - data
        - total
        - offset
      title: AgentListResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentSummary:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        display_name:
          type: string
          title: Display Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        version:
          type: string
          title: Version
        type:
          type: string
          title: Type
          description: 'Lifecycle state of the returned version: "draft" or "published".'
        llm_model:
          type: string
          title: Llm Model
        tool_count:
          type: integer
          title: Tool Count
        datasource_count:
          type: integer
          title: Datasource Count
        last_execution_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Execution Status
        last_execution_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Execution Time
      type: object
      required:
        - id
        - name
        - display_name
        - version
        - type
        - llm_model
        - tool_count
        - datasource_count
      title: AgentSummary
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Meibel-API-Key

````