Assistiv Docs

[ REFERENCE ]

Capabilities

apiv0.1.0sdk@assistiv/sdk@0.2.0

Capabilities are paid, real-world API actions your end users' agents can discover and call on demand — image generation, geolocation, web scraping, data enrichment, translation, and more. Each call is pay-per-use, billed to the calling end user's budget. For the exact request and response shapes, see the Capabilities API reference.

Enabled per-platform by Assistiv

Capabilities is switched on for your platform by Assistiv — it grants access to a shared settlement wallet and sets your spend policy. Until it's enabled, the catalog is fully browseable, but search and run return 403. Ask your Assistiv contact to turn it on.

Two levels: capabilities and providers

The catalog is two layers deep, so an agent can reason about what it needs before it picks who runs it:

Capability

The category — a human-readable shelf like image-generation or geolocation. Each carries aggregates: how many providers sit under it, how many your policy currently allows, and the cheapest observed price.

Capability provider

One concrete endpoint under a capability, listed cheapest-first with an observed price range, a rating, and a health state. Its uid (cap_*) is the handle you pass to run.

Catalog prices are indicative, not binding

Listed prices are the last observed values. The binding price is the fresh quote taken at call time, capped by your policy ceiling — never a cached catalog number.

Turn it on for your end users

Once Assistiv has enabled Capabilities for your platform, rolling it out to an end user is two steps with your platform key: provision their sk-eu_* key, then give them a budget. A budget is required — a run with none returns 402.

  1. 1.Assistiv enables it. Capabilities is provisioned per-platform, along with your spend policy: curated vs open mode, an allowlist/denylist, a per-call price ceiling, and rating + health bars.
  2. 2.Provision the end user. Mint an sk-eu_* key with POST /v1/platforms/{platformId}/end-users.
  3. 3.Give them a budget. Capability runs are charged to the end user's USD budget; with no budget, a run returns 402.

The browse response carries an enabled flag so your UI can show the right state before a run would ever 403.

typescript
import { Assistiv } from "@assistiv/sdk";

// Platform key — server-side setup only.
const assistiv = new Assistiv({
  apiKey: process.env.ASSISTIV_PLATFORM_KEY,
});

// 1. Give the end user a key.
const { id, api_key } = await assistiv.endUsers.create({
  external_id: "user-42",
});

// 2. Give them a budget (required before any run can be charged).
await assistiv.budgets.create(id, { max_usd: 5, period: "monthly" });

// Hand api_key.raw_key (an sk-eu_* key) to that user's agent —
// it makes the search/run calls. Never the platform key.

How an agent uses it (MCP tools)

When Capabilities is enabled, an agent connecting to its per-user MCP URL with the end user's sk-eu_* key gets four tools automatically — no wiring by the platform. It plans over the menu, resolves to a provider, then runs it:

ToolWhat it does
list_capabilitiesThe category menu (~45 shelves). Plan over this first. No spend.
list_providersProviders under one category, filtered by sort / max_cost / min_rating / verified_only / limit. Each carries an input_example template. No spend.
capability_searchFreeform marketplace discovery when the category isn't obvious. No spend.
capability_runCall one provider by uid; spends the end-user budget. Pass max_pay to cap the spend.
javascript
// The agent's loop, in tool calls:
list_capabilities()
//   -> [ image-generation, legal-data, sports-data, identity-verification, ... ]

list_providers({ capability: "legal-data", sort: "rating", verified_only: true, limit: 5 })
//   -> [ { uid: "cap_abc", name: "...", min_price_usd: 0.004, rating: 4.7,
//          call_method: "GET", input_example: { query: "..." } }, ... ]

capability_run({ capability: "cap_abc",
                 input: { query: "CFAA court opinions" },  // shaped from input_example
                 max_pay: 0.02 })
//   -> { ok: true, final_state: "billed", cost_usd: 0.0095, result: { ... } }

The whole agent surface is product-named

Tool names, descriptions, fields, and errors are all product-named — the upstream marketplace never shows through. Each provider's input_exampleis the agent's copy-and-tweak template, so it builds input correctly instead of guessing.

The REST endpoints (what the tools wrap)

Platforms running their own agent loop can call these directly. They use the end user's sk-eu_* key (with the inference scope) — never the platform key. Search returns only providers your policy allows and costs nothing; run is the money path.

  1. 1.Browse or search. Pull the shelf with GET /v1/capabilities, or jump straight to a freeform POST /v1/capabilities/search. Both return only what your policy allows.
  2. 2.Run one.Pass the candidate's uid as capability, an optional input body, and an optional max_pay ceiling (it can only lower the policy ceiling, never raise it).
  3. 3.Read the outcome. cost_usd is the authoritative settled cost, final_state is released / billed / failed, and resultis the provider's response body.
bash
# 1. Find a provider (no spend).
curl -X POST https://api.assistiv.ai/v1/capabilities/search \
  -H "Authorization: Bearer sk-eu_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "query": "generate an image", "limit": 8 }'

# 2. Run it — pass the candidate's uid as "capability".
curl -X POST https://api.assistiv.ai/v1/capabilities/run \
  -H "Authorization: Bearer sk-eu_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "capability": "cap_abc123",
    "input": { "prompt": "a cat wearing sunglasses" },
    "max_pay": 0.02
  }'
json
// POST /v1/capabilities/run response
{
  "capability": "image-generation",
  "ok": true,
  "final_state": "billed",
  "status": 200,
  "cost_usd": 0.0095,
  "charged_end_user": true,
  "run_id": "b3f1c2a4-...-uuid",
  "result": {
    "image_url": "https://cdn.example/out.png",
    "width": 1024,
    "height": 1024
  }
}

Pricing & billing

  • Calls are charged to the end user's USD budget. The per-call ceiling is your policy's max_cost_per_call_usd, optionally lowered (never raised) per call by max_pay.
  • The run response is authoritative: cost_usd is the settled amount and charged_end_user tells you whether the budget moved.
  • A settled-but-failed call may still be charged (a platform-policy choice, on by default). Branch on final_state, not just ok.
  • End users read their remaining balance with GET /v1/me/budget.

Two 402 families, different fixes

A run can return 402 for policy reasons (above ceiling, denylisted, not allowlisted) or balance reasons (no budget, budget exhausted, wallet empty). The first is fixed by your policy or a cheaper provider; the second by topping up the budget or wallet.

Policy state & availability

Browse responses badge every provider with two orthogonal signals. Policy state is whether your policy lets it run; availabilityis the provider's upstream health. The same policy predicate drives both these badges and what search returns, so they can never disagree.

policy_stateMeaning
in_policyRunnable under your policy.
denylistedExplicitly blocked.
not_allowlistedCurated mode, not on the allowlist.
above_ceilingCheapest price exceeds your ceiling.
availabilityMeaning
healthyResponding normally at last sync.
unknownNot yet probed — still listed.
downFailing health checks; hidden from runs.

Full field-by-field shapes are in the Capabilities API reference.