bkn-agent (0.1.0)

Download OpenAPI specification:

BknAgent

Create Agent

Request Body schema: application/json
required
Agent Id (string) or Agent Id (null) (Agent Id)
name
required
string (Name) [ 1 .. 100 ] characters ^[0-9A-Za-z_一-鿿]+$
mode
string (Mode)
Default: "chat"
Enum: "chat" "task"
Prompt Id (string) or Prompt Id (null) (Prompt Id)
Prompt Vars Schema (object) or Prompt Vars Schema (null) (Prompt Vars Schema)
model
string (Model)
Default: ""
Array of any (Tools)
skills
Array of strings (Skills)
AgentLimits (object) or null
status
string (Status)
Default: "draft"
Enum: "draft" "published"

Responses

Request samples

Content type
application/json
{
  • "agent_id": "string",
  • "name": "string",
  • "mode": "chat",
  • "prompt_id": "string",
  • "prompt_vars_schema": { },
  • "model": "",
  • "tools": [
    ],
  • "skills": [
    ],
  • "limits": {
    },
  • "status": "draft"
}

Response samples

Content type
application/json
{
  • "agent_id": "string",
  • "name": "string",
  • "mode": "chat",
  • "prompt_id": "string",
  • "prompt_vars_schema": { },
  • "model": "",
  • "tools": [
    ],
  • "skills": [
    ],
  • "limits": {
    },
  • "status": "draft",
  • "create_user": "string",
  • "update_user": "string",
  • "create_time": 0,
  • "update_time": 0
}

List Agents

query Parameters
page
integer (Page) >= 1
Default: 1
size
integer (Size) [ 1 .. 100 ]
Default: 20

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "total": 0,
  • "page": 0,
  • "size": 0
}

Get Agent

path Parameters
agent_id
required
string (Agent Id)

Responses

Response samples

Content type
application/json
{
  • "agent_id": "string",
  • "name": "string",
  • "mode": "chat",
  • "prompt_id": "string",
  • "prompt_vars_schema": { },
  • "model": "",
  • "tools": [
    ],
  • "skills": [
    ],
  • "limits": {
    },
  • "status": "draft",
  • "create_user": "string",
  • "update_user": "string",
  • "create_time": 0,
  • "update_time": 0
}

Update Agent

path Parameters
agent_id
required
string (Agent Id)
Request Body schema: application/json
required
Agent Id (string) or Agent Id (null) (Agent Id)
name
required
string (Name) [ 1 .. 100 ] characters ^[0-9A-Za-z_一-鿿]+$
mode
string (Mode)
Default: "chat"
Enum: "chat" "task"
Prompt Id (string) or Prompt Id (null) (Prompt Id)
Prompt Vars Schema (object) or Prompt Vars Schema (null) (Prompt Vars Schema)
model
string (Model)
Default: ""
Array of any (Tools)
skills
Array of strings (Skills)
AgentLimits (object) or null
status
string (Status)
Default: "draft"
Enum: "draft" "published"

Responses

Request samples

Content type
application/json
{
  • "agent_id": "string",
  • "name": "string",
  • "mode": "chat",
  • "prompt_id": "string",
  • "prompt_vars_schema": { },
  • "model": "",
  • "tools": [
    ],
  • "skills": [
    ],
  • "limits": {
    },
  • "status": "draft"
}

Response samples

Content type
application/json
{
  • "agent_id": "string",
  • "name": "string",
  • "mode": "chat",
  • "prompt_id": "string",
  • "prompt_vars_schema": { },
  • "model": "",
  • "tools": [
    ],
  • "skills": [
    ],
  • "limits": {
    },
  • "status": "draft",
  • "create_user": "string",
  • "update_user": "string",
  • "create_time": 0,
  • "update_time": 0
}

Delete Agent

path Parameters
agent_id
required
string (Agent Id)

Responses

Response samples

Content type
application/json
{
  • "deleted": "string"
}

Chat

Request Body schema: application/json
required
agent_id
required
string (Agent Id)
Thread Id (string) or Thread Id (null) (Thread Id)
message
required
string (Message) non-empty
skills
Array of strings (Skills)
Prompt Override (string) or Prompt Override (null) (Prompt Override)
object (Prompt Vars)
Response Format (object) or Response Format (null) (Response Format)

Responses

Request samples

Content type
application/json
{
  • "agent_id": "string",
  • "thread_id": "string",
  • "message": "string",
  • "skills": [
    ],
  • "prompt_override": "string",
  • "prompt_vars": { },
  • "response_format": { }
}

Response samples

Content type
null

Invoke

Run once synchronously and return only when the task reaches a terminal state.

Only a published agent may be called; a draft answers exactly like a missing one. Both chat and task modes are accepted. Execution is a single stateless turn and no thread is persisted, while the task record is still stored so the run stays observable.

path Parameters
agent_id
required
string (Agent Id)
Request Body schema: application/json
required
message
required
string (Message) non-empty
skills
Array of strings (Skills)
Prompt Override (string) or Prompt Override (null) (Prompt Override)
object (Prompt Vars)
Response Format (object) or Response Format (null) (Response Format)

Responses

Request samples

Content type
application/json
{
  • "message": "string",
  • "skills": [
    ],
  • "prompt_override": "string",
  • "prompt_vars": { },
  • "response_format": { }
}

Response samples

