> ## 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.

# Check texts for benchmark contamination

> Checks a batch of texts against the public-benchmark contamination index (13-word shingles of well-known test splits) and reports which inputs share material with which benchmark — use it before training so later benchmark scores measure capability, not memorised answer keys.

400 on invalid JSON, when `texts` is not an array of strings, or when it exceeds 5,000 items. `index: null` means the benchmark index was unavailable and NOTHING was checked — never treat that as clean. 'Clean' is a claim about THOSE benchmarks on THAT index date only. Free (no judging, no wallet spend). Response is Cache-Control: no-store. One text can produce multiple hits (one per benchmark it overlaps).



## OpenAPI

````yaml /openapi.json post /v1/datasets/decontaminate
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: []
paths:
  /v1/datasets/decontaminate:
    post:
      tags:
        - Logs
      summary: Check texts for benchmark contamination
      description: >-
        Checks a batch of texts against the public-benchmark contamination index
        (13-word shingles of well-known test splits) and reports which inputs
        share material with which benchmark — use it before training so later
        benchmark scores measure capability, not memorised answer keys.


        400 on invalid JSON, when `texts` is not an array of strings, or when it
        exceeds 5,000 items. `index: null` means the benchmark index was
        unavailable and NOTHING was checked — never treat that as clean. 'Clean'
        is a claim about THOSE benchmarks on THAT index date only. Free (no
        judging, no wallet spend). Response is Cache-Control: no-store. One text
        can produce multiple hits (one per benchmark it overlaps).
      operationId: decontaminateTexts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                texts:
                  type: array
                  items:
                    type: string
                  description: >-
                    Array of strings to check (each item must be a string). At
                    most 5,000 per call. Positions in this array are the `index`
                    values in the response.
              required:
                - texts
      responses:
        '200':
          description: >-
            { checked: <int, texts actually checked; 0 when the index was
            unavailable>, index: { version, generatedAt (camelCase — passed
            through verbatim), benchmarks: [{id, name, rows}] } | null, hits: [{
            index: <position in texts>, benchmark: <display name>, benchmark_id,
            matches: <shared shingle count> }], contaminated: <sorted unique
            int[] of input positions with any hit> }.
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  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'
  schemas:
    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.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your workspace API key, e.g. `sk_sovereign_...`, sent as `Authorization:
        Bearer <key>`.

````