Management API

Define agents and skills, publish them, and read the project's usage.

Alongside conversations, the platform stores agent definitions (a system prompt, a model profile, and which tools, sub-agents and skills the agent may use) and skills (reusable instructions an agent can load). These calls go through AICE's shared transport, so they raise the AICE errors and retry like every other service.

The client takes base_url, api_key, user_id, user_role, timeout (seconds in Python, milliseconds in TypeScript) and max_retries / maxRetries. AsyncAgentPlatformClient has the same management resources with await. The agents and skills you define belong to the project, not to a user, so any user of the project can list and run them.

Agents

agent = client.agents.create({
    "name": "Support triage",
    "description": "Sorts incoming tickets and drafts first replies.",
    "system_prompt": "You triage support tickets for Acme…",
    "model_profile": "openweights:glm-5.3-flash",
    "tool_bindings": ["knowledge"],
    "subagent_bindings": [],
    "skill_bindings": [],
})
client.agents.publish(agent["id"])

agents = client.agents.list()["agents"]

A new definition is a draft until it's published; only a preview run can run a draft. The platform assigns id, the project, version and status itself, and ignores them if you send them. Any other unknown field is refused with a 422, as is a definition that wouldn't do what it says: a model with no key on the platform, a tool server that doesn't exist, or a subagent or skill id that isn't in the project.

FieldWhat it does
name, descriptionOther agents read these to decide whether to hand this one work.
system_promptThe agent's instructions.
model_profile"provider:model" from client.models.list(), or null/"default" for the platform's default. A run's own provider/model still win.
tool_bindingsTool server names from client.tools.list(): knowledge, crawler, data_brain, email, sandbox, and your own MCP servers as ext_<id> (see Your own MCP servers). null means every server, [] means none.
subagent_bindingsIds of your agents this one may hand work to, with its task tool. A subagent can delegate on to its own, up to the platform's depth limit (2 by default), at most 5 times a run.
skill_bindingsSkills this one may load with load_skill: "<id>" gets the published version, "<id>@<n>" holds it at version n, and "platform:<id>" (or "platform:<id>@<n>") is a library skill. skill_ref(id, version=, platform=) / skillRef(id, { version, platform }) builds them.
subagent_discovery, skill_discoveryAlso let it find any of your published agents or skills, not just the bound ones.
startersUp to 4 suggestion chips ({title, prompt}) to show before the user's first message. title is what's shown; prompt is what clicking it sends.
suggest_followupsA flag for your UI: when true, call suggestions.create_for_thread(thread_id, agent_id=…) after each reply and show what comes back. The platform doesn't do it for you.
approval_mode"off" (the default), "selected" or "all". Asks a person before this agent runs tool calls: "selected" for the tools in approval_tools, "all" for every call. It adds to the tools the platform already holds for approval (listed under approval in client.tools.list()). A paused run streams an interrupt; see Human in the loop.
approval_toolsThe tool names that need approval when approval_mode is "selected". Names come from client.tools.list(), plus task (handing work to a subagent) and load_skill.
memory_typesNarrows what the agent remembers about each user: any of "semantic" (facts and preferences) and "episodic" (summaries of past conversations). null (the default) is whatever the platform keeps; this can only turn memory off, never on.

Change an agent in place with agents.update(id, changes): the id stays, so code that runs it by id picks up the change, and version goes up. agents.delete(id) fails with a 409 while another agent binds it, naming them in details.used_by; pass force to remove those bindings and delete it anyway.

Starter chips

draft = client.agents.generate_starters(agent["id"])["suggestions"]
client.agents.update(agent["id"], {"starters": draft[:4]})

generate_starters drafts chips from what the agent is for and what it can use. Nothing is saved: it returns {"suggestions": [{title, prompt}]} and you keep the ones you want with update. It makes a model call. suggestions.starters() is different: it returns starters drawn from the user's recent conversations across all agents. For one agent's own, read starters from agents.get(id).

Filtering and status

agents.list(status="draft") / { status: "published" } returns only drafts or only published definitions, and the same for skills. Calls that change a definition (update, publish) return the new version of it.

Specs and bundles

An agent spec is exactly the body agents.create takes. Helpers load one from a file or from JSON you already have, keeping only the fields the service accepts (so a definition read back with agents.get works too):

