Skip to content

Quickstart

Get an API key and scan your first document.

Scan a piece of text for AI in three steps. You need a GPTZero account and a terminal with curl.

Create a key on the API page of the GPTZero app, then save it in an environment variable:

export GPTZERO_API_KEY="your-api-key"

Keep your key secret. Anyone with it can make requests on your account.

Send this sample to POST /v2/predict/text, with your key in the x-api-key header. It combines AI-written text about climate change with a human-written passage about Scotland’s mountain plants.

curl https://api.gptzero.me/v2/predict/text \
-H "x-api-key: $GPTZERO_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"document": "Climate change refers to the long-term shift in global weather patterns caused by human activity, particularly the emission of greenhouse gases into the atmosphere. The most significant greenhouse gas is carbon dioxide, which is primarily produced by burning fossil fuels such as coal, oil, and gas. The consequences of climate change are already visible in the form of rising temperatures, melting glaciers and ice caps, and more frequent extreme weather events such as hurricanes, droughts, and floods. These changes have significant impacts on ecosystems, biodiversity, and human health, including increased risk of respiratory diseases, food and water shortages, and the spread of infectious diseases. To address climate change, it is essential to reduce greenhouse gas emissions through a range of measures, including increased use of renewable energy sources, greater energy efficiency, and improved transportation systems. \nClimate change has likely led to the decline of some of Scotland's mountain plants, according to new research. Scientists said many of the species relied on snow cover remaining high on hills until late spring and even summer to ensure a moist environment. They also said plants that thrived on lower ground in warmer conditions were spreading to mountain habitats. Species found to be in decline include snow pearlwort, alpine lady-fern and alpine speedwell. The research by the Botanical Society of Britain and Ireland (BSBI) has taken 20 years to complete and has been published in the new Plant Atlas. Data used to produce the report included more than three million plant records of 2,555 species collected by hundreds of botanists across Scotland.\n\n"
}
JSON

The command runs in Bash or Zsh. The quoted JSON marker keeps apostrophes and other characters in the sample intact.

The response has one entry in documents for the text you sent. This excerpt comes from the recorded mixed-text example in the API reference; sentence details and other fields are omitted. Your scores and model version can differ as the detector is updated.

{
"documents": [
{
"predicted_class": "mixed",
"class_probabilities": {
"human": 0,
"ai": 0.000051549673295649754,
"mixed": 0.9999484503267044
},
"confidence_category": "high",
"result_message": "Our detector is highly confident that the text may include parts written by AI."
}
],
"version": "2025-11-28-base"
}

Start with these fields:

  • predicted_class: the class the detector thinks is most likely, human, ai or mixed.
  • class_probabilities: the probability of each class, from 0 to 1.
  • confidence_category: how confident the detector is in predicted_class.
  • result_message: a sentence you can show your users.
  • To see every field and try requests in your browser, open the API reference.