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

# Quickstart

> Start the Attexra API, Developer Console, and TypeScript sandbox flow locally.

This guide walks through running the Attexra stack locally and completing the end-to-end flow: creating an agent, issuing a signed grant, verifying an action, and reconciling sandbox evidence.

## Prerequisites

* Go 1.24+
* Node.js 22+
* PostgreSQL 17+ (`infra/docker/compose.yml` or a managed Postgres `DATABASE_URL`)

**1. Start PostgreSQL and the Go API**

```bash theme={null}
docker compose -f infra/docker/compose.yml up -d
cd apps/api
set -a && source .env.example && set +a
go run ./cmd/server
```

On startup, the API applies SQL migrations from `apps/api/migrations/` and listens on `:8080` with `/healthz`, `/readyz`, `/docs`, `/openapi.yaml`, and `/metrics`.

**2. Start the Developer Console and Landing Page**

From the repository root:

```bash theme={null}
# Developer Console (http://localhost:3000)
npm run dev:console

# Public Landing Page (http://localhost:3001)
npm run dev:web
```

Open `http://localhost:3000` and create an account or sign in to create agents, issue grants, and mint scoped `X-API-Key` credentials.

**3. Bootstrap an API key and run the payment sandbox**

```bash theme={null}
curl -sS -X POST http://localhost:8080/v1/organisations \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"name":"Procurement Demo"}'
```

Pass the returned `apiKey` to the sandbox example:

```bash theme={null}
cd examples/payment-sandbox
ATTEXRA_API_KEY="atx_..." node index.mjs
```

## Minimal TypeScript SDK call

```ts theme={null}
import { AttexraClient } from "@attexra/sdk";
import { randomUUID } from "node:crypto";

const client = new AttexraClient({
  apiKey: process.env.ATTEXRA_API_KEY!,
  baseUrl: "http://localhost:8080/v1",
});

const agent = await client.createAgent(
  { name: "Procurement Agent", ownerType: "organisation", ownerId: randomUUID() },
  randomUUID(),
);

const grant = await client.createAuthorization(
  {
    agentId: agent.id,
    action: "payment.create",
    resource: "invoice:1001",
    recipient: "merchant_demo",
    asset: "USDC",
    maximumAmount: "125.00",
    expiresAt: new Date(Date.now() + 3600_000).toISOString(),
  },
  randomUUID(),
);

const decision = await client.verifyAuthorization(
  {
    grant: grant.grant,
    action: "payment.create",
    resource: "invoice:1001",
    recipient: "merchant_demo",
    asset: "USDC",
    amount: "125.00",
  },
  randomUUID(),
);

console.log(decision.outcome, decision.decisionId);
```


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