Create a skill
curl --request POST \
--url https://api.onecli.sh/v1/skills \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "release-checklist",
"description": "<string>",
"content": "<string>",
"enabled": true,
"agentId": "<string>",
"files": [
{
"path": "<string>",
"content": "<string>"
}
]
}
'import requests
url = "https://api.onecli.sh/v1/skills"
payload = {
"name": "release-checklist",
"description": "<string>",
"content": "<string>",
"enabled": True,
"agentId": "<string>",
"files": [
{
"path": "<string>",
"content": "<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: 'release-checklist',
description: '<string>',
content: '<string>',
enabled: true,
agentId: '<string>',
files: [{path: '<string>', content: '<string>'}]
})
};
fetch('https://api.onecli.sh/v1/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://api.onecli.sh/v1/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' => 'release-checklist',
'description' => '<string>',
'content' => '<string>',
'enabled' => true,
'agentId' => '<string>',
'files' => [
[
'path' => '<string>',
'content' => '<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://api.onecli.sh/v1/skills"
payload := strings.NewReader("{\n \"name\": \"release-checklist\",\n \"description\": \"<string>\",\n \"content\": \"<string>\",\n \"enabled\": true,\n \"agentId\": \"<string>\",\n \"files\": [\n {\n \"path\": \"<string>\",\n \"content\": \"<string>\"\n }\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://api.onecli.sh/v1/skills")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"release-checklist\",\n \"description\": \"<string>\",\n \"content\": \"<string>\",\n \"enabled\": true,\n \"agentId\": \"<string>\",\n \"files\": [\n {\n \"path\": \"<string>\",\n \"content\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onecli.sh/v1/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\": \"release-checklist\",\n \"description\": \"<string>\",\n \"content\": \"<string>\",\n \"enabled\": true,\n \"agentId\": \"<string>\",\n \"files\": [\n {\n \"path\": \"<string>\",\n \"content\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"scope": "agent",
"agentId": "<string>",
"workspaceId": "<string>",
"organizationId": "<string>",
"name": "<string>",
"description": "<string>",
"content": "<string>",
"enabled": true,
"createdByEmail": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"files": [
{
"path": "<string>",
"content": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}Skills
Create a workspace or agent skill
Creates a workspace skill, or an agent skill for a hosted agent when agentId is set. The name becomes the directory the agent sees and cannot change later.
POST
/
skills
Create a skill
curl --request POST \
--url https://api.onecli.sh/v1/skills \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "release-checklist",
"description": "<string>",
"content": "<string>",
"enabled": true,
"agentId": "<string>",
"files": [
{
"path": "<string>",
"content": "<string>"
}
]
}
'import requests
url = "https://api.onecli.sh/v1/skills"
payload = {
"name": "release-checklist",
"description": "<string>",
"content": "<string>",
"enabled": True,
"agentId": "<string>",
"files": [
{
"path": "<string>",
"content": "<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: 'release-checklist',
description: '<string>',
content: '<string>',
enabled: true,
agentId: '<string>',
files: [{path: '<string>', content: '<string>'}]
})
};
fetch('https://api.onecli.sh/v1/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://api.onecli.sh/v1/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' => 'release-checklist',
'description' => '<string>',
'content' => '<string>',
'enabled' => true,
'agentId' => '<string>',
'files' => [
[
'path' => '<string>',
'content' => '<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://api.onecli.sh/v1/skills"
payload := strings.NewReader("{\n \"name\": \"release-checklist\",\n \"description\": \"<string>\",\n \"content\": \"<string>\",\n \"enabled\": true,\n \"agentId\": \"<string>\",\n \"files\": [\n {\n \"path\": \"<string>\",\n \"content\": \"<string>\"\n }\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://api.onecli.sh/v1/skills")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"release-checklist\",\n \"description\": \"<string>\",\n \"content\": \"<string>\",\n \"enabled\": true,\n \"agentId\": \"<string>\",\n \"files\": [\n {\n \"path\": \"<string>\",\n \"content\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onecli.sh/v1/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\": \"release-checklist\",\n \"description\": \"<string>\",\n \"content\": \"<string>\",\n \"enabled\": true,\n \"agentId\": \"<string>\",\n \"files\": [\n {\n \"path\": \"<string>\",\n \"content\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"scope": "agent",
"agentId": "<string>",
"workspaceId": "<string>",
"organizationId": "<string>",
"name": "<string>",
"description": "<string>",
"content": "<string>",
"enabled": true,
"createdByEmail": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"files": [
{
"path": "<string>",
"content": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}Adds a skill at the workspace level, or for one hosted agent when you set an agent ID. Choose the name carefully, since it becomes the directory the agent sees and cannot change.
Related guide: Coding agents: route agents through the gateway.
Creates a workspace-tier skill, or an agent-tier one when
agentId is set (hosted agents only). name becomes the directory the agent sees and cannot change afterwards.
Availability: Cloud · Community (self-hosted) · Enterprise (self-hosted)
Authorizations
A workspace API key (oc_…) or organization API key (oc_org_…). Workspace-scoped endpoints called with an organization key also need X-Workspace-Id.
Body
application/json
The body and every file together are limited to 32,000 characters. A workspace holds at most 20 skills, an agent 10, an organization 20.
Maximum string length:
64Pattern:
^[a-z0-9]+(?:-[a-z0-9]+)*$Example:
"release-checklist"
One line. The agent reads it to decide when to load the skill.
Maximum string length:
500Maximum string length:
24000Create the skill at the agent tier instead of the workspace tier. Hosted agents only.
Maximum array length:
5Show child attributes
Show child attributes
Response
Created
Available options:
agent, workspace, organization The SKILL.md body.
Show child attributes
Show child attributes