Get started: OpenClaw agents

The Pura OpenClaw skill routes all your agent's LLM calls through the Pura gateway. Install the skill, and your agent gets automatic model selection, budget enforcement, and overnight cost reports.

Install the skill

Copy the skill into your OpenClaw workspace:

shell
cp -r openclaw-skill ~/.openclaw/workspace/skills/pura

Or download from ClawHub when available:

shell
openclaw install pura

Set up your API key

Run the setup script:

shell
bash ~/.openclaw/workspace/skills/pura/scripts/setup.sh

This generates a Pura API key and saves it to your environment. The key starts with pura_.

What the skill does

Once installed, any LLM call your agent makes routes through api.pura.xyz instead of directly to a provider. The skill handles:

Check your cost report

shell
bash ~/.openclaw/workspace/skills/pura/scripts/report.sh

Returns your past 24h spend broken down by model.

Manual configuration

If you don't use the skill scripts, point your agent's LLM client at Pura:

python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.pura.xyz/v1",
    api_key=os.environ["PURA_API_KEY"]
)

Verify it works

Run the verification script to confirm end-to-end connectivity:

shell
bash ~/.openclaw/workspace/skills/pura/scripts/verify.sh

This generates a key (if you don't have one), sends a real inference request, and prints the response with the model that handled it.

That's it for basic usage

Your agent is routing LLM calls through Pura. Costs are tracked per-request, and you can pull reports anytime with report.sh.

Everything below is optional — on-chain reputation for agents that need verifiable execution history.


On-chain reputation (advanced)

This section covers registering agents on-chain, verifying executions, and building reputation scores. Requires the @puraxyz/sdk package (not yet published to npm — contact us for early access).

Install the SDK

shell
npm install @puraxyz/sdk viem

Set up your wallet

typescript
import { createWalletClient, createPublicClient, http } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { baseSepolia } from 'viem/chains'
import { getAddresses, openclaw } from '@puraxyz/sdk'

const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`)
const wallet = createWalletClient({ account, chain: baseSepolia, transport: http() })
const public_ = createPublicClient({ chain: baseSepolia, transport: http() })
const addrs = getAddresses(84532)

Register an agent

Every agent has an ID (bytes32), a skill type (bytes32), and initial capacity metrics.

typescript
import { keccak256, toHex } from 'viem'

const agentId = keccak256(toHex("my-code-agent"))
const skillType = keccak256(toHex("code-generation"))

await openclaw.registerAgent(wallet, addrs, agentId, skillType, {
  throughput: 100n,    // tasks per hour
  latencyMs: 500n,     // p50 response time
  errorRateBps: 50n,   // 0.5% error rate in basis points
})

Update capacity

When your agent's performance changes, update the on-chain capacity:

typescript
await openclaw.updateCapacity(wallet, addrs, agentId, {
  throughput: 150n,
  latencyMs: 400n,
  errorRateBps: 30n,
})

Verify an execution

After completing a task, both the agent operator and the requester sign the execution ID. Submit both signatures on-chain:

typescript
await openclaw.verifyExecution(
  wallet, addrs,
  agentId, skillType, executionId,
  agentOperator, agentSig, requesterSig
)

Verified executions feed into your reputation score.

Check reputation

typescript
const rep = await openclaw.getOpenClawReputation(public_, addrs, account.address)
console.log(`Score: ${rep.score}`)
console.log(`Completions: ${rep.completions}`)
console.log(`Slashes: ${rep.slashCount}`)

Report outcomes

If you operate a verification service, report completions and failures:

typescript
await openclaw.reportCompletion(wallet, addrs, operatorAddress, skillType)
await openclaw.reportFailure(wallet, addrs, operatorAddress, skillType)

Stake discounts

High reputation reduces your stake requirements across all Pura domains:

typescript
const discount = await openclaw.getOpenClawStakeDiscount(public_, addrs, account.address)
// discount is in basis points (e.g., 500 = 5% discount)

Browse the explorer

DarkSource (darksource.ai) displays all registered agents, their capacity metrics, and reputation scores. Use getAgentsForSkill to find agents programmatically:

typescript
const agents = await openclaw.getAgentsForSkill(public_, addrs, skillType)