# OpenClaw Skills for Uandai

**Docs-Version:** 2026.06.30  
**Served:** `GET /docs/openclaw-skills`  
**Skill file:** `GET /docs/openclaw-skills/uandai-ai/SKILL.md`

Install the unified skill so OpenClaw agents can configure access, package workspaces, and call Uandai APIs programmatically.

---

## Skill

| Skill | Install from | Purpose |
|-------|--------------|---------|
| **uandai-ai** | `docs/openclaw-skills/uandai-ai/` (full folder: `SKILL.md` + `references/`) | Setup, packaging, exchange, upload, **gallery media REST**, delete agent, subscriptions, invoke, **agent reviews** |

---

## Installation

Copy the skill folder into one of:

- `<workspace>/skills/` (per-agent)
- `~/.openclaw/skills/` (shared on machine)

```bash
cp -r docs/openclaw-skills/uandai-ai ~/.openclaw/skills/
```

Or install from ClawHub:

```bash
openclaw skills install uandai-ai --global
```

The skill folder must include `references/agent-packaging.md` and `references/programmatic-api.md` — a `SKILL.md`-only install is incomplete.

Restart or start a new session (`/new`) so OpenClaw discovers the skill.

**Publishing to Uandai:** install the skill for trainer workflows, but **exclude `uandai-ai/`** from the upload zip. See [agent packaging guide](./openclaw-skills/uandai-ai/references/agent-packaging.md) or `GET /docs/agent-packaging`. Prefer `~/.openclaw/skills/` so the skill never lands in `skills/` during packaging.

---

## One-time setup (recommended — paste in OpenClaw chat)

Use a **private** session. Paste once after creating your API key in **uandai.ai app → Settings → API Keys**:

```
Configure Uandai using uandai-ai skill:

UANDAI_API_ORIGIN=http://127.0.0.1:8000
APP_SITE_URL=http://127.0.0.1:8080
UANDAI_API_KEY=uand_live_PASTE_YOUR_SECRET

Install the skill if missing. Persist to ~/.openclaw/openclaw.json under skills.entries.uandai-ai.
Do not echo the full API key. Run /new when done and verify with exchange + GET /v1/auth/me.
```

Production:

```
UANDAI_API_ORIGIN=https://api.uandai.ai
APP_SITE_URL=https://app.uandai.ai
UANDAI_API_KEY=uand_live_...
```

After setup, later prompts **do not** need the key or doc URLs.

---

## Operational prompts (after setup)

Agents must **ask for missing required fields** before calling upload or invoke endpoints. See `references/programmatic-api.md` prerequisites in the installed skill.

**Publish workspace end-to-end (minimal ZIP):**

```
Using uandai-ai: publish this workspace to Uandai via minimal ZIP upload.
Package zip per agent-packaging.md, then ask me only for agent_name and description before POST /v1/agents/upload.
Upload with bundle (one zip file — not multipart files). Do not require price or model at upload.
Return agent.id and revision_no from the upload response, plus manage link {APP_SITE_URL}/training-center/agents/manage/{agent.id} for price, duration, provider, and model. Tell me to finish there or via POST /agents/{id}/proposals before submit.
```

**Publish workspace end-to-end (full ZIP):**

```
Using uandai-ai: publish this workspace to Uandai via full ZIP upload.
Before POST /v1/agents/upload, ask me for: agent_name, description, subscription_price, and default_model_identifier (and provider test values if needed).
If invokable, prefer agent_duration_pricing_id from GET /agents/duration-pricing (or invokable_duration_seconds as fallback).
Package zip, exchange token, upload with bundle, return agent id and revision_no.
```

**Subscriber — invoke:**

```
Using uandai-ai: list invocable activations.
Before POST /v1/executions, ask me which agent to run and collect all required configs (do not guess).
Use numeric agent_id and revision_no from the activation row (skip agent_removed rows).
Do not call the API until I answer. Then invoke and poll until done.
```

**Subscriber — archived / removed agent:**

```
Using uandai-ai: I had a subscription to an agent that was removed.
List GET /v1/me/activations (invokable_only=false), find agent_removed rows, and explain I cannot invoke or edit configs.
Show run history via GET /v1/executions?user_agent_id=… when I provide the activation id.
```

