---
name: pulse
description: Connect and use a Pulse-issued inference key (PULSE locked on BNB Chain) in an agent or app. Use for Pulse agent setup, model selection, budget checks, inference, and understanding usage or rewards. Wallet funding and settlement stay in the Pulse app.
---

# Pulse for agents

Pulse lets a user lock PULSE (a BEP-20 token on BNB Chain) behind an inference key, use models through an OpenAI-compatible API, and earn reward eligibility from covered usage. This skill connects an agent to that existing key. It does not provide a key, wallet access, free inference, or authority to spend beyond the user's task.

## Which kind of key?

| Key prefix | Provider | Base URL |
|---|---|---|
| `sk_pulse_…` | Pulse gateway (OpenAI-compatible Chat Completions) | `https://aware-tiger-810.convex.site/v1` (shown in Pulse → Connect agent) |
| `sk-or-…` | OpenRouter (managed deployment) | `https://openrouter.ai/api/v1` |

Use the gateway URL shown in Pulse’s Connect agent panel. Never guess a gateway or send the key to any other host.

## Connect

1. The user creates and funds a key in Pulse (optionally **For an agent**) and waits for **Key ready**. Pending, closing or closed keys are not usable.
2. Configure the agent's **OpenAI-compatible Chat Completions** provider (or its native **OpenRouter** provider for `sk-or-` keys) with the base URL above. The inference endpoint is `POST /chat/completions` relative to that base. Do not append `/v1` twice.
3. The user supplies the key through the agent's private API-key field or a local secret (`PULSE_API_KEY` for gateway keys, `OPENROUTER_API_KEY` for OpenRouter keys). Do not request the key in chat. Never put it in this skill, a URL, logs, commits or public config.
4. Preserve other providers and defaults; scope setup to the selected agent or project.
5. Check `GET <base>/key` with `Authorization: Bearer <key>`. This reads the allowance without generating anything. Report usable/unusable and `data.limit_remaining` in **USD**. `null` means unknown/unbounded; `0` means no remaining allowance.

The key is a spending credential — not a wallet private key, seed phrase, or management key. Never ask for those. A user who lost their key should close it in Pulse and create a new one.

## Verify without spending

See [references/connection.md](references/connection.md) for request examples. A dependency-free Node 18+ helper is at [scripts/pulse-agent.mjs](scripts/pulse-agent.mjs):

```sh
PULSE_BASE_URL=https://aware-tiger-810.convex.site/v1 PULSE_API_KEY=... node scripts/pulse-agent.mjs check
PULSE_BASE_URL=https://aware-tiger-810.convex.site/v1 node scripts/pulse-agent.mjs models
```

Both are read-only. Inspect downloaded code before running it.

After a successful check, tell the user: provider configured, connection result, remaining allowance, model choice (or still needed), and where to see usage (Pulse → Activity).

## Choose models

- Fetch the current catalogue from `GET <base>/models`. Use exact IDs from the response; don't hardcode old models.
- Match modalities, tool support, context length and price to the task and budget. Don't silently switch to a pricier model.
- For image generation send `"modalities": ["image", "text"]` to an image-output model; images come back in `choices[0].message.images[].image_url.url`. See [references/media.md](references/media.md).

## Run work within budget

Know the task, model and the user-approved spending limit before autonomous work. The key's allowance is an outer cap, not permission to spend it all. Re-check `GET /key` before and after large batches. Multiple agents sharing one key share its allowance. Don't make requests just to earn rewards.

## Usage, rewards and stopping

Pulse **Activity** shows usage; each key's **Details** shows settlement and rewards. Holding PULSE, setup checks and unused keys earn nothing. Don't promise returns. The user closes a key in **Your Keys**; Pulse settles on BNB Chain (burns what was used, refunds the rest). Never close keys, claim rewards, or sign wallet transactions as part of setup or inference.

## Recover deliberately

- **401** — invalid, closed or expired key. Check the secret source without printing it.
- **402** — no allowance left or periodic budget reached. Stop and direct the user to Pulse.
- **400** — check model parameters and modalities.
- **429 / 5xx / timeouts** — bounded backoff; preserve generation IDs; check Activity before resubmitting since charges may already exist.
