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

# Import graded traffic

> Bring your own graded traffic. Each row — a conversation, the reply under judgment, optionally the human verdict — becomes a logged exchange the judge and alignment paths grade, through the same ingest pipeline as gateway traffic (scrubbing, retention, workspace scoping). A verdict is written as a human label in the same call, so a labelled export from another tool, a physician-rated benchmark, or a spreadsheet of tickets can calibrate a judge without replaying a single prompt through a model. Up to 200 rows per call, 30 calls per minute. Never retried: the ingest pipeline has no idempotency key, so a re-sent `request_id` is a duplicate you own.



## OpenAPI

````yaml /openapi.json post /v1/logs/import
openapi: 3.1.0
info:
  title: errorbar Management API
  description: >-
    The management API behind the improvement loop: capture and setup, request
    logs and datasets, grades (labels), judges (criteria), evals and deploy
    gates, fine-tuning and reinforcement learning, dedicated GPU endpoints, and
    model aliases and versions. Authenticated with a workspace API key
    (sk_sovereign_...). The inference API (chat, embeddings, rerank, responses)
    is OpenAI-compatible and documented separately.


    Responses are snake_case, list endpoints on the loop products use the
    {"object": "list", "data": [...]} envelope, and refusals use the same nested
    error shape the gateway emits: {"error": {"message", "type", "code"}}.
    Request bodies on the loop products (logs, labels, criteria, evals,
    datasets, aliases) are snake_case; the training and infrastructure products
    (fine-tuning, GRPO, environment tools, dedicated, model-version adoption)
    validate camelCase bodies, and each schema below says which it is. Endpoints
    that spend money require a key minted by a workspace owner or admin and
    return 403 otherwise.
  version: 1.0.0
servers:
  - url: https://gateway.errorbar.ai
    description: Production
  - url: https://www.errorbar.ai/api
    description: Control plane (also served at this base URL)
security:
  - bearerAuth: []
tags:
  - name: Certified reward
    description: >-
      The certified reward for your own trainer: sessions with judge
      certificates, scoring with a ledger-true kill switch, and the mid-run
      anchor that holds a run when the reward diverges from an independent
      judge.
paths:
  /v1/logs/import:
    post:
      tags:
        - Logs
      summary: Import graded traffic
      description: >-
        Bring your own graded traffic. Each row — a conversation, the reply
        under judgment, optionally the human verdict — becomes a logged exchange
        the judge and alignment paths grade, through the same ingest pipeline as
        gateway traffic (scrubbing, retention, workspace scoping). A verdict is
        written as a human label in the same call, so a labelled export from
        another tool, a physician-rated benchmark, or a spreadsheet of tickets
        can calibrate a judge without replaying a single prompt through a model.
        Up to 200 rows per call, 30 calls per minute. Never retried: the ingest
        pipeline has no idempotency key, so a re-sent `request_id` is a
        duplicate you own.
      operationId: importLogs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rows
              properties:
                rows:
                  type: array
                  items:
                    $ref: '#/components/schemas/ImportLogRow'
                  maxItems: 200
                tag:
                  type: string
                  description: Default tag for rows without one.
      responses:
        '200':
          description: Per-row outcomes and totals.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportLogsResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          description: '`logging_disabled` — request logging is off for this workspace.'
components:
  schemas:
    ImportLogRow:
      type: object
      required:
        - messages
        - response
      properties:
        request_id:
          type: string
          description: >-
            Optional caller id (letters, digits, _ . : -, max 100). Becomes
            `pg_im_<id>`; a re-sent id is your duplicate to avoid.
        messages:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
              content: {}
          description: The conversation as sent to the model (1..200 messages).
        response:
          oneOf:
            - type: string
            - type: object
              properties:
                content:
                  type: string
                tool_calls:
                  type: array
                  items:
                    type: object
          description: >-
            The assistant reply under judgment: plain text, or an OpenAI-shaped
            assistant message with tool_calls.
        model:
          type: string
          description: Model that produced the reply. Default `external/import`.
        tag:
          type: string
          description: Traffic tag (max 64). Overrides the call-level `tag`.
        tools:
          type:
            - array
            - 'null'
          items:
            type: object
        prompt_tokens:
          type: integer
        completion_tokens:
          type: integer
        finish_reason:
          type: string
        verdict:
          type: string
          enum:
            - pass
            - fail
          description: >-
            Human verdict, written as a label in the same call. Rows with a
            verdict need OWNER/ADMIN.
        critique:
          type: string
          description: Why (max 2000). Becomes judge few-shot material.
        scope:
          type: string
          enum:
            - request
            - trace
    ImportLogsResult:
      type: object
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            type: object
            properties:
              request_id:
                type: string
              logged:
                type: boolean
              reason:
                type: string
              labelled:
                type: boolean
              label_error:
                type: string
        imported:
          type: integer
        failed:
          type: integer
        labelled:
          type: integer
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              description: >-
                invalid_request_error, insufficient_quota, rate_limit_error, or
                api_error.
            code:
              type: string
              description: >-
                Machine-stable cause, e.g. invalid_api_key, not_found,
                insufficient_permissions, precondition_failed.
          required:
            - message
            - type
            - code
      description: >-
        Every refusal — gateway and management API alike — uses this one
        envelope.
  responses:
    BadRequest:
      description: Malformed request or invalid field.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing, malformed, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Invalid API key
              type: invalid_request_error
              code: invalid_api_key
    Forbidden:
      description: The key lacks the required owner/admin permission.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your workspace API key, e.g. `sk_sovereign_...`, sent as `Authorization:
        Bearer <key>`.

````