Skills
Create a skill
Create reusable instructions an agent loads when a task matches.
POST
/
api
/
v2
/
skills
from hai_agents import Client
client = Client()
skill = client.skills.create_skill(
name="extract-table-data",
description="Use when the task asks for data in an HTML table.",
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: "Use when the task asks for data in an HTML table.",
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);
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": "Use when the task asks for data in an HTML table.",
"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"
}'
{
"name": "extract-table-data",
"description": "Use when the task asks for data in an HTML table.",
"body": "When you encounter an HTML table...",
"source": "https://github.com/myorg/skills",
"url_pattern": null,
"compatibility": null,
"files": {},
"executable_files": []
}
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 regex hinting at URLs where the skill applies. Shown to the agent, never matched against the live page. 1 to 1024 characters.
string | null
Optional environment requirements shown to the agent, for example
"Needs a code sandbox with Python 3". Not enforced.Response
201 with the created skill object.
from hai_agents import Client
client = Client()
skill = client.skills.create_skill(
name="extract-table-data",
description="Use when the task asks for data in an HTML table.",
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: "Use when the task asks for data in an HTML table.",
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);
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": "Use when the task asks for data in an HTML table.",
"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"
}'
{
"name": "extract-table-data",
"description": "Use when the task asks for data in an HTML table.",
"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. |
Was this page helpful?
⌘I
from hai_agents import Client
client = Client()
skill = client.skills.create_skill(
name="extract-table-data",
description="Use when the task asks for data in an HTML table.",
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: "Use when the task asks for data in an HTML table.",
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);
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": "Use when the task asks for data in an HTML table.",
"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"
}'
{
"name": "extract-table-data",
"description": "Use when the task asks for data in an HTML table.",
"body": "When you encounter an HTML table...",
"source": "https://github.com/myorg/skills",
"url_pattern": null,
"compatibility": null,
"files": {},
"executable_files": []
}