API reference
Every GPTZero API endpoint for AI detection, with request and response schemas. Try requests in your browser.
Detect AI in text
POST /v2/predict/text
Detects AI in a single text input and returns probabilities for the document, each paragraph and each sentence. Text longer than your plan's character limit is rejected with a `400`. On API plans, the limit is 150,000 characters. The language is detected automatically, and non-English text is scanned with the multilingual model. If you're evaluating the detector for research, read [how to interpret the multi-class output](https://gptzero.me/news/chicago-booth-2026/). For research questions about the API, [contact our research team](https://gptzero.me/resources/researchers). For anything else, [contact us](https://gptzero.me/contact-us).
Detect AI in files
POST /v2/predict/files
Detects AI in uploaded files and returns one result per file. You can upload up to 250 files per request, each up to 50 MB. Text extracted from each file is truncated to your plan's character limit (150,000 characters on API plans). If you're evaluating the detector for research, read [how to interpret the multi-class output](https://gptzero.me/news/chicago-booth-2026/). For research questions about the API, [contact our research team](https://gptzero.me/resources/researchers). For anything else, [contact us](https://gptzero.me/contact-us).
Stream AI patterns
POST /v3/ai/patterns/stream
Finds AI writing patterns in a document, such as the rule of three, and explains each match in plain language. Results stream back as [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events). Each event is a `data: <json>` line, where `<json>` is an `AiPatternStreamEvent` for one sentence and the patterns it matched. Sentences with no matches are skipped. The stream ends when the connection closes. The server sends a `:keepalive` comment every 30 seconds, which SSE clients ignore. If processing fails after the stream has started, the status is already `200`, so the error arrives as a final `data: {"error": "Error in streaming AI patterns"}` event. Check each event for an `error` field. AI Patterns isn't on by default. Your API key has to be allow-listed for it.
Check text for hallucinations
POST /v2/hallucination-check/text
Checks the citations in one document for hallucinations. Finds each bibliography entry and claim, checks whether each cited source exists and supports the claim, and returns the sources it matched. Each request uses credits from your plan - credit calculation is detailed [here](https://support.gptzero.me/articles/8011707113-how-are-credits-used-calculated). If you don't have enough credits left and your plan doesn't allow overage, the check is rejected with a `429` and `code: out_of_credits`, and you aren't charged. This can happen after the bibliography is read, once the response has started: then the response status is `200` and the body is `{ "error": ..., "status": 429, "code": "out_of_credits" }`, so check for `error` before reading the result. The check holds the connection open until it finishes, which can take several minutes for long documents. If the request times out with a `504` and your API key saves scans, a check that finishes afterwards is still charged and appears in your scan history. Text longer than your plan's character limit is rejected with a `400`. On API plans, the limit is 150,000 characters. When your API key saves scans, the result is saved to your scan history and has an `id`. Otherwise nothing is stored.
Check files for hallucinations
POST /v2/hallucination-check/files
Checks the citations in each uploaded file for hallucinations, and returns one result per file. Each file is checked against your remaining credits on its own. If any file's check fails, the request fails with that file's error, and you're still charged for the other files whose checks finished. See [Check text for hallucinations](/api-reference/#POST/v2/hallucination-check/text) for how credit limits and errors work. If text can't be extracted from a file after the response has started, the status stays `200` and the body is `{ "error": ..., "status": 400, "code": "file_text_unreadable" }` or `"text_extraction_unavailable"`. Check for `error` before reading the results. Before the response starts, the same failure is a `400` with that `code`.
Bibliography scan (text)
POST /v2/bibliography-scan/text
**Deprecated.** Use [`POST /v2/hallucination-check/text`](/api-reference/#POST/v2/hallucination-check/text) instead. Requests to this path get a `308` redirect to it, with a `Deprecation` header and a `Link` header naming the new path. Most HTTP clients follow a `308` and resend the same request.
Bibliography scan (files)
POST /v2/bibliography-scan/files
**Deprecated.** Use [`POST /v2/hallucination-check/files`](/api-reference/#POST/v2/hallucination-check/files) instead. Requests to this path get a `308` redirect to it, with a `Deprecation` header and a `Link` header naming the new path. Most HTTP clients follow a `308` and resend the same request.
Get usage stats
GET /v3/usage-stats
Returns how many credits you have used and have left in the current billing cycle, and your plan. Each request uses credits from your plan - credit calculation is detailed [here](https://support.gptzero.me/articles/8011707113-how-are-credits-used-calculated).
List model versions
GET /v2/model-versions/ai-scan
Returns the model versions you can pass as `modelVersion`. The list can include versions that aren't released yet, so check the [release notes](https://docs.superhuman.com/d/Project-engineering-import_doYGpUuF477/GPTZero-Release-Notes-Model-and-API_suN_Kut5#_luA8d53F) for which ones are approved for use and what each one improves.