Skip to content

Quickstart

You’ll need a Beru account (sign up, from $9 a month) and a terminal. Every example uses the production API, https://api.beru.airesearchlabs.si.

  1. Create an API key. In the console, open your project → API keys → Create key. Copy the key: it’s shown once. Keep it on your server, never in a browser or app.

    Terminal window
    export BERU_API_KEY="beru_sk_…"
  2. Upload a document. PDF, DOCX, TXT, Markdown, HTML, or a PNG, JPG or WebP image of a document (scans and photos are read for you), up to 50 MB.

    Terminal window
    curl https://api.beru.airesearchlabs.si/v1/documents \
    -H "Authorization: Bearer $BERU_API_KEY" \
    -F file=@handbook.pdf

    Beru answers 202 with the document and "status": "queued". Processing runs in the background and usually takes a few seconds.

  3. Wait until it’s ready. Poll the document with the id from the upload:

    Terminal window
    curl https://api.beru.airesearchlabs.si/v1/documents/DOCUMENT_ID \
    -H "Authorization: Bearer $BERU_API_KEY"

    When status is ready, it can be searched. If it’s failed, error says why in plain English.

  4. Ask a question.

    Terminal window
    curl https://api.beru.airesearchlabs.si/v1/answer \
    -H "Authorization: Bearer $BERU_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"query": "How many days of annual leave do I get?"}'
  5. Read the citations. The answer cites its sources as [1], [2]… and each number is in citations:

    {
    "answer": "Full-time staff get 25 days of annual leave plus bank holidays [1].",
    "citations": [
    {
    "number": 1,
    "document_title": "handbook.pdf",
    "page_from": 12,
    "page_to": 12,
    "document_id": "…",
    "chunk_id": "…"
    }
    ],
    "answered": true,
    "source": "generated",
    "query_log_id": "…"
    }

    If no document supports an answer, answered is false and Beru says it doesn’t know, instead of guessing. Those questions appear under Unanswered in the console.

Stuck? Email support@airesearchlabs.si.