PythonTypeScriptReturns
load_spec(path_or_dict)loadSpec(path) (Node only), toAgentSpec(json)an agent spec
load_bundle(path_or_dict)toBundle(json)a checked board bundle
AGENT_FIELDS, SKILL_FIELDSAGENT_FIELDS, SKILL_FIELDSthe accepted field names
BUNDLE_FORMATBUNDLE_FORMAT"aice.agent-bundle/v1"

A bundle is a whole board that can move between organizations: agents and skills refer to each other by a local ref instead of an id. agents.import_bundle(bundle, publish=True) creates every skill, then every agent leaves-first, rewrites the refs to the new ids and publishes them, returning {entry_agent_id, ids} ({ entryAgentId, ids } in TypeScript, with options.publish). A binding that isn't a ref in the bundle is passed through unchanged, so a bundle can point at agents or skills that already exist. It refuses a bundle without the right format, with a missing or duplicate ref, an entry that isn't an agent, or agents that delegate in a cycle (ValueError in Python, Error in TypeScript). See Agent Studio.

To draw agents, tools and skills as a flowchart, test them and export this JSON, use the console's Agent Studio.

Skills

skill = client.skills.create({
    "name": "refund-policy",
    "description": "How to decide whether a refund is allowed.",
    "content": "Refunds are allowed within 30 days when…",
})
client.skills.publish(skill["id"])

skills = client.skills.list()["skills"]

A skill's text is name, description and content (the instructions the agent loads), and it may carry files (an Agent Skills bundle). delete is a 409 while an agent binds it (naming them in details.used_by) unless you pass force.

Versions

What you edit is a draft: update changes it and bumps version, and agents never see it. publish freezes the draft as the next numbered version, which is what agents load from then on (publishing an unchanged draft keeps the current version). A binding can hold an agent at one version with "<id>@<n>".

client.skills.versions(skill["id"])          # {"published_version": 2, "versions": [...]}
client.skills.rollback(skill["id"], 1)       # publish version 1 again; the draft is untouched
client.agents.update(agent["id"], {"skill_bindings": [skill_ref(skill["id"], version=1)]})

Files and imports

A skill can be an Agent Skills folder: SKILL.md (whose front matter sets the name and description) plus any files it refers to, up to 10 MB. Bring one in from a zip or a public GitHub folder; it always arrives as a draft with flags naming anything a reviewer should look at, and its scripts are never run.

draft = client.skills.import_github("anthropics/skills", path="skills/pdf")   # pinned to the commit
draft = client.skills.import_zip("pdf.zip")                                   # or bytes
client.skills.set_bundle(draft["id"], "pdf-v2.zip")       # replace the draft
client.skills.files(draft["id"], version=1)               # paths, sizes, hashes, flags
zip_bytes = client.skills.export(draft["id"])             # the published version as a zip
client.skills.refresh_import(draft["id"])                 # GitHub: {"changed", "commit", "diff", "draft"}

Imports are sent once, never retried automatically: a retried import would create a second skill. refresh_import changes only the draft; publish when you've read the diff.

The platform skill library

AICE publishes skills every organization can use. Add one to make it available to your agents, following its latest version or held at one, then bind it as platform:<id>. You can't change a library skill; fork copies it into your organization as a draft you own.

client.skills.library.list()                       # {"skills": [... "added", "pinned_version"]}
client.skills.library.add("pdf", pinned_version=3)
client.skills.library.fork("pdf")                  # your own editable copy
client.skills.library.remove("pdf")

Your own MCP servers

An organization can connect MCP servers it runs, and its agents then use them as the tool source ext_<id>, with tools named ext_<id>__<tool>. These calls need an admin or owner (user_role="admin" with a user_id).

added = client.mcp_servers.create(
    "acme", name="Acme Tickets", url="https://mcp.acme.example/mcp",
    secret=os.environ["ACME_MCP_KEY"], auth={"type": "header", "name": "X-Api-Key"},
)
for tool in added["tools"]:                         # or client.mcp_servers.probe("acme")["tools"]
    client.mcp_servers.set_tool("acme", tool["name"], enabled=True, fingerprint=tool["fingerprint"])
