Create a skill
curl --request POST \
--url https://agp.eu.hcompany.ai/api/v2/skills \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"body": "<string>",
"source": "<string>",
"url_pattern": "<string>",
"compatibility": {},
"files": {},
"executable_files": [
"<string>"
]
}
'import requests
url = "https://agp.eu.hcompany.ai/api/v2/skills"
payload = {
"name": "<string>",
"description": "<string>",
"body": "<string>",
"source": "<string>",
"url_pattern": "<string>",
"compatibility": {},
"files": {},
"executable_files": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
body: JSON.stringify('<string>'),
source: '<string>',
url_pattern: '<string>',
compatibility: {},
files: {},
executable_files: ['<string>']
})
};
fetch('https://agp.eu.hcompany.ai/api/v2/skills', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agp.eu.hcompany.ai/api/v2/skills",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'body' => '<string>',
'source' => '<string>',
'url_pattern' => '<string>',
'compatibility' => [
],
'files' => [
],
'executable_files' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agp.eu.hcompany.ai/api/v2/skills"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"body\": \"<string>\",\n \"source\": \"<string>\",\n \"url_pattern\": \"<string>\",\n \"compatibility\": {},\n \"files\": {},\n \"executable_files\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://agp.eu.hcompany.ai/api/v2/skills")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"body\": \"<string>\",\n \"source\": \"<string>\",\n \"url_pattern\": \"<string>\",\n \"compatibility\": {},\n \"files\": {},\n \"executable_files\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/skills")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"body\": \"<string>\",\n \"source\": \"<string>\",\n \"url_pattern\": \"<string>\",\n \"compatibility\": {},\n \"files\": {},\n \"executable_files\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodySkills
Create a skill
Create a reusable skill in your catalog: a description that routes it and a body the agent follows when it matches.
POST
/
api
/
v2
/
skills
Create a skill
curl --request POST \
--url https://agp.eu.hcompany.ai/api/v2/skills \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"body": "<string>",
"source": "<string>",
"url_pattern": "<string>",
"compatibility": {},
"files": {},
"executable_files": [
"<string>"
]
}
'import requests
url = "https://agp.eu.hcompany.ai/api/v2/skills"
payload = {
"name": "<string>",
"description": "<string>",
"body": "<string>",
"source": "<string>",
"url_pattern": "<string>",
"compatibility": {},
"files": {},
"executable_files": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
body: JSON.stringify('<string>'),
source: '<string>',
url_pattern: '<string>',
compatibility: {},
files: {},
executable_files: ['<string>']
})
};
fetch('https://agp.eu.hcompany.ai/api/v2/skills', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agp.eu.hcompany.ai/api/v2/skills",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'body' => '<string>',
'source' => '<string>',
'url_pattern' => '<string>',
'compatibility' => [
],
'files' => [
],
'executable_files' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agp.eu.hcompany.ai/api/v2/skills"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"body\": \"<string>\",\n \"source\": \"<string>\",\n \"url_pattern\": \"<string>\",\n \"compatibility\": {},\n \"files\": {},\n \"executable_files\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://agp.eu.hcompany.ai/api/v2/skills")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"body\": \"<string>\",\n \"source\": \"<string>\",\n \"url_pattern\": \"<string>\",\n \"compatibility\": {},\n \"files\": {},\n \"executable_files\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/skills")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"body\": \"<string>\",\n \"source\": \"<string>\",\n \"url_pattern\": \"<string>\",\n \"compatibility\": {},\n \"files\": {},\n \"executable_files\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyCreates a skill in your catalog. Attach it to agents by
name in their skills list.
Returns 201 with the created skill object.
Request body
string
required
Catalog identifier, kebab-case with an optional single
org/ namespace prefix. The h/ prefix is reserved for H’s catalog (rejected with 403). Any other name creates a custom skill, private to your organization. Immutable after creation.string
required
When to use the skill. The agent reads it to decide whether to load the skill. Non-empty.
string
required
The Markdown instructions the agent loads when it uses the skill. Non-empty.
string
Optional provenance URL.
string
Optional, informational regex hinting at URLs where the skill applies. 1 to 1024 characters.
string | null
Optional environment requirements shown to the agent, for example
"Needs a code sandbox with Python 3". Not enforced.object
Optional supporting files (scripts, references, assets), keyed by relative path, each value base64-encoded:Up to 511 files, 2 MiB each and 4 MiB in total. Paths are relative POSIX paths, unique ignoring case, and a file can’t share a path with a folder.
"files": {"scripts/check.sh": "IyEvYmluL3NoCmVjaG8gb2sK"}
SKILL.md is reserved: it is generated from the other fields. The catalog stores the files and returns them unchanged. Agents don’t install them in their environment yet.string[]
default:"[]"
Paths in
files that keep their execute bit, for example ["scripts/check.sh"]. Each must be a key of files.Examples
curl -X POST https://agp.eu.hcompany.ai/api/v2/skills \
-H "Authorization: Bearer $HAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "extract-table-data",
"description": "Extract structured data from HTML tables into JSON.",
"body": "When you encounter an HTML table, extract all rows and columns into a JSON array of objects. Each object should use the table headers as keys.",
"source": "https://github.com/myorg/skills"
}'
from hai_agents import Client
client = Client()
skill = client.skills.create_skill(
name="extract-table-data",
description="Extract structured data from HTML tables into JSON.",
body="When you encounter an HTML table, extract all rows and columns into a JSON array of objects. Each object should use the table headers as keys.",
source="https://github.com/myorg/skills",
)
print(skill.name)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const skill = await client.skills.createSkill({
name: "extract-table-data",
description: "Extract structured data from HTML tables into JSON.",
body: "When you encounter an HTML table, extract all rows and columns into a JSON array of objects. Each object should use the table headers as keys.",
source: "https://github.com/myorg/skills",
});
console.log(skill.name);
Response
{
"name": "extract-table-data",
"description": "Extract structured data from HTML tables into JSON.",
"body": "When you encounter an HTML table...",
"source": "https://github.com/myorg/skills",
"url_pattern": null,
"compatibility": null,
"files": {},
"executable_files": []
}
Errors
| Status | Cause |
|---|---|
403 | Attempted to use the reserved h/ namespace. |
409 | A skill with this name already exists in your catalog. |
422 | Body failed validation. Common cases: empty body, invalid name shape, a file path or size outside the limits, an executable_files entry missing from files. |
Was this page helpful?