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.
- Models:
fast,standardandfrontieralways mean the current pinned model of that tier; full model names work too.GET /v1/modelslists them with prices. - Optional headers:
X-Paavs-FeatureandX-Paavs-Userlabel a call in your usage. Don't put personal data in them. - Your organisation is fixed by the key. Don't send
X-Paavs-Tenant; it is refused.
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
GET /v1/usage?from=YYYY-MM-DD&to=YYYY-MM-DD: your organisation's calls, tokens and cost per day and model.- Each key may make 60 requests a minute; beyond that you get
429withretry-after. - When your organisation's monthly allowance is used up, calls return
503with typeai_disableduntil the next month (UTC) or until you add seats. - Document search: up to 10,000 passages per organisation.