> ## Documentation Index
> Fetch the complete documentation index at: https://tavryn.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Tavryn Quickstart: Import Contracts and Run the Agent

> Onboard your organization, import your SaaS contracts, and trigger Tavryn's autonomous procurement agent — from waste detection to USDC settlement.

Tavryn is designed to go from zero to a live negotiation in a single session. You will onboard your organization, import your SaaS and cloud contracts, and watch the agent run its full 7-stage loop — all without writing a line of code. If you want to test the experience before connecting real data, use the zero-context demo mode described at the bottom of this page.

**1. Access your dashboard**

Navigate to `/dashboard` in your browser. If you are a first-time visitor, Tavryn automatically loads the **Demo Co** workspace so you can explore the interface before committing any data. The dashboard shows your treasury balance (read live from the Arc Testnet via JSON-RPC), monthly software spend, identified savings opportunities, and realized savings from settled negotiations.

**2. Onboard your organization**

Go to `/onboard` to register your business and configure your spending policy. You will need to provide:

* **Company / Organization Name** — used to namespace all contracts, negotiations, and audit records.
* **Initial Treasury Balance (USDC)** — the USDC balance you plan to fund into your Arc Developer-Controlled Wallet. You can set this to `50000` for testing.
* **Spending Policy** — configure the three key thresholds that the deterministic policy engine enforces:

| Policy Field | Description |
| - | - |
| `max_auto_transaction` | Maximum deal value (USDC) the agent can approve without human sign-off |
| `min_savings` | Minimum savings (USDC) required before the agent pursues a negotiation |
| `human_approval_required_above` | Deals above this value trigger a 1-tap HMAC approval link |
| `allowed_categories` | Comma-separated list of software categories the agent may negotiate |

Once you commit, Tavryn provisions a Circle Developer-Controlled Wallet on Arc Testnet and returns your wallet address and funding instructions.

> [!TIP]
>
> Use the **Try Sample Statement CSV** or **Try Sample Invoice PDF** quick-load buttons on the onboard page to import pre-built Slack, Datadog, and AWS contracts instantly — no file preparation needed.

**3. Add your first contract**

Tavryn supports three contract ingestion methods. Choose the one that fits your workflow:

* **Statement or Invoice upload** — drag in a bank statement CSV or a vendor invoice PDF. Tavryn's import API (`POST /api/import/file`) extracts vendor name, service, category, annual price, renewal date, seat count, and active seat count automatically.
* **CSV upload** — supply a structured CSV with columns for `vendor`, `service`, `category`, `annual_price`, `renewal_date`, `seats`, `active_seats`, and `usage_decline_pct`.
* **Manual entry** — fill in the inline form fields on the onboard page to add a single contract row.

After import, the editable review table lets you confirm, correct, or exclude any detected subscription before committing.

**4. Run the agent**

From `/dashboard`, click **Run full demo** to trigger a live end-to-end execution. The agent will scan your renewal calendar, audit waste, compute the switch vs. renegotiate NPV matrix, run multi-round vendor negotiations, route the result through the Adversarial Reviewer, evaluate against your policy, and — if approved — escrow USDC on Arc.

You can also trigger the agent programmatically via the REST API:

```bash theme={null}
curl -X POST https://your-domain.com/api/agent/run-now \
  -H "Content-Type: application/json" \
  -d '{"businessId": "<your-business-id>", "force": true}'
```

The `force: true` flag bypasses the idempotency window (default 14 days) so you can re-run the agent during testing without waiting for the cooldown to expire.

> [!NOTE]
>
> The daily proactive agent also runs automatically at **08:00 UTC** via a Vercel Cron job (`GET /api/cron/daily`), authenticated with your `CRON_SECRET`. You do not need to trigger it manually in production.

**5. Review the activity timeline and respond to deals**

After the agent runs, the **Activity Timeline** on `/dashboard` displays a real-time, step-by-step log of every action — waste calculations, negotiation rounds, reviewer verdicts, policy decisions, and on-chain escrow events.

Deals that exceed your `human_approval_required_above` threshold will not auto-execute. Instead, Tavryn sends a **1-tap HMAC-SHA256 approval link** (valid for 48 hours) to your configured notification channel. Visit `/approve/[token]` to:

* Preview the full deal summary, savings amount, vendor terms, and policy evaluation.
* **Approve** the deal with a single authenticated POST — Tavryn re-verifies policy at redemption time before executing.
* **Reject** the deal and provide a structured override reason, which is stored in Tavryn's persistent override memory and used to calibrate future negotiations with that vendor.

Verified on-chain settlements display a live ArcScan link. Simulated transactions (when Circle/Arc keys are not configured) display a `Simulated (testnet mock)` badge with `is_simulated = true` recorded in the database — Tavryn never misrepresents the status of a transaction.

## Trigger the agent via API

Use this request to run the full autonomous loop for a specific business from any backend service, CI workflow, or scheduled job:

```bash theme={null}
curl -X POST https://your-domain.com/api/agent/run-now \
  -H "Content-Type: application/json" \
  -d '{"businessId": "<your-business-id>", "force": true}'
```

**Request body fields:**

| Field | Type | Required | Description |
| - | - | - | - |
| `businessId` | string | No | The UUID of the business to run the agent for. Omit to run against all businesses in scope. |
| `force` | boolean | No | Skip the 14-day idempotency window and force a fresh run |

The response includes the full agent run result: negotiations initiated, deals proposed, reviewer verdicts, policy outcomes, and any escrow transaction hashes.

> [!TIP]
>
> To explore Tavryn with no configuration at all, call `GET /api/demo/session`. This endpoint sets a demo session cookie and redirects you to `/dashboard`, where the pre-seeded **Demo Co** workspace (Slack, Datadog, and AWS contracts) is ready to use immediately — no Supabase credentials, Circle API keys, or environment setup required. From the dashboard, click **Run full demo** or call `POST /api/demo/reset-and-run` to trigger the full agent loop.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.