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.

Usage and limits