# Quickstart

> Create a job from a plain-words description, add a candidate and read the ranked report, in curl, TypeScript or Python against the local sandbox.

Source: https://docs.b55.online/quickstart

## 1. Start the sandbox and get a key

```bash
pnpm dev:console
```

Open [localhost:3100/api-keys](http://localhost:3100/api-keys) and copy your sandbox key. It looks like `b55_test_` followed by 24 letters and digits. Then put it in your shell:

```bash
export B55_API_KEY=b55_test_your_key_here
```

## 2. Create a job and add a candidate

Describe the role in plain words, let B55 suggest the catalog role, create the job, and add one candidate by email. The job's `apply_url` is the one link every candidate gets.

```bash tab="curl"
API=http://localhost:3100/api/v0; AUTH="Authorization: Bearer $B55_API_KEY"
ROLE=$(curl -s -X POST $API/roles/suggest -H "$AUTH" -H 'content-type: application/json' \
  -d '{"description":"Senior React developer for our dashboard. Strong TypeScript."}' | jq -c '{base: .role, seniority, must}')
JOB=$(curl -s -X POST $API/jobs -H "$AUTH" -H 'content-type: application/json' \
  -d "{\"title\":\"Senior React developer\",\"role\":$ROLE,\"client_id\":\"tenant-42:req-7\"}" | jq -r .id)
CAND=$(curl -s -X POST $API/jobs/$JOB/candidates -H "$AUTH" -H 'content-type: application/json' \
  -d '{"email":"maya-frontend@example.com"}' | jq -r .id)
echo $JOB $CAND
```

```ts tab="TypeScript"
// quickstart.mjs (Node 18+). Not on npm yet: npm i b55@file:<repo>/packages/b55-sdk-ts
import { B55 } from 'b55';
const b55 = new B55({ apiKey: process.env.B55_API_KEY, baseUrl: 'http://localhost:3100/api' });
const s = await b55.roles.suggest({ description: 'Senior React developer for our dashboard. Strong TypeScript.' });
const job = await b55.jobs.create({ title: 'Senior React developer', role: { base: s.role, seniority: s.seniority, must: s.must }, client_id: 'tenant-42:req-7' });
const candidate = await b55.candidates.create(job.id, { email: 'maya-frontend@example.com' });
console.log(job.apply_url, candidate.id, candidate.status);
```

```python tab="Python"
# quickstart.py (Python 3.9+, no dependencies). Not on PyPI yet: pip install <repo>/packages/b55-sdk-py
import os
from b55 import B55
client = B55(api_key=os.environ["B55_API_KEY"], base_url="http://localhost:3100/api")
s = client.roles.suggest("Senior React developer for our dashboard. Strong TypeScript.")
job = client.jobs.create(title="Senior React developer", role={"base": s.role, "seniority": s.seniority, "must": s.must}, client_id="tenant-42:req-7")
candidate = client.candidates.create(job.id, email="maya-frontend@example.com")
print(job.apply_url, candidate.id, candidate.status)
```

The curl tab needs [`jq`](https://jqlang.org). The SDKs are **not published yet**, so `npm i b55` and `pip install b55` do not work today. Install them from this repo instead:

- TypeScript: build it once with `pnpm --filter "@perfstaq/b55-sdk..." build`, then run `npm i b55@file:<repo>/packages/b55-sdk-ts` in your project (the `b55@` part makes `import ... from 'b55'` work).
- Python: `pip install <repo>/packages/b55-sdk-py`, or skip installing and set `PYTHONPATH=<repo>/packages/b55-sdk-py/src`.

`<repo>` is the absolute path of your checkout. Both SDKs default to `https://api.b55.ai`, the production plan; for the sandbox pass `baseUrl` / `base_url` as above, or set `B55_BASE_URL=http://localhost:3100/api`.

## 3. Play the candidate

In production the candidate opens the job's `apply_url`, signs in with GitHub, consents and runs one command. In the sandbox you have three ways:

- **The apply page:** open `apply_url` in your browser, pick a fictional developer as the GitHub sign-in, consent, then either run the command it shows or press **Simulate scan**.
- **The real CLI:** after consenting, run the command from the repo root. It shows exactly what it would send and asks first: `pnpm b55 scan --candidate cand_… --demo` (sample data, so the report is honestly `self-reported`).
- **Advance:** move the candidate one step at a time with the sandbox-only endpoint:

```bash
for step in 1 2 3; do curl -s -X POST $API/candidates/$CAND/advance -H "$AUTH" | jq -r .status; done
# opened, consented, ready
```

## 4. Read the ranked list and the report

```bash
curl -s "$API/jobs/$JOB/candidates?sort=ranked" -H "$AUTH" | jq '.data[] | {id, status, verdict, relevance, confidence}'
RPT=$(curl -s $API/candidates/$CAND -H "$AUTH" | jq -r .report_id)
curl -s $API/reports/$RPT -H "$AUTH" | jq '{verdict, reason, confidence, interview_questions}'
```

With the SDK, continuing the step 2 file:

```ts tab="TypeScript"
for (let i = 0; i < 3; i++) console.log((await b55.candidates.advance(candidate.id)).status); // opened, consented, ready
const ranked = await b55.candidates.list(job.id);
const { report_id } = ranked.data[0];
if (report_id) {
  const report = await b55.reports.get(report_id);
  console.log(report.verdict, report.reason, report.interview_questions);
}
```

```python tab="Python"
for _ in range(3): print(client.candidates.advance(candidate.id).status)  # opened, consented, ready
ranked = client.candidates.list(job.id)
report = client.reports.get(ranked.data[0].report_id)
print(report.verdict, report.reason, report.interview_questions)
```

`candidates.advance` is sandbox only; in production the candidate's own steps move them along.

The email's local part picks the fictional developer when they "sign in": `maya-frontend@…` gets a verified report, `nia-new@…` gets `insufficient-evidence`. See [Candidates](/candidates#sandbox-candidates) for all eight.

## Copy for Claude or Cursor

Paste this into your coding agent to have it wire B55 into your product.

```txt title="Prompt for Claude Code / Cursor"
Integrate the B55 developer-screening API into this codebase.

Docs (Markdown, read these first):
- http://localhost:3200/llms.txt
- http://localhost:3200/quickstart.md
- http://localhost:3200/jobs.md
- http://localhost:3200/candidates.md
- http://localhost:3200/reports.md
- http://localhost:3200/webhooks.md
OpenAPI spec: http://localhost:3200/openapi.json

Facts:
- Base URL: process.env.B55_API_URL, default http://localhost:3100/api (sandbox). Paths start with /v0.
- Auth: header "Authorization: Bearer <B55_API_KEY>". Sandbox keys start with b55_test_. Never hard-code the key.
- Turn a job description into a role: POST /v0/roles/suggest {description}. Show the recruiter the reasons and let them edit.
- Create one job per opening: POST /v0/jobs {title, description, role, client_id}. role is a role id from GET /v0/roles, or {base, seniority, must, nice, ai_usage}. Put our customer and requisition id in client_id: repeating the call returns the same job.
- Share job.apply_url with every candidate, or add people: POST /v0/jobs/{job_id}/candidates {email, client_id}.
- List candidates ranked (verified first, then role fit, then confidence): GET /v0/jobs/{job_id}/candidates. There is no single score; never invent one.
- When a candidate is "ready" or "insufficient_evidence", fetch GET /v0/reports/{report_id}. Show verdict, reason, confidence and interview_questions. Label assessment numbers as self-reported.
- Errors are JSON {name, message, code, docs}; branch on code, not on message.

Write the integration, a small typed client, and a test that runs against the sandbox.
```

```txt title="Prompt for an agent that only needs to call the API"
You can screen developer candidates with the B55 API (sandbox at http://localhost:3100/api, header Authorization: Bearer $B55_API_KEY).
1. POST /v0/roles/suggest {"description": "<the job in plain words>"}; then POST /v0/jobs {"title": "<title>", "role": {"base": <role>, "seniority": <seniority>, "must": <must>}}. Keep job.id and share job.apply_url.
2. To add someone directly: POST /v0/jobs/<job>/candidates {"email": "<candidate email>"}.
3. GET /v0/jobs/<job>/candidates for the ranked list; for a candidate with report_id, GET /v0/reports/<report_id>.
Report the verdict and reason in plain words, say which numbers are self-reported, and list the interview questions.
Docs: http://localhost:3200/llms-full.txt
```
