API reference

Skills

Create, use, teach and manage skills.

Base URL https://api.wity.alphanimble.com, the same key as every other call (Authorization: Bearer wity_…). Skills belong to the key's account. Wherever a path takes {skill}, use the skill's id (sk_…) or its name. For what skills are and how they learn, see Skills and Parts.

The skill object#

{
"id": "sk_4f1c9e…",
"object": "skill",
"name": "urgent-ticket",
"description": "Urgent = the customer cannot use the product, a security problem, or money taken wrongly.",
"question": { "type": "noul", "instructions": "Does this support ticket need a reply within the hour?" },
"parts": null,
"combine": null,
"metadata": {},
"examples": 72,
"status": "ready",
"answered_by": "examples",
"active": true,
"version": 3,
"quality": { "accuracy": 0.94, "accuracy_without_skill": 0.67, "checked_on": 72 },
"created_at": 1792400000,
"updated_at": 1792400004
}
fieldmeaning
statusneeds_examples, learning or ready
answered_byquestion, rule, parts or examples: how decisions are answered now
activetrue when decisions use what the skill learned from its examples
qualitynull until it has learned; then accuracy on its own held-back examples, with and without the skill
versiongoes up each time it learns or changes
created_at, updated_atUnix seconds

Create a skill#

POST/v1/skills
name
stringrequired
Up to 64 characters: letters, digits, _, - and .; unique in your account; not starting with sk_.
question
question objectrequired
A noul or choice question, as in /v1/systemone.
description
string
For you and your team. Up to 2,000 characters.
examples
array
Up to 1,000 {"state", "answer"} objects. answer is yes / no (or true / false) for noul, an option id for choice.
parts
object | "auto"
Name to question (a string or a question object), up to 32; or "auto" for Wity to write them. See Parts.
combine
string
A rule over the part names with and, or, not and brackets. noul skills only.
metadata
object
Yours to keep. Up to 8,000 characters as JSON.

Returns the skill object with usage: adding examples is billed once, on the tokens of their states (with the question and its parts). 409 if the name is taken.

Use a skill#

In any request's questions, "<id>": {"skill": "<skill>"}. The answer has the skill's type and adds skill (id, name, version, answered_by, active) and, for skills with parts, parts. A skill question takes no other fields.

List, get, update and delete#

GET/v1/skills

Newest first. limit 1 to 100 (default 20) and after (the last id of the page before). Returns a list:

{ "object": "list", "data": [ … ], "has_more": false }
GET/v1/skills/{skill}
PATCH/v1/skills/{skill}

Any of name, description, question, parts, combine and metadata. A new question, parts or rule makes the skill learn again (status becomes learning); "parts": null removes the parts and their rule. A new question must still offer every answer its examples use.

DELETE/v1/skills/{skill}

Deletes the skill and its examples. Returns {"id", "object": "skill", "deleted": true}.

Examples#

POST/v1/skills/{skill}/examples

{"examples": [ … ]}, 1 to 1,000 per call. Returns the added examples, the updated skill and usage. The skill starts learning a moment later.

GET/v1/skills/{skill}/examples

Newest first, with limit and after. Each example:

{ "id": "ex_a62d…", "object": "skill.example", "state": "…", "answer": "no",
"source": "session", "session_id": "ses_9a…", "created_at": 1792400100 }

source is api for examples you sent and session for feedback from a session.

DELETE/v1/skills/{skill}/examples/{example_id}

Limits and errors#

limitvalue
skills per account500
examples per skill20,000
examples per call1,000
parts per skill32
to start learning8 examples, at least 2 for each of two answers

Errors are {"error": "<what is wrong and how to fix it>", "code": "invalid_request" | "not_found" | "conflict"} with status 400, 404 or 409. Unknown fields are rejected with 400.

Note

Reading and managing skills is free. Only adding examples, and decisions, are billed. See Errors, limits & billing.

Previous

← Generate: POST /v1/generate

Next

Sessions: /v1/sessions →