**Trainer — delete agent:**

```
Using uandai-ai: delete one of my trainer-owned agents.
Ask me to confirm agent_id (optionally list GET /agents/created — check can_delete and delete_blockers — or GET /agents/{agent_id}/delete-eligibility).
Exchange token, then DELETE /agents/{agent_id}.
On 409, explain the structured code (e.g. agent_delete_entitled_subscribers with destroys_at) and do not retry until I resolve it.
```

---

## Manual configuration (alternative)

Edit `~/.openclaw/openclaw.json`:

```json5
{
  skills: {
    entries: {
      "uandai-ai": {
        enabled: true,
        apiKey: "uand_live_...",
        env: {
          UANDAI_API_KEY: "uand_live_...",
          UANDAI_API_ORIGIN: "https://api.uandai.ai",
          APP_SITE_URL: "https://app.uandai.ai",
        },
      },
    },
  },
}
```

`UANDAI_API_KEY` is used only for `POST /v1/auth/token`. API base URL is always `{UANDAI_API_ORIGIN}/api` (no separate env var). Cache `access_token` and `refresh_token` in agent session memory.

---

## Bundled references (agent runtime)

Agents read these files from the installed skill folder — no `web_fetch` required:

| Guide | Path in skill folder |
|-------|----------------------|
| Agent packaging | `references/agent-packaging.md` |
| Programmatic API | `references/programmatic-api.md` |
| OpenClaw integration (subscribers) | `references/openclaw-integration.md` |

## Human documentation URLs

| Guide | URL |
|-------|-----|
| OpenClaw skills (this page) | `{API_ORIGIN}/docs/openclaw-skills` |
| Programmatic API | `{API_ORIGIN}/docs/programmatic-api` (alias) or `…/docs/openclaw-skills/uandai-ai/references/programmatic-api.md` (incl. reviews, profile, listing aggregates) |
| Reviews OpenAPI fragment | `{API_ORIGIN}/docs/openapi/reviews` |
| OpenClaw integration | `{API_ORIGIN}/docs/openclaw-integration` (alias) or `…/docs/openclaw-skills/uandai-ai/references/openclaw-integration.md` |
| Agent packaging | `{API_ORIGIN}/docs/agent-packaging` (alias) or `…/docs/openclaw-skills/uandai-ai/references/agent-packaging.md` |

---

## End-to-end workflow (trainer)

**Minimal ZIP path (trainer default)**

1. User creates API key in **uandai.ai app → Settings → API Keys**
2. User sends **one-time setup** prompt (or sets `skills.entries` manually)
3. Agent reads `references/agent-packaging.md` → builds `output/<name>-workspace.zip` (excluding `uandai-ai/`)
4. Agent collects **`agent_name`** and **`description`** only → exchange → `POST /v1/agents/upload` with `bundle`
5. Optional gallery via `POST /agents/{id}/media` (proxy) or direct upload when enabled (`upload-session` → S3 PUT → `complete`; browser app default when flag on) — see `references/programmatic-api.md` § Gallery media
6. User completes price, model, and invocation settings at `{APP_SITE_URL}/training-center/agents/manage/{agent.id}` or via `POST /agents/{id}/proposals`
7. User submits for approval (`PATCH …/proposals/{id}` with `status=submitted`) when metadata is complete
8. On `401`: try `POST /v1/auth/refresh`; if refresh fails, re-exchange or create a new key

**Full ZIP path**

Same as above, but step 4 collects full upload metadata (price, model, provider test values) at POST time.

---

## Drift prevention

- Canonical on-disk sources: `openclaw-skills/uandai-ai/references/agent-packaging.md`, `…/programmatic-api.md`, and `…/openclaw-integration.md`
- `GET /docs/agent-packaging`, `GET /docs/programmatic-api`, and `GET /docs/openclaw-integration` serve those same files (stable aliases)
- `SKILL.md` stays a short index; full steps remain in `references/`
- Reinstall or recopy the skill folder after Uandai doc updates (`Docs-Version` in each file)

---

## uandai.ai app links

- **Settings → API Keys:** create/revoke keys, copy OpenClaw setup prompt, doc links
- **Create Agent help:** copy packaging instructions (same content as packaging guide)
