---
title: "Add Custom Agents"
method: POST
path: "/agents/custom_agents"
tags: ["Agents"]
---

# Add Custom Agents

`POST /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/post.ts> (a function with typed inputs; its response is checked against the schema)

Add Custom Agents

## Request body `multipart/form-data`

- object
  - `file` string, binary, required
  - `agent_type` string, required
  - `agent_args` string, required
  - `agent_name` string: User-provided name for the agent. If provided and the zip contains exactly one agent, this name will be used instead of the folder name inside the zip. If not provided, the folder name is used.

## Response `201`

Custom agent created successfully

- object[]
  - `agent_custom_agent_id` string: The ID of the created custom agent

## Other responses

- `400`: Bad request
- `401`: Unauthorized - Invalid or missing API key
- `415`: Unsupported media type
- `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)
