{"openapi":"3.1.0","info":{"title":"TrueScribe API","version":"1","description":"Pro plan. Limits and word allowances are the same as on the website (see /v1/usage). Scores are estimates, not proof of authorship."},"servers":[{"url":"https://truescribe.klaidz.com"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"A key from your account page, like ts_live_..."}},"schemas":{"DetectRequest":{"properties":{"text":{"maxLength":800000,"minLength":20,"title":"Text","type":"string"},"extra":{"default":false,"title":"Extra","type":"boolean"},"first_words_only":{"default":false,"title":"First Words Only","type":"boolean"}},"required":["text"],"type":"object"},"HumanizeRequest":{"properties":{"text":{"maxLength":800000,"minLength":20,"title":"Text","type":"string"},"tone":{"default":"free","pattern":"^(free|academic|professional|casual|creative|simple)$","title":"Tone","type":"string"},"level":{"default":"undergraduate","pattern":"^(highschool|undergraduate|postgraduate|professional)$","title":"Level","type":"string"},"rewrite_level":{"default":"balanced","pattern":"^(quality|balanced|max)$","title":"Rewrite Level","type":"string"},"style_sample":{"default":"","maxLength":20000,"title":"Style Sample","type":"string"},"first_words_only":{"default":false,"title":"First Words Only","type":"boolean"},"passes":{"default":3,"maximum":3,"minimum":1,"title":"Passes","type":"integer"}},"required":["text"],"type":"object"},"DetectResult":{"type":"object","description":"Detector result, schema_version 2.0. `status` is `ok` or `too_short`.","properties":{"api_version":{"type":"string"},"schema_version":{"type":"string"},"status":{"type":"string"},"ai_probability":{"type":["number","null"],"description":"TrueScribe's own estimate, 0 to 1, that the text is AI-written."},"label":{"type":["string","null"]},"word_count":{"type":"integer"},"breakdown":{"type":"object"},"sentences":{"type":"array","items":{"type":"object"}},"reasons":{"type":"array","items":{"type":"object"}},"confidence":{"type":["string","null"]},"warnings":{"type":"array","items":{"type":"string"}},"engine":{"type":"object"}}},"JobCreated":{"type":"object","required":["job_id","status","poll"],"properties":{"api_version":{"type":"string"},"job_id":{"type":"string"},"status":{"type":"string","enum":["queued","running","done","error"]},"words":{"type":"integer"},"truncated_from":{"type":["integer","null"]},"poll":{"type":"string","example":"/v1/jobs/abc"}}},"Job":{"type":"object","required":["id","status"],"properties":{"api_version":{"type":"string"},"id":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","running","done","error"]},"progress":{"type":"number"},"stage":{"type":"string"},"result":{"type":"object","description":"Present when status is done. A DetectResult or a humanizer result (output, before_score, after_score, per_paragraph, verification, usage)."},"error":{"type":"string","description":"Present when status is error. The words were not charged."}}},"Usage":{"type":"object","properties":{"plan":{"type":"string"},"request_words":{"type":"integer"},"daily":{"type":"object"},"resets_in":{"type":"integer"},"key":{"type":"object"},"rate_limit":{"type":"object"}}},"Error":{"type":"object","required":["api_version","error"],"properties":{"api_version":{"type":"string"},"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["missing_api_key","invalid_api_key","pro_required","rate_limited","daily_limit_reached","text_too_long","too_many_jobs","invalid_request","bad_request","bad_idempotency_key","idempotency_key_reuse","request_in_progress","request_too_large","not_found","service_busy"]},"message":{"type":"string"}}}}}}},"paths":{"/v1/detect":{"post":{"summary":"Detect AI-written text","description":"Texts up to the sync size return 200 with the result; longer ones return 202 and a job to poll.","security":[{"bearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":64},"description":"Repeat a request safely: the same key and body returns the first response (header Idempotent-Replay: true) and charges nothing again."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectResult"}}}},"202":{"description":"Accepted: poll GET /v1/jobs/{id}.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCreated"}}}},"401":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetectRequest"}}}}}},"/v1/humanize":{"post":{"summary":"Humanize text","description":"Starts a job. Poll GET /v1/jobs/{id}.","security":[{"bearer":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":64},"description":"Repeat a request safely: the same key and body returns the first response (header Idempotent-Replay: true) and charges nothing again."}],"responses":{"202":{"description":"Accepted: poll GET /v1/jobs/{id}.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCreated"}}}},"401":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HumanizeRequest"}}}}}},"/v1/jobs/{job_id}":{"get":{"summary":"Get a job","description":"Detector jobs and humanizer jobs. Finished jobs are deleted one hour after completion.","security":[{"bearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"404":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage":{"get":{"summary":"Usage","description":"Your plan's caps, today's word usage, this key's request counts and the rate limit.","security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"401":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error. `error.code` is stable and machine-readable; `error.message` is for people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}