Praus Developers Get API access

Get started

Quickstart

Check that Praus is reachable, then send your first authenticated request and read the answer.

#Before you start

  • API access turned on for your account. If it isn’t yet, contact us.
  • A Praus API key from Settings → Developer in the Praus app. See API keys and access.
  • cURL, Python 3 with requests, or Node.js 18 or later.

#1. Store your key

Keep the key out of your source code. Set it as an environment variable on the machine that will call Praus:

export PRAUS_API_KEY="YOUR_PRAUS_API_KEY"
$env:PRAUS_API_KEY = "YOUR_PRAUS_API_KEY"

#2. Check the service

The health endpoint needs no key. It tells you Praus is reachable:

curl https://praus.ai/api/health
200 OK
{
  "status": "ok",
  "service": "Praus"
}

A healthy response confirms the service is up. It doesn’t check your key, so the next step is the real test.

#3. Send a message

curl https://praus.ai/api/chat/compound-pipeline-sync \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: $PRAUS_API_KEY" \
  -d '{
  "message": "A warehouse has 12 boxes containing 24 units each and ships 37 units. How many units remain?",
  "queryProfile": "ask",
  "searchEnabled": false,
  "stream": false,
  "sessionOnly": true,
  "userMemory": {
    "memories": [],
    "customInstructions": ""
  }
}'
import os
import requests

response = requests.post(
    "https://praus.ai/api/chat/compound-pipeline-sync",
    headers={
        "Content-Type": "application/json",
        "X-Api-Key": os.environ["PRAUS_API_KEY"],
    },
    json={
        "message": "A warehouse has 12 boxes containing 24 units each and ships 37 units. How many units remain?",
        "queryProfile": "ask",
        "searchEnabled": False,
        "stream": False,
        "sessionOnly": True,
        "userMemory": {"memories": [], "customInstructions": ""},
    },
    timeout=120,
)

data = response.json()
if not response.ok:
    raise RuntimeError(f"{response.status_code} {data.get('code')}: {data.get('message')}")

print(data["result"]["content"])
// Node.js 18 or later (built-in fetch). Run on your server, never in a browser.
const response = await fetch("https://praus.ai/api/chat/compound-pipeline-sync", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-Api-Key": process.env.PRAUS_API_KEY,
  },
  body: JSON.stringify({
    message: "A warehouse has 12 boxes containing 24 units each and ships 37 units. How many units remain?",
    queryProfile: "ask",
    searchEnabled: false,
    stream: false,
    sessionOnly: true,
    userMemory: { memories: [], customInstructions: "" },
  }),
});

const data = await response.json();
if (!response.ok) {
  throw new Error(`${response.status} ${data.code}: ${data.message}`);
}

console.log(data.result.content);

Prefer the Authorization header? Both are supported:

Alternative header
Authorization: Bearer YOUR_PRAUS_API_KEY

#4. Read the answer

A successful request returns HTTP 200 with a single JSON object. Read the answer from result.content:

200 OK · application/json
{
  "type": "done",
  "result": {
    "content": "251",
    "sources": [],
    "images": [],
    "thoughtProcess": []
  }
}

The response can include other fields. Read the ones you need and ignore the rest, so your code keeps working as the response grows.

#If something goes wrong

StatusCodeWhat to check
401UNAUTHORIZEDThe key is missing, mistyped or revoked.
403CONSUMER_API_NOT_INCLUDEDAPI access isn’t enabled for this account. Contact us.
400MESSAGE_REQUIREDmessage is missing or empty.
429CONSUMER_API_RATE_LIMITToo many requests this minute. Wait and retry.

The full list is in Limits and errors.

#Next steps