PAAVS AI

API

The PAAVS AI API is the Anthropic Messages API with your organisation's key, plus document search. Create a key in the console under API keys.

Model calls

curl https://api.ai.paavs.com/v1/messages \
  -H "authorization: Bearer $PAAVS_AI_KEY" \
  -H "content-type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -d '{"model":"fast","max_tokens":300,
       "messages":[{"role":"user","content":"Draft a reply to a late-delivery complaint."}]}'

The Anthropic SDKs work unchanged: set the base URL to https://api.ai.paavs.com and the API key to your PAAVS AI key.

Document search

Store documents in a named space and search them. Only your organisation's documents are ever returned.

# index (re-sending a document id replaces it)
curl https://api.ai.paavs.com/v1/retrieval/spaces/policies/documents -H "authorization: Bearer $PAAVS_AI_KEY" \
  -d '{"documents":[{"id":"refunds","text":"Refunds within 30 days with a receipt.","metadata":{"team":"support"}}]}'

# search
curl https://api.ai.paavs.com/v1/retrieval/spaces/policies/search -H "authorization: Bearer $PAAVS_AI_KEY" \
  -d '{"query":"can I get my money back?","limit":5,"where":{"team":"support"}}'

# delete one document, or the whole space
curl -X DELETE https://api.ai.paavs.com/v1/retrieval/spaces/policies/documents/refunds -H "authorization: Bearer $PAAVS_AI_KEY"
curl -X DELETE https://api.ai.paavs.com/v1/retrieval/spaces/policies -H "authorization: Bearer $PAAVS_AI_KEY"

Search results are your documents' text. When you pass them to a model, treat them as data, not instructions.

Agents

Give one of your agents a task from your own software. You create and edit agents in the console; the API runs them.

# your agents
curl https://api.ai.paavs.com/v1/agents -H "authorization: Bearer $PAAVS_AI_KEY"

# run one (answers when the agent stops: finished, or waiting for an approval)
curl https://api.ai.paavs.com/v1/agents/agt_…/runs -H "authorization: Bearer $PAAVS_AI_KEY" \
  -H "content-type: application/json" \
  -d '{"task":"A customer asks if they can return an opened kettle after 20 days. Draft a reply."}'

# the same, as it happens (server-sent events: run, model_start, text, tool_start, tool_end, done)
curl -N https://api.ai.paavs.com/v1/agents/agt_…/runs -H "authorization: Bearer $PAAVS_AI_KEY" \
  -H "content-type: application/json" -d '{"task":"…","stream":true}'

# look a run up later
curl https://api.ai.paavs.com/v1/runs/run_… -H "authorization: Bearer $PAAVS_AI_KEY"

Usage and limits