# Score history

> Newest-first (by `received_at`), paginated history of every score recorded for the account. An unknown account returns `200` with an empty `scores` array and `total: 0`, not a 404.

Newest-first, paginated history of every score recorded for the account. An account with
no score history — including one that doesn't exist — returns `200` with an empty
`scores` array and `total: 0`, not a `404`.

> [!NOTE]
>
> **`ip` is a one-way token, not an address.** Tokens are stable, so you can group
> requests by origin and spot rotation across an account's history, but you can't
> reverse one back to an address.


## OpenAPI

````yaml openapi.json GET /v1/accounts/{accountId}/scores
openapi: 3.1.0
info:
  title: Vectoral API
  version: 1.0.0
  description: >-
    Fraud and abuse detection for AI app builders. Score the accounts hitting
    your AI features and catch the abuse draining your inference budget.
servers:
  - url: https://api.vectoral.cloud
    description: Hosted
  - url: http://localhost:8080
    description: Self-hosted (default bind)
security:
  - bearerAuth: []
paths:
  /v1/accounts/{accountId}/scores:
    get:
      tags:
        - Dashboard
      summary: Score history
      description: >-
        Newest-first (by `received_at`), paginated history of every score
        recorded for the account. An unknown account returns `200` with an empty
        `scores` array and `total: 0`, not a 404.
      operationId: accountScores
      parameters:
        - name: accountId
          in: path
          required: true
          schema:
            type: string
          description: >-
            The same `account_id` you send to `/v1/score`. URL-encode it if it
            contains reserved characters.
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
          description: >-
            Page size. Values above 200 are clamped to 200; zero, negative, or
            non-integer values fall back to 50 rather than erroring.
        - name: offset
          in: query
          schema:
            type: integer
            minimum: 0
            default: 0
          description: Rows to skip. Negative or non-integer values fall back to 0.
      responses:
        '200':
          description: Score history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScoreHistory'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    ScoreHistory:
      type: object
      properties:
        scores:
          type: array
          items:
            $ref: '#/components/schemas/ScoreHistoryItem'
        total:
          type: integer
          description: Total scores for the account across all pages.
          example: 5120
        limit:
          type: integer
          example: 50
          description: The page size actually applied (after clamping).
        offset:
          type: integer
          example: 0
      required:
        - scores
        - total
        - limit
        - offset
    ScoreHistoryItem:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 90210
        session_id:
          type:
            - string
            - 'null'
          example: sess_xyz
          description: The `session_id` you sent, or `null`.
        received_at:
          type: string
          format: date-time
        ip:
          type:
            - string
            - 'null'
          description: >-
            A keyed, one-way token derived from the client IP (or from the
            `ip_hash` you sent) — **not** the address you sent. Tokens are
            stable, so you can group requests by origin and correlate them
            across the account, but you cannot reverse one back to an address.
            `null` when no IP was sent.
          example: 9f2c4ab1e7d03b6a5c8e1f4d2a7b9c0e3f6a1d4b7c2e5f8a0b3d6c9e2f5a8b1d
        model_requested:
          type:
            - string
            - 'null'
          example: gpt-4
          description: The `request.model_requested` you sent, or `null`.
        estimated_prompt_tokens:
          type:
            - integer
            - 'null'
          example: 1247
          description: The `request.estimated_prompt_tokens` you sent, or `null`.
        score:
          type:
            - number
            - 'null'
          example: 0.82
          description: Risk score in [0, 1].
        tier:
          type:
            - string
            - 'null'
          enum:
            - low
            - medium
            - high
          example: high
          description: Risk tier of the score.
        reasons:
          type:
            - array
            - 'null'
          items:
            type: string
          description: Reason codes behind the score.
        shadow_mode:
          type: boolean
          example: false
          description: >-
            Whether the request was scored during the customer's shadow-mode
            warm-up. The stored score is always the unmasked one.
        deep_mode_active:
          type: boolean
          example: false
      required:
        - id
        - session_id
        - received_at
        - ip
        - model_requested
        - estimated_prompt_tokens
        - score
        - tier
        - reasons
        - shadow_mode
        - deep_mode_active
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: account_id required
          description: Human-readable message. Not stable — don't parse it.
      required:
        - error
      description: >-
        Uniform error envelope. The message is for humans and is not stable;
        branch on the HTTP status.
  responses:
    Unauthorized:
      description: Missing, malformed, unknown, expired, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missing:
              summary: No or malformed Authorization header
              value:
                error: 'missing or malformed Authorization: Bearer <api key>'
            invalid:
              summary: Unknown, expired, or revoked key
              value:
                error: invalid, expired, or revoked api key
    InternalError:
      description: >-
        Server-side failure (e.g. a database error). Read endpoints don't fail
        open.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your secret API key: `vg_live_` followed by 43 base64url characters.
        Send it as `Authorization: Bearer vg_live_…` on every `/v1` request
        (except `POST /v1/sensor/collect`, which uses a publishable site key in
        the body).

````
