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

# API overview

> SDK-first integration — Python then Node — with control-plane OpenAPI as the HTTP contract underneath.

**Start with the SDKs.** Alibi is SDK-first: extend, customize, and integrate through the language SDKs. Prefer:

1. [Python SDK reference](https://alibi.itsdote.tech/sdk/python.md) — primary / reference implementation
2. [Node SDK reference](https://alibi.itsdote.tech/sdk/node.md) — Express parity

Wire middleware + plugins into your app; use control-plane HTTP only when you need raw routes, CI hooks, or non-SDK clients.

## What’s in this tab

| Section | Role |
| - | - |
| [Python SDK](https://alibi.itsdote.tech/sdk/python.md) | **Preferred start** — generated from `python/alibi_sdk` |
| [Node SDK](https://alibi.itsdote.tech/sdk/node.md) | Same product surface for Express — generated from `packages/sdk-node` |
| Control plane OpenAPI | HTTP contract **underneath** the SDKs (not the preferred starting point) |

## HTTP contract (underneath)

The control-plane **TypeScript** route table is the source of truth for HTTP:

[`apps/control-plane/src/api/routes.ts`](https://github.com/valid22/alibi-ai/blob/main/apps/control-plane/src/api/routes.ts)

OpenAPI (`docs-site/openapi/control-plane.yaml`) is **generated** from that inventory (**57** operations — no invented endpoints). Regenerate with `cd docs-site && npm run openapi`.

This is **not** “Node over Python.” The control plane happens to be TypeScript; that does not demote the Python SDK. Language SDKs **consume** the HTTP API — they do not redefine it.

| Layer | Role |
| - | - |
| [Python SDK](https://alibi.itsdote.tech/sdk/python.md) / [Node SDK](https://alibi.itsdote.tech/sdk/node.md) | Primary integration surface (extend / customize / integrate) |
| Control-plane TypeScript routes | Source of truth for HTTP paths, methods, and behavior |
| OpenAPI (Control plane group) | Machine-readable view of those routes |

Base URL (local): `http://127.0.0.1:4100/api`

## Authentication

| Mechanism | Header |
| - | - |
| API key | `x-alibi-api-key: junnu-key-demo` |
| Bearer | `Authorization: Bearer <secret>` |
| Actor hint (demo) | `x-alibi-actor` |

Seeded demo keys: `junnu-key-demo`, `laddu-key-demo`, `viewer-key-demo`.

`GET /whoami` returns the resolved actor or `401`.

## Conventions

* JSON request/response bodies (`content-type: application/json`).
* Errors: `{ "error": "message" }` with 4xx status.
* Live Record sessions are **private to the recorder** until save-case.
* Cases, baselines, and runs are **project-shared** after save.
* Approve requires an actor role listed in project policy (`approveRoles`).

## Raw HTTP happy path (when not using an SDK)

```bash theme={null}
# 1. Start session (Junnu)
curl -s -X POST http://127.0.0.1:4100/api/projects/demo-coffee/sessions \
  -H 'content-type: application/json' -H 'x-alibi-api-key: junnu-key-demo' \
  -d '{"recorder":"junnu","isolationMode":"warm_pool"}'

# 2. SDK appends steps → POST /sessions/:id/steps

# 3. Stop + save
curl -s -X POST http://127.0.0.1:4100/api/sessions/$SID/stop
curl -s -X POST http://127.0.0.1:4100/api/sessions/$SID/save-case \
  -H 'content-type: application/json' -H 'x-alibi-api-key: junnu-key-demo' \
  -d '{"name":"junnu-latte-checkout"}'

# 4. Verify-live (Laddu)
curl -s -X POST http://127.0.0.1:4100/api/projects/demo-coffee/verify-live \
  -H 'content-type: application/json' -H 'x-alibi-api-key: laddu-key-demo' \
  -d '{"caseId":"CASE_ID","targetBaseUrl":"http://127.0.0.1:4200"}'
```


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