> Feedback: If these docs are stale, missing, or confusing, post sanitized feedback to `https://docs.tempo.xyz/api/feedback` with `source: "mcp"`, a short `message`, and any relevant `toolName`, `relatedResource`, or `client`.
# Recipes

## Core Flow

```bash
tempo wallet -t whoami
tempo wallet services --search ai
tempo wallet services <SERVICE_ID>
tempo request --dry-run <SERVICE_ENDPOINT_URL> --json '{"input":"hello"}'
tempo request <SERVICE_ENDPOINT_URL> --json '{"input":"hello"}'
```

## Wallet Operations

```bash
# Wallet readiness and balances
tempo wallet whoami

# Key and spending-limit state
tempo wallet keys

# Fund wallet
tempo wallet fund

# Transfer tokens
tempo wallet transfer <AMOUNT> <TOKEN> <TO_ADDRESS>
```

For machine-readable output:

```bash
tempo wallet -t whoami
tempo wallet -t keys
```

## Service Discovery

```bash
# Search services by keyword
tempo wallet services --search ai

# Inspect one service to see exact endpoints
tempo wallet services <SERVICE_ID>
```

Tip: copy endpoint URL, method, and payload shape directly from service details.

## Request Execution

Preview before paying:

```bash
tempo request --dry-run <SERVICE_ENDPOINT_URL> --json '{"input":"hello"}'
```

Execute paid request:

```bash
tempo request <SERVICE_ENDPOINT_URL> --json '{"input":"hello"}'
```

## Session Management

```bash
# List sessions
tempo wallet sessions list

# Reconcile local state against on-chain state
tempo wallet sessions sync

# Preview close operations first
tempo wallet sessions close --dry-run --all

# Close orphaned sessions
tempo wallet sessions close --orphaned
```

## Agent and Script Mode

Use TOON output (`-t`) when command output is consumed by agents or scripts.

```bash
tempo wallet -t whoami
tempo wallet -t services --search ai
tempo wallet -t services <SERVICE_ID>
```

## Failure Recovery Shortcuts

```bash
# Wallet not ready / auth missing
tempo wallet login
tempo wallet -t whoami

# Suspected key issue
tempo wallet logout --yes
tempo wallet login
tempo wallet keys

# Request failing due to payload/path mismatch
tempo wallet services <SERVICE_ID>

# Insufficient funds
tempo wallet fund
```

If issues persist, continue with [Troubleshooting](/docs/cli/wallet).

## End-to-End Script Pattern

```bash
# 1) Ensure wallet is ready
tempo wallet -t whoami

# 2) Discover service details
tempo wallet -t services --search ai

# 3) Preview cost
tempo request --dry-run <SERVICE_ENDPOINT_URL> --json '{"input":"hello"}'

# 4) Execute
tempo request <SERVICE_ENDPOINT_URL> --json '{"input":"hello"}'
```

## See Also

1. [Reference](/docs/wallet/reference)
2. [CLI Reference](/docs/cli/wallet)
3. [Use with Agents](/docs/wallet/use-with-agents)
