Skip to main content
This walkthrough takes you from pip install to a decision visible on the dashboard. Pick the SDK you prefer; the REST API is the same underneath.
The tokens used below (pq_test_demo_key_REPLACE_ME, agent_1, customer IDs) are placeholders. Replace them with values from your Precipiq dashboard before copy-pasting into real code.

Prerequisites

  • A Precipiq API key — grab one from the dashboard. Keys look like pq_live_... (production) or pq_test_... (sandbox).
  • Python 3.12+ or Node 18+.
  • 30 seconds of network access to api.precipiq.dev.

Steps

1

Install the SDK

Install the Precipiq package for your language.
2

Log your first decision

Create a client and call log_decision / logDecision. The call returns a receipt containing the decision’s UUID and its position on the hash chain.
Run the script. You should see a UUID and a 64-character SHA-256 hash printed to stdout within ~200 ms.
3

See it in the dashboard

Open dashboard.precipiq.dev, sign in with the same API key, and the decision appears at the top of the Decisions timeline — usually within one second of the SDK call, thanks to the dashboard’s WebSocket stream.You should see a row whose timestamp matches the receipt.timestamp your SDK call just returned, with the pricing-bot agent label and a confidence badge at 82%.
4

Wrap a function with track

In production you rarely call log_decision directly. Instead, wrap the function that makes the decision — the SDK captures inputs, outputs, and any exception automatically.
5

Link the decision to a financial outcome

When the customer gets charged — via a Stripe webhook, an internal event, or any other billing system — link the decision to the resulting financial event so the AI P&L can attribute dollars.
For events that come from Stripe, the built-in webhook receiver auto-creates the financial event and the attribution engine proposes the link — see the Stripe integration guide.
6

Check your AI P&L

Query aggregated P&L for any date range. The same numbers appear on the P&L tab of the dashboard, live-updated as new events stream in.
In about five minutes you now have a live SDK install, a chain-linked decision on the ledger, a linked financial event, and an attribution visible on the dashboard.

Next: understand the data model

Concepts — the six record types and how they compose.