# Quickstart

Make one request with curl, Python, or TypeScript.

Until launch, API access is by request: [request access](https://secndai.com/contact). The console at console.secndai.com is not open yet.

Use an invited account and create a server-side API key. Set `SECND_API_KEY` through your secret manager. Check `GET /v1/models` and substitute the full model ID your account returns; these examples use `ren-1.1.0` (Ren 1.1).

## curl

```bash
curl --fail-with-body https://api.secndai.com/v1/decide \
  -H "Authorization: Bearer $SECND_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{
    "model": "ren-1.1.0",
    "type": "choice",
    "situation": "A customer says the same order was charged twice.",
    "question": "Which queue should handle this ticket?",
    "options": [
      {"id": "billing", "description": "Payment and invoice problems"},
      {"id": "delivery", "description": "Shipping and parcel problems"}
    ],
    "threshold": 0.9
  }'
```

## Python

Install the local SDK from the repository root with `uv pip install ./packages/sdk-python` in your environment. The import is `secnd`.

```python
import os
from secnd import Secnd

client = Secnd(api_key=os.environ["SECND_API_KEY"])
result = client.decide({
    "model": "ren-1.1.0",
    "type": "choice",
    "situation": "A customer says the same order was charged twice.",
    "question": "Which queue should handle this ticket?",
    "options": [
        {"id": "billing", "description": "Payment and invoice problems"},
        {"id": "delivery", "description": "Shipping and parcel problems"},
    ],
    "threshold": 0.9,
})
print(result["choice"], result["probability"], result["action"])
```

## TypeScript

Build and install the local `@secnd/sdk` package as described in the [SDK overview](/sdk/index).

```typescript
import { Secnd } from "@secnd/sdk";

const apiKey = process.env.SECND_API_KEY;
if (!apiKey) throw new Error("Set SECND_API_KEY");
const client = new Secnd({ apiKey });
const result = await client.decide({
  model: "ren-1.1.0",
  type: "choice",
  situation: "A customer says the same order was charged twice.",
  question: "Which queue should handle this ticket?",
  options: [
    { id: "billing", description: "Payment and invoice problems" },
    { id: "delivery", description: "Shipping and parcel problems" },
  ],
  threshold: 0.9,
});
console.log(result.choice, result.probability, result.action);
```

## Handle the answer

Check `action` before running any downstream operation. On `ask_human`, enqueue the situation and candidate answer for review. On `act`, your code still enforces permissions and business rules. The API itself does not move a ticket or issue a refund.

The response also includes the full probability map, resolved model ID, effective threshold, and usage. See [probability and the gate](/confidence), [errors](/errors), and [request limits](/limits) before adding production traffic.
