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

# Get Eval

> Fetch one eval's frozen headline: grading status plus accuracy

*Rate limit tier: **general** (600 req/min) — see [Rate limits](/api-reference-v3/introduction#rate-limits).*

Fetches one [eval](/concepts/evals) by its `eval_id` — the poll target for a run launched with [`POST /v3/workflows/{workflow_id}/evals/`](/api-reference-v3/evals/launch). The `id` in the response is the same identifier the launch returned as `eval_id`.

The response is the eval's **frozen headline**: grading `status`, the `accuracy` fraction, its `matched` / `mismatched` / `ungraded` field tallies, the cohort's `file_count`, and `failed_count` (documents that failed to enqueue). It carries **counts, never internal ids**.

## Status model

The endpoint **always returns `200` while the eval exists** — there are no precondition errors while grading is in flight.

| `status`      | Meaning                                     | Headline (`accuracy`, `matched`, `mismatched`, `ungraded`) |
| ------------- | ------------------------------------------- | ---------------------------------------------------------- |
| `in_progress` | Extractions running / grading not finalized | `null`                                                     |
| `processed`   | Graded — terminal                           | populated                                                  |
| `error`       | Run failed — terminal                       | `null`                                                     |

Poll until `status` is terminal. On a `processed` eval, `accuracy` is the `matched / (matched + mismatched)` fraction — but it stays `null` when the graded denominator is 0 (nothing gradable, e.g. every field was `ungraded` for lack of ground truth). For production integrations, prefer [webhooks](/api-reference/webhooks/overview) over polling.

Unknown ids — including an eval on another workflow or organization — return `404` (existence never leaks). A caller who is not a member of the workflow's organization gets `403`.

<RequestExample>
  ```bash curl theme={null}
  curl -X GET 'https://api.anyformat.ai/v3/workflows/0686bb97-8c30-70f0-8000-97669e000eb8/evals/069dcc2c-e14c-7606-8000-2ee4fb17b4f9/' \
    -H 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```python Python (SDK) theme={null}
  import time

  from anyformat.sdk import Client

  client = Client(api_key="YOUR_API_KEY")

  workflow_id = "0686bb97-8c30-70f0-8000-97669e000eb8"
  eval_id = "069dcc2c-e14c-7606-8000-2ee4fb17b4f9"

  for _ in range(100):
      an_eval = client.get_eval(workflow_id, eval_id)
      if an_eval.status == "processed":
          print(f"accuracy={an_eval.accuracy} "
                f"({an_eval.matched}/{an_eval.mismatched}/{an_eval.ungraded})")
          break
      if an_eval.status == "error":
          print("Eval failed")
          break
      time.sleep(5)
  ```

  ```typescript TypeScript theme={null}
  interface EvalDetail {
    id: string;
    run_number: number;
    version_id: string;
    status: 'in_progress' | 'processed' | 'error';
    accuracy: number | null;
    matched: number | null;
    mismatched: number | null;
    ungraded: number | null;
    file_count: number;
    failed_count: number;
    created_at: string | null;
  }

  const workflowId = '0686bb97-8c30-70f0-8000-97669e000eb8';
  const evalId = '069dcc2c-e14c-7606-8000-2ee4fb17b4f9';
  const response = await fetch(
    `https://api.anyformat.ai/v3/workflows/${workflowId}/evals/${evalId}/`,
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );

  if (!response.ok) {
    throw new Error(`API error: ${response.status}`);
  }

  const an_eval: EvalDetail = await response.json();
  if (an_eval.status === 'processed') {
    console.log(an_eval.accuracy);
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response (200 OK — processed) theme={null}
  {
    "id": "069dcc2c-e14c-7606-8000-2ee4fb17b4f9",
    "run_number": 3,
    "version_id": "abcdef1234",
    "status": "processed",
    "accuracy": 0.94,
    "matched": 47,
    "mismatched": 3,
    "ungraded": 1,
    "file_count": 42,
    "failed_count": 0,
    "created_at": "2026-07-05T10:00:00.000Z"
  }
  ```

  ```json Response (200 OK — in progress) theme={null}
  {
    "id": "069dcc2c-e14c-7606-8000-2ee4fb17b4f9",
    "run_number": 3,
    "version_id": "abcdef1234",
    "status": "in_progress",
    "accuracy": null,
    "matched": null,
    "mismatched": null,
    "ungraded": null,
    "file_count": 42,
    "failed_count": 0,
    "created_at": "2026-07-05T10:00:00.000Z"
  }
  ```

  ```json Response (200 OK — error) theme={null}
  {
    "id": "069dcc2c-e14c-7606-8000-2ee4fb17b4f9",
    "run_number": 3,
    "version_id": "abcdef1234",
    "status": "error",
    "accuracy": null,
    "matched": null,
    "mismatched": null,
    "ungraded": null,
    "file_count": 42,
    "failed_count": 0,
    "created_at": "2026-07-05T10:00:00.000Z"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /v3/workflows/{workflow_id}/evals/{eval_id}/
openapi: 3.1.0
info:
  title: anyformat API
  description: >
    Document extraction and workflow automation API.


    AnyFormat lets you define extraction workflows that pull structured data
    from any document — PDFs, images, scanned files, or plain text. Upload a
    file, run it through a workflow, and get back structured fields with
    confidence scores and source evidence.


    ## Quick start


    See the [Quick start
    guide](https://docs.anyformat.ai/api-reference/introduction) for a
    walkthrough.


    ## Authentication


    All endpoints (except `/health/`) require a Bearer token in the
    `Authorization` header:


    ```

    Authorization: Bearer <your-api-key>

    ```


    Get your API key from
    [app.anyformat.ai/api-key](https://app.anyformat.ai/api-key).


    ## Versioning


    Endpoints are versioned by path prefix (`/v2/`, `/v3/`). Every response
    under

    a versioned prefix includes `X-API-Version`.
  version: 2.0.0
servers:
  - url: https://api.anyformat.ai
    description: API server
security: []
tags:
  - name: workflows
    description: >-
      Workflows define extraction templates — what fields to extract from
      documents. Create workflows, upload files, run extractions, and fetch
      results.
  - name: files
    description: >-
      File collections group uploaded documents and track their extraction
      progress. Upload files, check status, and retrieve extraction results.
  - name: suggestions
    description: >-
      AI-powered schema and workflow suggestion endpoints for the AnyFormat
      webapp. Authenticated with a Cognito JWT rather than an API key.
  - name: document-packets
    description: >-
      Document packets group uploaded documents for a workflow (v3). Address a
      packet directly to (re-)run its workflow.
  - name: runs
    description: >-
      Extraction runs — the v3 first-class result entity. Each run is a single
      execution of a workflow against a document packet; fetch its status and
      results flat by run id.
  - name: health
    description: Health check endpoints to verify API availability.
paths:
  /v3/workflows/{workflow_id}/evals/{eval_id}/:
    get:
      tags:
        - evals
      summary: Get eval
      description: >-
        Retrieve one eval's frozen headline — poll this until `status` leaves

        `in_progress`.


        `accuracy`, `matched`, `mismatched` and `ungraded` are `null` while the
        eval

        is `in_progress`; `accuracy` also stays `null` on a `processed` eval
        with a 0

        graded denominator. `id` here equals the launch's `eval_id`.


        An unknown eval, or one on another workflow or organization, returns 404

        (existence never leaks).
      operationId: v3_get_eval
      parameters:
        - name: workflow_id
          in: path
          required: true
          schema:
            type: string
            title: Workflow Id
        - name: eval_id
          in: path
          required: true
          schema:
            type: string
            title: Eval Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvalDetailV3'
          headers:
            X-RateLimit-Limit:
              description: Requests allowed per window (60s).
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests remaining in the current window.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Seconds until the current window resets.
              schema:
                type: integer
        '401':
          description: Authentication failed — missing, invalid, or expired API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                AUTH_FAILED:
                  value:
                    error: Authentication failed.
                    detail: Authentication failed.
                    error_code: AUTH_FAILED
                    retryable: false
                    request_id: req_abc123
        '404':
          description: >-
            Resource not found — the workflow, document packet, or run ID does
            not exist or is not visible to this API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                NOT_FOUND:
                  value:
                    error: Resource not found.
                    detail: Resource not found.
                    error_code: NOT_FOUND
                    retryable: false
                    request_id: req_abc123
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: >-
            Rate limited — retry after the `Retry-After` header. Default
            windows: 60 requests/minute for extraction submission, 600
            requests/minute for general endpoints.
          headers:
            Retry-After:
              description: Seconds until the next request is allowed.
              schema:
                type: integer
            X-RateLimit-Limit:
              description: Requests allowed per window (60s).
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests remaining in the current window.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Seconds until the current window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                RATE_LIMITED:
                  value:
                    error: Rate limit exceeded — retry after backoff.
                    detail: Rate limit exceeded — retry after backoff.
                    error_code: RATE_LIMITED
                    retryable: true
                    request_id: req_abc123
      security:
        - ApiKeyAuth: []
components:
  schemas:
    EvalDetailV3:
      properties:
        id:
          type: string
          title: Id
          description: >-
            Unique identifier of the eval (hyphenated UUID); equals the launch's
            `eval_id`.
          examples:
            - 069dcc2c-e14c-7606-8000-2ee4fb17b4f9
        run_number:
          type: integer
          title: Run Number
          description: 'Per-workflow run counter (#1, #2, …) for this eval.'
          examples:
            - 3
        version_id:
          type: string
          title: Version Id
          description: Workflow version the eval scored.
          examples:
            - abcdef1234
        status:
          $ref: '#/components/schemas/EvalStatus'
          description: >-
            Grading status. Non-terminal: `in_progress`. Terminal: `processed`,
            `error`.
          examples:
            - processed
        accuracy:
          anyOf:
            - type: number
            - type: 'null'
          title: Accuracy
          description: >-
            Headline accuracy in [0, 1]; `null` while `in_progress` and on a
            `processed` eval with a 0 graded denominator.
          examples:
            - 0.94
        matched:
          anyOf:
            - type: integer
            - type: 'null'
          title: Matched
          description: Fields that matched ground truth; `null` while `in_progress`.
        mismatched:
          anyOf:
            - type: integer
            - type: 'null'
          title: Mismatched
          description: Fields that mismatched ground truth; `null` while `in_progress`.
        ungraded:
          anyOf:
            - type: integer
            - type: 'null'
          title: Ungraded
          description: >-
            Fields with no ground truth to grade against; `null` while
            `in_progress`.
        file_count:
          type: integer
          title: File Count
          description: Number of dataset documents in the eval's realized cohort.
          examples:
            - 42
        failed_count:
          type: integer
          title: Failed Count
          description: Number of dataset documents that failed to enqueue for this run.
          examples:
            - 0
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: Timestamp when the eval was created (ISO 8601).
      type: object
      required:
        - id
        - run_number
        - version_id
        - status
        - file_count
        - failed_count
      title: EvalDetailV3
      description: >-
        One eval's frozen headline — the poll target for a launched run.


        ``id`` here is the same identifier the launch returned as ``eval_id``.
        The

        headline fields (``accuracy``, ``matched``, ``mismatched``,
        ``ungraded``)

        are ``null`` while ``status`` is ``in_progress``; ``accuracy`` stays
        ``null``

        on a ``processed`` eval whose graded denominator is 0.
    ErrorEnvelope:
      type: object
      title: ErrorEnvelope
      description: >-
        Uniform error response. `retryable=true` means the same request may
        succeed on retry (with backoff); `retryable=false` means the caller must
        change the request before retrying.
      required:
        - error
        - detail
        - error_code
        - retryable
        - request_id
      properties:
        error:
          type: string
          description: Short human-readable summary.
        detail:
          description: >-
            Machine-readable detail. String for most errors; list of field
            errors for validation failures.
          oneOf:
            - type: string
            - type: array
              items:
                type: object
        error_code:
          type: string
          description: Stable identifier for programmatic handling.
          examples:
            - VALIDATION_ERROR
            - AUTH_FAILED
            - NOT_FOUND
            - PRECONDITION_FAILED
            - RATE_LIMITED
            - INTERNAL_ERROR
            - GATEWAY_TIMEOUT
        retryable:
          type: boolean
          description: True when the caller should retry (with backoff for 429/412/5xx).
        request_id:
          type: string
          description: Correlates this response with server logs.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EvalStatus:
      type: string
      enum:
        - in_progress
        - processed
        - error
      title: EvalStatus
      description: >-
        Grading lifecycle of an eval. Non-terminal: ``in_progress`` (the
        headline

        fields are null). Terminal: ``processed`` (graded) and ``error``.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: http
      description: >-
        API key issued from app.anyformat.ai/api-key. Send as `Authorization:
        Bearer <key>`.
      scheme: bearer

````