---
title: "Adds an agent skill from an uploaded archive."
method: POST
path: "/agents/skills"
tags: ["Agents"]
---

# Adds an agent skill from an uploaded archive.

`POST /agents/skills`

## Request

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

Upload a .zip or .skill file containing a SKILL.md to create a new agent skill.

## Request body `multipart/form-data`

- object
  - `file` string, binary, required: A .zip or .skill file containing a SKILL.md at the root.
  - `enable_by_default` boolean: Whether to enable the skill by default for the user after creation.

## Response `201`

Agent skill(s) created successfully

- AgentSkill[]
  - `id` string
  - `skill_name` string
  - `description` string
  - `config` object
  - `owner_email` string
  - `created_at` string
  - `updated_at` string
  - `enabled` boolean: Whether the skill is enabled for the user.
  - `warnings` string[]: Validation warnings for the skill.
  - `api_keys` object: Env vars the skill declares in envs.json, by requirement.
    - `required` string[]
    - `optional` string[]
  - `api_key_hints` object: Per-env-var description from envs.json.
  - `env_defaults` object: Per-env-var default value from envs.json.

## Other responses

- `400`: Bad request
- `401`: Unauthorized - Invalid or missing API key
- `403`: Forbidden
- `413`: Request entity is too large
- `415`: Unsupported media type
- `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)
