---
title: "Get AI detection results (POST)"
method: POST
path: "/ai-results"
tags: ["Results"]
---

# Get AI detection results (POST)

`POST /ai-results`

## Request

- Base URL: `https://codequiry.com/api/v1`
- URL: `https://codequiry.com/api/v1/ai-results`
- Auth: API key in header `apikey`

## Request body

- object
  - `assignment_id` integer, required

## Response `200`

AI results

- AIResults
  - `success` boolean
  - `assignment_id` integer: Echo of the requested check id.
  - `assignment_name` string
  - `message` string: Present only when the check has no submissions yet; `statistics` and `assignment_status` are omitted in that case.
  - `assignment_status` integer: Numeric status_id.
  - `statistics` object
    - `total_submissions` integer
    - `submissions_with_ai_detection` integer
    - `submissions_with_code_quality` integer
    - `avg_ai_detection` number
    - `avg_code_quality` number
    - `high_ai_risk_count` integer
    - `medium_ai_risk_count` integer
    - `low_ai_risk_count` integer
  - `submissions` object[]
    - `submission_id` integer
    - `filename` string
    - `status` string
    - `status_id` integer
    - `plagiarism_score` object
      - `local` number
      - `web` number
      - `total` number
    - `matches` object
      - `local` integer
      - `web` integer
    - `ai_detection` object, nullable: AI-generated-code detection for this submission. null until the AI engine has run.
      - `total_files` integer
      - `avg_ai_probability` number
      - `max_ai_probability` number
      - `min_ai_probability` number
      - `risk_level` 'high' | 'medium' | 'low': high (>=70), medium (>=45), or low.
      - `files` object[]
        - `id` integer
        - `file_path` string
        - `ai_probability` number
        - `human_probability` number
        - `classification` string: Human-readable verdict, e.g. AI-Generated, Likely AI, Human.
        - `confidence` number: 0-1 confidence in the classification.
        - `summary` string
        - `detailed_report` string, nullable
        - `created_at` string
    - `ai_code_quality` object, nullable: Static code-quality analysis for this submission. null until the AI engine has run.
      - `total_files` integer
      - `avg_score` number
      - `max_score` number
      - `min_score` number
      - `files` object[]
        - `id` integer
        - `file_path` string
        - `score` number
        - `level` string: High, Medium, or Low.
        - `total_lines` integer
        - `comment_density` number: Comment lines as a fraction of total lines.
        - `entropy` number: Token entropy; lower is more repetitive.
        - `issues` string[]: Detected code-quality issues. Empty when none were found.
        - `created_at` string
    - `file_size` integer
    - `created_at` string
    - `updated_at` string

## Other responses

- `401`: Missing or invalid API key. The API key is checked before any endpoint logic runs, so this is returned for every operation.
- `402`: The account is suspended for an unpaid invoice. Every endpoint returns this until the invoice is paid from the billing dashboard; it is not retryable and the request was not performed.
- `404`: Resource not found or not owned by this account.
- `422`: Request validation failed.
- `429`: Rate limit exceeded: more than 60 requests in one minute from this IP. Retry after the number of seconds in the Retry-After header. Successful responses carry X-RateLimit-Limit and X-RateLimit-Remaining too, so you can pace a client without waiting to be refused.

---

[API](https://skmtc.dev/codequiry/apis/codequiry-api.md) · [All operations](https://skmtc.dev/codequiry/apis/codequiry-api/llms.txt) · [OpenAPI document](https://skmtc.dev/codequiry/apis/codequiry-api/revisions/6297e91d9665?raw)
