Developer Docs

CheckAI API v2 Docs

This page documents the current direct commercial API only: `/api/v2/*`, `ak_` keys, and API units billing.

/api/v2/*
ak_ keys
API Units Billing
Base URL
https://checkai.space
Auth Header
x-api-key: ak_your_api_key

Important: do not integrate against the legacy /api/* docs

Legacy examples such as `/api/detect`, `/api/detect/video`, and `/api/instruct` belong to the old credit lane or old capability surface. Direct commercial integrations should use `/api/v2/*` with an `ak_` key in the request header.

Create an ak_ key

Create your commercial API key in Dashboard > API.

Set request headers

x-api-key + Content-Type: application/json

Call /api/v2/*

Use `/api/v2/detect` for detection and `/api/v2/instruct` for rewriting.

Endpoint Overview

Confirm the path, key type, and supported modes before you integrate.

Current Public Surface
POST
text
Text Detection
/api/v2/detect

Send `text` and get a detection result plus units consumed.

GET
balance
Detect Billing Info
/api/v2/detect

Inspect current balance and detection billing metadata.

POST
single call
Single Rewrite
/api/v2/instruct

Default mode. Rewrites and re-scores in one call.

POST
mode=batch
Batch Workflow
/api/v2/instruct

Use `mode: "batch"` with `batch_index` and prior replacements to advance a long-text rewrite workflow.

Auth and Scope

x-api-key: ak_your_api_key
Direct API access accepts `ak_` keys only. `dk_` keys are extension-only.
This page covers `/api/v2/detect` and `/api/v2/instruct` only.
v2 detection currently supports text only, not public image/video detection.
The rewrite endpoint supports two flows: default single-step rewrite, or batched workflow via the optional `mode: "batch"` parameter.

Quick Start

cURL
curl -X POST https://checkai.space/api/v2/detect \
  -H "x-api-key: ak_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello from API v2"
  }'
POST/api/v2/detect

The public v2 detect endpoint currently supports text only.

text only

Parameters

textRequired

Text content to analyze. Empty text returns 400.

Examples

POST detect request

cURL
curl -X POST https://checkai.space/api/v2/detect \
  -H "x-api-key: ak_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "This paragraph will be scored for AI-generated text patterns."
  }'

GET balance and billing info

cURL
curl -X GET https://checkai.space/api/v2/detect \
  -H "x-api-key: ak_your_api_key"

Response Fields

result-Detection result object with `score`, `label`, `confidence`, and `details`.
units_used-API units consumed by this request.
units_remaining-Remaining available units for the account.
billing-Returned on GET only. Shows block size and detect billing rate.

Response

POST response

JSON
{
  "success": true,
  "result": {
    "score": 45.64,
    "label": "ai",
    "confidence": 1,
    "details": {
      "overall": {
        "score": 45.64,
        "ai_prob": 1,
        "ai_label": "ai"
      },
      "per_token": [
        {
          "position": 0,
          "token": "This",
          "score": 4.28,
          "offset": [0, 4]
        }
      ],
      "type": {
        "probs": {
          "polish_rewrite": 0.47,
          "generate": 0.53
        },
        "label": "generate"
      }
    }
  },
  "units_used": 1,
  "units_remaining": 299
}

GET response

JSON
{
  "success": true,
  "units_remaining": 299,
  "units_used": 1,
  "billing": {
    "unit_block_size_chars": 1000,
    "detect_units_per_block": 1
  }
}
POST/api/v2/instructsingle by default, batch optional

Omit `mode` for single-step rewriting, or set `mode: "batch"` for long-text batched rewriting.

styles + batching
The same `/api/v2/instruct` endpoint supports two flows: omit `mode` for single-step rewriting, or pass `mode: "batch"` for long-text batched rewriting.

Rewrite Parameters

textRequired

The text you want to rewrite.

styleOptional

Optional: `neutral`, `academic`, `formal`, `casual`, or `professional`.

modeOptional

Optional. Omit it for single-step rewrite, or set it to `batch` for batched workflow.

Style Options

neutral

Default style. Natural and restrained for most general writing.

academic

More suitable for papers, reports, and research writing.

formal

More formal and structured for official communication.

casual

More conversational and relaxed for blogs and social writing.

professional

More concise and business-friendly for work emails and product copy.

Batch Parameters

modeRequired

Must be `batch`.

batch_indexOptional

Current batch index. Optional on the first request and defaults to `0`.

prior_sentence_replacementsOptional

Send back prior `suggestions.sentence_replacements` from earlier batches so the service can continue merging the full rewrite.

styleOptional

Optional fixed style. If omitted, the system can choose the best candidate style per batch.

Examples

Single rewrite request

cURL
curl -X POST https://checkai.space/api/v2/instruct \
  -H "x-api-key: ak_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Artificial intelligence has fundamentally transformed the landscape of modern technology.",
    "style": "professional"
  }'

Batch request

cURL
curl -X POST https://checkai.space/api/v2/instruct \
  -H "x-api-key: ak_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Sentence one. Sentence two is too robotic. Sentence three also needs work.",
    "mode": "batch",
    "batch_index": 0,
    "style": "academic",
    "prior_sentence_replacements": []
  }'

Response Fields

result.rewritten_text-The full rewritten text returned by single-step mode.
result.original_score / result.rewritten_score-In single-step mode, the AI score before and after rewriting.
suggestions.full_rewrite / suggestions.sentence_replacements-In batch mode, these represent the merged full rewrite so far and the replacements returned by the current batch.
progress / preview-In batch mode, `progress` shows current workflow progress and `preview` shows the estimated total batches and total units.
units_used / units_remaining-Shows units consumed and remaining balance. Single-step rewrite bills by character blocks; batch bills 4 units per processed batch.

Response

Single rewrite response

JSON
{
  "success": true,
  "result": {
    "rewritten_text": "Modern technology has changed quickly as AI systems have become more capable.",
    "original_score": 70.96,
    "rewritten_score": 35.42,
    "sentences_changed": 1,
    "total_sentences": 1
  },
  "units_used": 4,
  "units_remaining": 295
}

Batch response

JSON
{
  "success": true,
  "suggestions": {
    "overview": "Batch 1/3 completed.",
    "quick_tips": [
      "Processed 2 sentences in this batch",
      "Updated 2 sentences in this batch",
      "More sentence suggestions will appear as each batch finishes"
    ],
    "sentence_replacements": [
      {
        "sentence_index": 1,
        "original_sentence": "Sentence two is too robotic.",
        "rewritten_sentence": "The second sentence sounds overly mechanical.",
        "sentence_score_delta": 14.2,
        "replaced_tokens": []
      }
    ],
    "full_rewrite": "Sentence one. The second sentence sounds overly mechanical. Sentence three also needs work."
  },
  "preview": {
    "total_batches": 3,
    "total_sentences": 3,
    "total_high_score_tokens": 11,
    "batch_unit_cost": 4,
    "estimated_total_units": 12,
    "original_sentences": [
      "Sentence one.",
      "Sentence two is too robotic.",
      "Sentence three also needs work."
    ]
  },
  "progress": {
    "batch_index": 0,
    "completed_batches": 1,
    "total_batches": 3,
    "total_sentences": 3,
    "batch_unit_cost": 4,
    "estimated_total_units": 12,
    "done": false
  },
  "units_used": 4,
  "units_remaining": 291
}

Billing Rules

Text Detection

1 unit per 1000 input characters, rounded up by block.

Text Rewrite

4 units per 1000 input characters, rounded up by block.

Batch Rewrite

Each processed batch costs 4 units. The estimated total workflow cost is returned as `preview.estimated_total_units` in the batch response.

Error Handling

401API key missing, invalid, revoked, or the wrong key type was used.
400Missing required request fields such as `text`, or an invalid batch `batch_index` was provided.
402The account does not have enough API units.
429The current plan rate limit has been exceeded.
503The upstream detect or rewrite service is temporarily unavailable.