Content type
application/json
{
  • "task_id": "string",
  • "agent_id": "string",
  • "status": "pending",
  • "input": { },
  • "output": "string",
  • "failure_detail": "string",
  • "parent_thread_id": "string",
  • "create_time": 0,
  • "update_time": 0
}

Run

Request Body schema: application/json
required
agent_id
required
string (Agent Id)
message
required
string (Message) non-empty
skills
Array of strings (Skills)
Prompt Override (string) or Prompt Override (null) (Prompt Override)
object (Prompt Vars)
Response Format (object) or Response Format (null) (Response Format)

Responses

Request samples

Content type
application/json
{
  • "agent_id": "string",
  • "message": "string",
  • "skills": [
    ],
  • "prompt_override": "string",
  • "prompt_vars": { },
  • "response_format": { }
}

Response samples

Content type
application/json
{
  • "task_id": "string",
  • "agent_id": "string",
  • "status": "pending",
  • "input": { },
  • "output": "string",
  • "failure_detail": "string",
  • "parent_thread_id": "string",
  • "create_time": 0,
  • "update_time": 0
}

Get Task

path Parameters
task_id
required
string (Task Id)

Responses

Response samples

Content type
application/json
{
  • "task_id": "string",
  • "agent_id": "string",
  • "status": "pending",
  • "input": { },
  • "output": "string",
  • "failure_detail": "string",
  • "parent_thread_id": "string",
  • "create_time": 0,
  • "update_time": 0
}

Create Prompt

Request Body schema: application/json
required
Prompt Id (string) or Prompt Id (null) (Prompt Id)
name
required
string (Name) [ 1 .. 100 ] characters
content
required
string (Content) non-empty
Vars Schema (object) or Vars Schema (null) (Vars Schema)

Responses

Request samples

Content type
application/json
{
  • "prompt_id": "string",
  • "name": "string",
  • "content": "string",
  • "vars_schema": { }
}

Response samples

Content type
application/json
{
  • "prompt_id": "string",
  • "name": "string",
  • "current_version": 0,
  • "content": "string",
  • "vars_schema": { },
  • "update_user": "string",
  • "update_time": 0
}

List Prompts

query Parameters
page
integer (Page) >= 1
Default: 1
size
integer (Size) [ 1 .. 100 ]
Default: 20

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "total": 0,
  • "page": 0,
  • "size": 0
}

Get Prompt

path Parameters
prompt_id
required
string (Prompt Id)

Responses

Response samples

Content type
application/json
{
  • "prompt_id": "string",
  • "name": "string",
  • "current_version": 0,
  • "content": "string",
  • "vars_schema": { },
  • "update_user": "string",
  • "update_time": 0
}

Publish Version

Publish a new version: write t_agent_prompt_version, advance current_version, take effect globally at once.

path Parameters
prompt_id
required
string (Prompt Id)
Request Body schema: application/json
required
content
required
string (Content) non-empty
Vars Schema (object) or Vars Schema (null) (Vars Schema)

Responses

Request samples

Content type
application/json
{
  • "content": "string",
  • "vars_schema": { }
}

Response samples

Content type
application/json
{
  • "prompt_id": "string",
  • "name": "string",
  • "current_version": 0,
  • "content": "string",
  • "vars_schema": { },
  • "update_user": "string",
  • "update_time": 0
}

List Versions

path Parameters
prompt_id
required
string (Prompt Id)

Responses

Response samples

Content type
application/json
{
  • "items": [
    ]
}

Rollback

path Parameters
prompt_id
required
string (Prompt Id)
Request Body schema: application/json
required
version
required
integer (Version) >= 1

Responses

Request samples

Content type
application/json
{
  • "version": 1
}

Response samples

Content type
application/json
{
  • "prompt_id": "string",
  • "name": "string",
  • "current_version": 0,
  • "content": "string",
  • "vars_schema": { },
  • "update_user": "string",
  • "update_time": 0
}

Get Effective Prompt

path Parameters
agent_id
required
string (Agent Id)

Responses

Response samples

Content type
application/json
{
  • "source": "override",
  • "content": "string",
  • "prompt_id": "string",
  • "version": 0
}

Put Override

path Parameters
agent_id
required
string (Agent Id)
Request Body schema: application/json
required
content
required
string (Content) non-empty

Responses

Request samples

Content type
application/json
{
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "agent_id": "string",
  • "account_id": "string",
  • "source": "override"
}

Delete Override

path Parameters
agent_id
required
string (Agent Id)

Responses

Response samples

Content type
application/json
{
  • "deleted": true,
  • "fallback": "default"
}

Get Thread

path Parameters
thread_id
required
string (Thread Id)

Responses

Response samples

Content type
application/json
{
  • "thread_id": "string",
  • "agent_id": "string",
  • "create_time": 0,
  • "update_time": 0,
  • "messages": [
    ]
}

Export Agents

Request Body schema: application/json
required
agent_ids
required
Array of strings (Agent Ids) non-empty

Responses

Request samples

Content type
application/json
{
  • "agent_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "format": "bkn-agent/v1",
  • "exported_at": 0,
  • "items": [
    ]
}

Import Agents

Request Body schema: application/json
required
required
object (ExportPackage)

Responses

Request samples

Content type
application/json
{
  • "package": {
    }
}

Response samples

Content type
application/json
{
  • "results": [
    ],
  • "warnings": [
    ]
}

Health

Responses

Response samples

Content type
application/json
null