Llm

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
POST
GET
PATCH
POST
POST
POST
POST
GET
DELETE
GET

List all llm skills

Required API key scopes

llm_skill:read

Query parameters

  • created_by_id
    integer
  • limit
    integer
  • offset
    integer
  • search
    string

Response


Example request

GET /api/environments/:project_id/llm_skills
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_skills/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"license": "string",
"compatibility": "string",
"allowed_tools": [
"string"
],
"metadata": {},
"outline": [
{
"level": 1,
"text": "string"
}
],
"version": 0,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "string"
}
]
}

Create llm skills

Required API key scopes

llm_skill:write

Request parameters

  • name
    string
  • description
    string
  • body
    string
  • license
    string
  • compatibility
    string
  • allowed_tools
    array
  • metadata
    object
  • files
    Click to open
    array

Response


Example request

POST /api/environments/:project_id/llm_skills
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_skills/\
-d name="string",\
-d description="string",\
-d body="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"body": "string",
"license": "string",
"compatibility": "string",
"allowed_tools": [
"string"
],
"metadata": {},
"files": [
{
"path": "string",
"content": "string",
"content_type": "text/plain"
}
],
"outline": [
{
"level": 1,
"text": "string"
}
],
"version": 0,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "string"
}

Retrieve llm skills name

Required API key scopes

llm_skill:read

Path parameters

  • skill_name
    string

Query parameters

  • version
    integer

Response


Example request

GET /api/environments/:project_id/llm_skills/name/:skill_name
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_skills/name/:skill_name/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"body": "string",
"license": "string",
"compatibility": "string",
"allowed_tools": [
"string"
],
"metadata": {},
"files": [
{
"path": "string",
"content_type": "string"
}
],
"outline": [
{
"level": 1,
"text": "string"
}
],
"version": 0,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "string"
}

Update llm skills name

Required API key scopes

llm_skill:write

Path parameters

  • skill_name
    string

Request parameters

  • body
    string
  • edits
    Click to open
    array
  • description
    string
  • license
    string
  • compatibility
    string
  • allowed_tools
    array
  • metadata
    object
  • files
    Click to open
    array
  • file_edits
    Click to open
    array
  • base_version
    integer

Response


Example request

PATCH /api/environments/:project_id/llm_skills/name/:skill_name
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_skills/name/:skill_name/\
-d body="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"body": "string",
"license": "string",
"compatibility": "string",
"allowed_tools": [
"string"
],
"metadata": {},
"files": [
{
"path": "string",
"content_type": "string"
}
],
"outline": [
{
"level": 1,
"text": "string"
}
],
"version": 0,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "string"
}

Create llm skills name archive

Required API key scopes

llm_skill:write

Path parameters

  • skill_name
    string

Example request

POST /api/environments/:project_id/llm_skills/name/:skill_name/archive
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_skills/name/:skill_name/archive/

Example response

Status 204 No response body

Create llm skills name duplicate

Required API key scopes

llm_skill:write

Path parameters

  • skill_name
    string

Request parameters

  • new_name
    string

Response


Example request

POST /api/environments/:project_id/llm_skills/name/:skill_name/duplicate
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_skills/name/:skill_name/duplicate/\
-d new_name="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"body": "string",
"license": "string",
"compatibility": "string",
"allowed_tools": [
"string"
],
"metadata": {},
"files": [
{
"path": "string",
"content_type": "string"
}
],
"outline": [
{
"level": 1,
"text": "string"
}
],
"version": 0,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "string"
}

Create llm skills name files

Required API key scopes

llm_skill:write

Path parameters

  • skill_name
    string

Request parameters

  • path
    string
  • content
    string
  • content_type
    string
    Default: text/plain
  • base_version
    integer

Response


Example request

POST /api/environments/:project_id/llm_skills/name/:skill_name/files
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_skills/name/:skill_name/files/\
-d path="string",\
-d content="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"body": "string",
"license": "string",
"compatibility": "string",
"allowed_tools": [
"string"
],
"metadata": {},
"files": [
{
"path": "string",
"content_type": "string"
}
],
"outline": [
{
"level": 1,
"text": "string"
}
],
"version": 0,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "string"
}

Create llm skills name files rename

Required API key scopes

llm_skill:write

Path parameters

  • skill_name
    string

Request parameters

  • old_path
    string
  • new_path
    string
  • base_version
    integer

Response


Example request

POST /api/environments/:project_id/llm_skills/name/:skill_name/files-rename
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_skills/name/:skill_name/files-rename/\
-d old_path="string",\
-d new_path="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"body": "string",
"license": "string",
"compatibility": "string",
"allowed_tools": [
"string"
],
"metadata": {},
"files": [
{
"path": "string",
"content_type": "string"
}
],
"outline": [
{
"level": 1,
"text": "string"
}
],
"version": 0,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "string"
}

Retrieve llm skills name files

Required API key scopes

llm_skill:read

Path parameters

  • file_path
    string
  • skill_name
    string

Query parameters

  • version
    integer

Response


Example request

GET /api/environments/:project_id/llm_skills/name/:skill_name/files/:file_path
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_skills/name/:skill_name/files/:file_path/

Example response

Status 200
RESPONSE
{
"path": "string",
"content": "string",
"content_type": "string"
}

Delete llm skills name files

Required API key scopes

llm_skill:write

Path parameters

  • file_path
    string
  • skill_name
    string

Query parameters

  • base_version
    integer

Response


Example request

DELETE /api/environments/:project_id/llm_skills/name/:skill_name/files/:file_path
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_skills/name/:skill_name/files/:file_path/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"body": "string",
"license": "string",
"compatibility": "string",
"allowed_tools": [
"string"
],
"metadata": {},
"files": [
{
"path": "string",
"content_type": "string"
}
],
"outline": [
{
"level": 1,
"text": "string"
}
],
"version": 0,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "string"
}

Retrieve llm skills resolve name

Required API key scopes

llm_skill:read

Path parameters

  • skill_name
    string

Query parameters

  • before_version
    integer
  • limit
    integer
    Default: 50
  • offset
    integer
  • version
    integer
  • version_id
    string

Response


Example request

GET /api/environments/:project_id/llm_skills/resolve/name/:skill_name
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/llm_skills/resolve/name/:skill_name/

Example response

Status 200
RESPONSE
{
"skill": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"body": "string",
"license": "string",
"compatibility": "string",
"allowed_tools": [
"string"
],
"metadata": {},
"files": [
{
"path": "string",
"content_type": "string"
}
],
"outline": [
{
"level": 1,
"text": "string"
}
],
"version": 0,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"deleted": true,
"is_latest": true,
"latest_version": 0,
"version_count": 0,
"first_version_created_at": "string"
},
"versions": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"version": 0,
"created_by": {
"id": 0,
"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
"distinct_id": "string",
"first_name": "string",
"last_name": "string",
"email": "user@example.com",
"is_email_verified": true,
"hedgehog_config": {},
"role_at_organization": "engineering"
},
"created_at": "2019-08-24T14:15:22Z",
"is_latest": true
}
],
"has_more": true
}

Community questions

Questions about this page? or post a community question.