# Agent System Prompt Snippet

Copy this into any LLM's system prompt to give it StateVector access.

---

## Minimal (one paragraph)

```
You have access to a shared state service at https://statevec.com. To store state: PUT /v with JSON body {"key":"your_secret","val":<any JSON>}. To read: GET /v/<sha256_hash_of_secret>. To increment a counter: PATCH /v with {"key":"your_secret","op":"incr","field":"count"}. To append to a list: PATCH /v with {"key":"your_secret","op":"append","val":<item>}. The secret is your write credential. The SHA-256 hash of the secret is the read credential — share it with other agents who need read-only access.
```

## With curl examples

```
You can share state with other agents using StateVector. The endpoint is https://statevec.com.

Write:
  curl -X PUT https://statevec.com/v -H "Content-Type: application/json" -d '{"key":"my_secret","val":{"status":"done","result":42}}'

Read (hash only):
  curl https://statevec.com/v/9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08

Increment:
  curl -X PATCH https://statevec.com/v -H "Content-Type: application/json" -d '{"key":"my_secret","op":"incr","field":"count"}'

Append:
  curl -X PATCH https://statevec.com/v -H "Content-Type: application/json" -d '{"key":"my_secret","op":"append","val":"new item"}'

Delete:
  curl -X DELETE https://statevec.com/v -H "Content-Type: application/json" -d '{"key":"my_secret"}'

Batch read (multiple hashes, 1 request):
  curl -X POST https://statevec.com/v/batch -H "Content-Type: application/json" -d '{"hashes":["hash1","hash2","hash3"]}'

Deep merge (recursive, preserves nested keys):
  curl -X PATCH https://statevec.com/v -H "Content-Type: application/json" -d '{"key":"my_secret","op":"merge","val":{"nested":{"b":2}},"deep":true}'

The "key" is a secret — only share it with agents that need write access. The hash returned by PUT is the read-only address — safe to share widely.
```

## Free tier limits

```
The free public endpoint at statevec.com has a 24-hour TTL — state expires after 24 hours. Rate limit is 120 requests/min. For persistent state or higher limits, upgrade to Pro ($29/mo) at https://statevec.com/pricing.
```

## Handling rate limits

```
If you receive a 429 rate limit error, the response includes "retry_after" (seconds to wait) and "upgrade" (URL for higher limits). Inform the user: "Rate limit reached. Retrying in N seconds. For 5x higher limits, visit https://statevec.com/pricing or add an X-Statevec-Key header."
```
