---
title: "List Custom Agents"
method: GET
path: "/agents/custom_agents"
tags: ["Agents"]
---

# List Custom Agents

`GET /agents/custom_agents`

## Request

- Base URL: `https://h2ogpte.genai.h2o.ai/api/v1`
- URL: `https://h2ogpte.genai.h2o.ai/api/v1/agents/custom_agents`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/h2o/apis/h2ogpte-rest-api/docs/agents/custom_agents/get.ts> (a function with typed inputs; its response is checked against the schema)

List all custom agents for the current user

## Response `200`

Successful operation

- CustomAgentDetail[]
  - `id` string: The ID of the custom agent
  - `agent_name` string: The name of the agent
  - `agent_type` string: The type of the agent
  - `agent_args` object: The agent arguments
  - `owner_email` string: The owner's email
  - `mcp_servers` object[], nullable: Array of MCP server associations with tool details
    - `tool_name` string: MCP server name from agent metadata
    - `tool_args` string: Tool arguments as JSON string
    - `associated_tool` object, nullable: Associated tool details if tool is resolved
      - `id` string: Tool ID
      - `name` string: Tool name
      - `owner_email` string: Tool owner email
      - `description` string: Tool description
  - `api_keys` CustomAgentKeyAssociation[]: Key associations (env var → agent key) for this agent
    - `id` string, uuid, required: Association UUID
    - `agent_id` string, uuid, required: Custom agent UUID
    - `env_key_name` string, required: Env var name (from envs.json or user-added)
    - `key_id` string, uuid, nullable: Agent key UUID (null for placeholder associations)
    - `user_id` string, uuid, required: User UUID who owns the association
    - `requirement_type` 'required' | 'optional_with_default' | 'optional_no_default' | 'custom', required: From envs.json value or custom if assigned after the fact
    - `key_name` string, nullable: Agent key name
    - `owner_email` string, nullable: Agent key owner email

## Other responses

- `400`: Bad request
- `401`: Unauthorized - Invalid or missing API key
- `500`: Internal server error
- `default`: Unexpected error

---

[API](https://skmtc.dev/h2o/apis/h2ogpte-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/revisions/a82a117320f4?raw)
