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

# GET /v1/reputation/:agentId — fetch agent score

> Fetch the current reputation score and lifecycle status for an agent. Scores reflect a rolling window of the last 500 evaluations and update in seconds.

`GET /v1/reputation/:agentId` returns the current reputation score for a single agent within your organization. Pecta serves scores with low latency and keeps them up to date within seconds of each evaluation completing.

The score is a 0–1000 integer that reflects recent quality and consistency. It only becomes statistically meaningful after at least 50 evaluations, which is reflected in the `status` lifecycle field.

<Note>
  **Scoring formula:**
  `score = floor((pass_rate × 400) + (latency_score × 250) + (streak_score × 200) + (volume_score × 150))`

  Where `latency_score = max(0, 1 − avg_latency_ms / 100)`, `streak_score = min(streak, 50) / 50`, and `volume_score = min(evaluations, 500) / 500`.
</Note>

## Endpoint

```
GET https://api.pecta.ai/v1/reputation/:agentId
```

## Authentication

Required. Pass your API key as a Bearer token:

```
Authorization: Bearer pk_live_<your-key>
```

## Path parameters

<ParamField path="agentId" type="string" required>
  The agent identifier to look up. Must match the `agent_id` used at evaluation time.
</ParamField>

## Response fields

<ResponseField name="agent_id" type="string">
  The agent identifier.
</ResponseField>

<ResponseField name="score" type="number">
  Current reputation score, 0–1000. Returns `0` for agents that have never been evaluated.
</ResponseField>

<ResponseField name="evaluations" type="number">
  Total number of evaluations in the rolling window (max 500).
</ResponseField>

<ResponseField name="passed" type="number">
  Number of evaluations in the window that passed all gates.
</ResponseField>

<ResponseField name="pass_rate" type="number">
  Fraction of evaluations that passed, expressed as a decimal between 0 and 1.
</ResponseField>

<ResponseField name="avg_latency_ms" type="number">
  Average gate evaluation latency across the rolling window in milliseconds.
</ResponseField>

<ResponseField name="streak" type="number">
  Number of consecutive passing evaluations counting back from the most recent event.
</ResponseField>

<ResponseField name="status" type="string">
  Lifecycle stage of the agent:

  | Value           | Condition          | Meaning                                   |
  | --------------- | ------------------ | ----------------------------------------- |
  | `"new"`         | 0 evaluations      | No data yet                               |
  | `"calibrating"` | 1–49 evaluations   | Score building — treat as indicative only |
  | `"active"`      | 50–499 evaluations | Statistically reliable score              |
  | `"mature"`      | 500+ evaluations   | Full rolling window — most accurate       |
</ResponseField>

## New agent response

When no evaluations exist for the requested `agentId`, the API returns `200` with a zeroed-out record rather than `404`. This makes it safe to poll the endpoint before an agent has run any evaluations.

```json theme={null}
{
  "agent_id": "my-new-agent",
  "score": 0,
  "evaluations": 0,
  "passed": 0,
  "pass_rate": 0,
  "avg_latency_ms": 0,
  "streak": 0,
  "status": "new"
}
```

## Example request

```bash theme={null}
curl https://api.pecta.ai/v1/reputation/summarizer-v2 \
  --header "Authorization: Bearer pk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

## Example response

```json theme={null}
{
  "agent_id": "summarizer-v2",
  "score": 724,
  "evaluations": 214,
  "passed": 201,
  "pass_rate": 0.9393,
  "avg_latency_ms": 58,
  "streak": 22,
  "status": "active"
}
```