client.agents.update(agent["id"], {"tool_bindings": ["knowledge", "ext_acme"]})
  • Nothing is on until you turn it on. Adding a server lists its tools; each reaches agents only once enabled with the fingerprint the probe showed, in exactly that definition. A tool whose definition later changes is withheld until you probe and enable it again (state: "changed", with approved_definition to compare).
  • Every call asks a person first by default (a run pauses as in Human in the loop). Pass require_approval=False to set_tool to let one run without asking.
  • One key for everyone. The secret is stored encrypted and never returned; every user of the organization acts with its access, so give it only what all of them should have.
  • https on the public internet only. Private and internal addresses are refused. list() shows each server's last_probe_at and last_error.

The console's Agent Studio › MCP servers page does the same for organization admins.

Agent memory

agents.memory(id) lists what an agent learned across its users when the platform keeps agent lessons ({"lessons": [{id, kind, text, source, at}]}), and agents.delete_memory(id, lesson_id) forgets one. Both need an admin or owner. What an agent remembers about each user is set with memory_types on the agent.

What the platform offers

servers = client.tools.list()["servers"]       # [{name, status, external, tools: [{name, description, input_schema}]}]
catalog = client.models.list()                 # {default, providers, limits}
  • tools.list() is what tool_bindings and approval_tools can name. A server's status is ok or degraded; treat a degraded server's tools as possibly unavailable. external marks your own MCP servers, and approval lists what always asks a person first.
  • models.list() is what model_profile can name, as "provider:model". default is the platform's default model, providers lists each with an available flag (and an error when it isn't), and limits holds max_subagent_depth and max_dispatches_per_run.

Usage

usage = client.usage.get(window="30d")

Returns the project's token totals, over window days (default 30).

Suggestions

suggestions.create_for_thread and suggestions.starters belong to conversations. See Titles and follow-ups.

Reference

PythonTypeScriptEndpointReturns
agents.list(status=)agents.list({ status })GET /agents{"agents": [...]}
agents.get(id)agents.get(id)GET /agents/{id}the agent, draft or published
agents.create(spec)agents.create(spec)POST /agentsthe new draft
agents.update(id, changes)agents.update(id, changes)PATCH /agents/{id}the agent, version + 1
agents.delete(id, force=)agents.delete(id, { force })DELETE /agents/{id}nothing; 409 while bound
agents.publish(id)agents.publish(id)POST /agents/{id}/publishthe published agent
agents.import_bundle(board)agents.importBundle(board)several{entry_agent_id, ids}
agents.generate_starters(id)agents.generateStarters(id)POST /agents/{id}/starters/generate{suggestions: [{title, prompt}]}, nothing saved
agents.memory(id), agents.delete_memory(id, lesson_id)agents.memory(id), agents.deleteMemory(id, lessonId)GET /agents/{id}/memory, DELETE …/{lesson_id}{lessons}; admin or owner
skills.list(), get, create, update, delete, publishthe same/skills…as for agents
skills.versions(id), rollback(id, n)the sameGET /skills/{id}/versions, POST …/rollback{published_version, versions}; the skill
skills.set_bundle, files, exportsetBundle, files, exportPUT …/bundle, GET …/files, GET …/exportthe draft; the file list; zip bytes
skills.import_zip, import_github, refresh_importimportZip, importGithub, refreshImportPOST /skills/import, …/import/github, …/{id}/import/refresha draft; {changed, commit, diff?, draft?}
skills.library.list/add/remove/forkthe same/skills/library…library skills; platform:<id>
mcp_servers.list/create/update/delete/probe/set_toolmcpServers.…, setTool/mcp-servers…servers and their tools; admin or owner
tools.list()tools.list()GET /tools{"servers": [{name, status, tools}]}
models.list()models.list()GET /models{default, providers, limits}
usage.get(window=)usage.get({ window })GET /usagetoken totals
suggestions.starters()suggestions.starters()GET /suggestions/starters{items, generated_at, source, generated}
suggestions.create_for_thread(id)suggestions.createForThread(id)POST /threads/{id}/postturn{thread_name, suggestions, generated}

Most of this table needs aice-agent-platform / @aiceafrica/agent-platform 0.2.2 or later; the changelog lists what 0.2.2 added.

On this page