Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.nano-gpt.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Use POST /api/v1/ai-detection to run AI-text detection or plagiarism detection on a text input.

Endpoint

POST https://nano-gpt.com/api/v1/ai-detection

Authentication

An API key is required.
  • Authorization: Bearer YOUR_API_KEY
  • x-api-key: YOUR_API_KEY

Request Body

{
  "text": "Text to analyze...",
  "mode": "ai"
}

Parameters

FieldTypeRequiredDefaultDescription
textstringYes-Text to analyze.
modestringNoaiDetection mode. Allowed values: ai, plagiarism.

Modes

ModeDescription
aiAI-text detection.
plagiarismPlagiarism detection.

Response

{
  "object": "ai_detection.result",
  "mode": "ai",
  "model": "pangram-ai-detection",
  "content": "Human-readable summary",
  "result": {
    "score": 0.12
  },
  "word_count": 250,
  "usage": {
    "prompt_tokens": 300,
    "completion_tokens": 50,
    "total_tokens": 350
  },
  "pricing": {
    "amount": 0.01,
    "currency": "USD"
  }
}

Example

curl -X POST https://nano-gpt.com/api/v1/ai-detection \
  -H "Authorization: Bearer $NANOGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Text to analyze...",
    "mode": "ai"
  }'

Common Errors

CodeDescription
missing_api_keyAPI key is required.
invalid_jsonRequest body is not valid JSON.
invalid_modemode is not ai or plagiarism.
missing_texttext is required.
model_not_allowedDetection model is not available for the account or route.
paid_features_disabledPaid API features are disabled for the account.
insufficient_balanceAccount balance is too low for the request.