{"openapi":"3.1.0","info":{"title":"Text Segmentation API","version":"1.0.0","description":"Count and split text the way people actually read it, using Unicode-correct segmentation. The count endpoint returns the number of grapheme clusters — the real, user-perceived characters, so a family emoji counts as 1 (not 7) and an accented letter as 1 — alongside words, sentences, code points, UTF-16 code units (the naive string length that over-counts) and UTF-8 byte length. This is exactly what character-limit fields, tweet/SMS counters and validation need so the count agrees with what the user sees. The segment endpoint splits text into grapheme, word or sentence segments (word segments are flagged word-like versus punctuation and spaces) and is locale-aware, so Japanese, Chinese and Thai word boundaries come out right. Everything is computed locally with no network calls. A Unicode text segmenter — distinct from the Unicode codepoint database (unicode), the case/text-utilities toolkit (text) and string similarity (similarity). No upstream key, no cache.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/segmenter-api","description":"oanor gateway"}],"tags":[{"name":"Segmentation"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/count":{"get":{"operationId":"get_v1_count","tags":["Segmentation"],"summary":"Emoji-safe character/word/sentence counts","description":"","parameters":[{"name":"text","in":"query","required":true,"description":"The text","schema":{"type":"string"},"example":"Hello 👋 café"},{"name":"locale","in":"query","required":false,"description":"BCP 47 locale (for word/sentence)","schema":{"type":"string"},"example":"en"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"words":2,"locale":"en","graphemes":12,"sentences":1,"bytes_utf8":16,"code_units":13,"code_points":12},"meta":{"timestamp":"2026-06-01T23:40:40.762Z","request_id":"ae97a5a8-1b82-4a5e-83cd-fcf2cd15156d"},"status":"ok","message":"Counted","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/segment":{"get":{"operationId":"get_v1_segment","tags":["Segmentation"],"summary":"Split into segments","description":"","parameters":[{"name":"text","in":"query","required":true,"description":"The text","schema":{"type":"string"},"example":"The quick brown fox."},{"name":"granularity","in":"query","required":false,"description":"grapheme, word, sentence","schema":{"type":"string"},"example":"word"},{"name":"locale","in":"query","required":false,"description":"BCP 47 locale","schema":{"type":"string"},"example":"en"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":8,"locale":"en","segments":[{"index":0,"segment":"The","is_word_like":true},{"index":3,"segment":" ","is_word_like":false},{"index":4,"segment":"quick","is_word_like":true},{"index":9,"segment":" ","is_word_like":false},{"index":10,"segment":"brown","is_word_like":true},{"index":15,"segment":" ","is_word_like":false},{"index":16,"segment":"fox","is_word_like":true},{"index":19,"segment":".","is_word_like":false}],"granularity":"word"},"meta":{"timestamp":"2026-06-01T23:40:40.866Z","request_id":"07a3203e-f0d0-41f0-bf6a-e43b10184456"},"status":"ok","message":"Segmented","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Granularities","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Count and split text the way people actually read it, using Unicode-correct segmentation (Intl.Segmenter). /v1/count?text=... returns the number of grapheme clusters (the real, user-perceived characters — so '👨‍👩‍👧' counts as 1, not 7, and 'café' as 4), words and sentences, alongside code points, UTF-16 code units (the naive string length) and UTF-8 byte length — perfect for character-limit fields, tweets/SMS counters and validation that must agree with what users see. /v1/segment splits text into grapheme, word or sentence segments (word segments are flagged word-like vs punctuation/space), locale-aware so CJK and Thai word boundaries are correct. Everything is computed locally with no network calls. A Unicode text segmenter — distinct from the Unicode codepoint database (unicode), case/text utilities (text) and string similarity (similarity). No key, no cache.","endpoints":["/v1/count","/v1/segment","/v1/meta"],"granularities":["grapheme","word","sentence"]},"meta":{"timestamp":"2026-06-01T23:40:40.963Z","request_id":"1a4e11fc-8f16-4cd0-a1f3-a3ecf4ebecfa"},"status":"ok","message":"Meta retrieved","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":2020,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":595,"monthly_call_quota":38000,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1980,"monthly_call_quota":204000,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":5180,"monthly_call_quota":790000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/segmenter-api"}