{"openapi":"3.1.0","info":{"title":"Playtest API API","version":"1.0.0","description":"A small, fast text-analysis API. Send text, get back word, sentence and character counts, reading time and the most used words, from one REST call.","contact":{"email":"support@playtest.plxi.us","url":"https://playtest.plxi.us/contact"},"termsOfService":"https://playtest.plxi.us/terms"},"externalDocs":{"url":"https://playtest.plxi.us/docs"},"servers":[{"url":"https://api-playtest.plxi.us"}],"security":[{"apiKey":[]}],"paths":{"/v1/example/analyze":{"post":{"operationId":"exampleAnalyze","summary":"Analyze text","description":"Count the characters, words, sentences and paragraphs in a piece of text, estimate its reading time, and list its most used words (common English words such as \"the\" are skipped). Send the text in `text` (up to 100,000 characters) and optionally `top`, how many words to list (1 to 20, default 5). Returns the counts as numbers and `top_words` as a list of {word, count}, most used first.","x-credits":1,"externalDocs":{"url":"https://playtest.plxi.us/docs#op-example-analyze"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":100000,"description":"The text to analyze."},"top":{"default":5,"description":"How many of the most used words to list, 1 to 20. Any value is read as JavaScript's Number() reads it and kept within that range."}},"required":["text"],"additionalProperties":false},"example":{"text":"The quick brown fox jumps over the lazy dog. The dog sleeps.","top":3}}}},"responses":{"200":{"description":"Success. The body includes the credits charged.","content":{"application/json":{"schema":{"type":"object","properties":{"characters":{"type":"integer"},"characters_no_spaces":{"type":"integer"},"words":{"type":"integer"},"sentences":{"type":"integer"},"paragraphs":{"type":"integer"},"reading_time_seconds":{"type":"integer"},"top_words":{"type":"array","items":{"type":"object","properties":{"word":{"type":"string"},"count":{"type":"integer"}},"required":["word","count"]}},"credits":{"type":"integer","description":"Credits this call was charged."}},"required":["characters","characters_no_spaces","words","sentences","paragraphs","reading_time_seconds","top_words","credits"]},"example":{"characters":60,"characters_no_spaces":49,"words":12,"sentences":2,"paragraphs":1,"reading_time_seconds":4,"top_words":[{"word":"dog","count":2},{"word":"brown","count":1},{"word":"fox","count":1}],"credits":1}}}},"400":{"description":"Invalid JSON or input. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit, concurrency limit or monthly quota reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/example/slugify":{"post":{"operationId":"exampleSlugify","summary":"Make a URL slug","description":"Turn a title or phrase into a URL-safe slug: accents removed, lowercase, words joined by a separator, anything else dropped. Send `text`; optionally `separator` (\"-\", \"_\" or \".\", default \"-\") and `max_length` (1 to 200, default 80). Returns `slug`.","x-credits":1,"externalDocs":{"url":"https://playtest.plxi.us/docs#op-example-slugify"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":100000,"description":"The title or phrase to turn into a slug."},"separator":{"type":"string","enum":["-","_","."],"default":"-","description":"The character between words."},"max_length":{"default":80,"description":"The longest slug to return, 1 to 200 characters. Any value is read as JavaScript's Number() reads it and kept within that range."}},"required":["text"],"additionalProperties":false},"example":{"text":"Héllo Wörld: a new post!","separator":"-","max_length":80}}}},"responses":{"200":{"description":"Success. The body includes the credits charged.","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"credits":{"type":"integer","description":"Credits this call was charged."}},"required":["slug","credits"]},"example":{"slug":"hello-world-a-new-post","credits":1}}}},"400":{"description":"Invalid JSON or input. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit, concurrency limit or monthly quota reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage":{"get":{"operationId":"getUsage","summary":"Usage and limits for the current billing period.","responses":{"200":{"description":"Usage summary.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Stable error code, listed in the API reference."},"message":{"type":"string"},"reset_at":{"type":"string","format":"date-time"}}}}}}