API Documentation
This page documents every machine-facing API currently implemented: REST JSON endpoints, MCP JSON-RPC tools, and OpenAI-compatible chat endpoints.
Base URLs
https://api.allthewords.app/api/v1for REST endpointshttps://api.allthewords.app/mcpfor MCP JSON-RPChttps://api.allthewords.app/v1for OpenAI-compatible endpoints
Common behavior
- Content type:
application/json; charset=utf-8 - CORS:
Access-Control-Allow-Origin: * - Methods supported:
GET,POST,OPTIONS - Error envelope format:
Example
{
"error": {
"code": "invalid_language",
"message": "unsupported language code",
"details": {
"lang": "xx"
}
}
}REST API
GET /api/v1/healthz
Health check endpoint for uptime and deployment probes.
Example
{
"status": "ok",
"service": "allthewords-api",
"api_version": "v1",
"version": "1.10.1",
"time": "2026-03-12T12:34:56Z"
}GET /api/v1/languages
Returns supported languages and dictionary sizes.
GET /api/v1/search/pattern
Pattern search over one language dictionary.
- Required query params:
lang,pattern - Optional query params:
contains,excludes,limit,offset - Wildcards: ? matches exactly one character, and * matches one or more characters. A pattern without * matches a fixed word length.
GET /api/v1/search/anagram
Anagram search over one language dictionary.
- Required query params:
lang,letters - Optional query params:
pattern,min_length,max_length,limit,offset - Blank tile support:
? - Pattern wildcards: ? = exactly one letter, * = one or more letters. The pattern must match the whole word.
GET /api/v1/search/patterns
Answer several pattern searches in one request. Each pattern parameter is one search, and the answer carries one ordinary search response per pattern, in the order asked.
- Required query params:
lang,pattern(repeated once per search) - Optional query params (applied to every pattern):
contains,excludes,limit,offset - Maximum patterns per request:
10Every pattern is validated before any query runs: one invalid pattern refuses the whole batch, and the error details name its index.
Example
curl "https://api.allthewords.app/api/v1/search/patterns?lang=en&pattern=?ake&pattern=c*e&limit=5"
{
"language": "en",
"limit": 5,
"offset": 0,
"count": 2,
"results": [
{
"tool": "pattern",
"language": "en",
"query": "?ake",
"total": 8,
"offset": 0,
"limit": 5,
"returned": 5,
"has_more": true,
"truncated": false,
"description": "...",
"words": [{"word": "bake", "length": 4, "points": 10}]
},
{
"tool": "pattern",
"language": "en",
"query": "c*e",
"total": 42,
"offset": 0,
"limit": 5,
"returned": 5,
"has_more": true,
"truncated": false,
"description": "...",
"words": [{"word": "cake", "length": 4, "points": 10}]
}
]
}GET /api/v1/stats/languages/{lang}
Returns the number of recorded search events for one language. Search counts only — no dictionary aggregates.
Example
{
"api_version": "v1",
"generated_at_utc": "2026-09-11T18:41:56Z",
"language": "en",
"search_count": 11743
}GET /api/v1/stats/global
Returns the number of recorded search events for every language that has any, highest count first.
Example
{
"api_version": "v1",
"generated_at_utc": "2026-09-11T18:41:56Z",
"search_counts_by_language": [
{"language": "en", "search_count": 11743},
{"language": "nl", "search_count": 4210}
]
}GET /api/v1/word/{lang}/{word}
Get detailed information about a specific word including definition, related words, and cross-language availability.
- Required:
lang(language code),word(the word to look up) - Returns: word details, definition (if available), word families, and cross-language matches
Example
{
"word": "hello",
"language": "en",
"language_name": "English",
"length": 5,
"points": 8,
"has_points": true,
"definition": {
"phonetic": "/həˈloʊ/",
"audio_url": "https://...",
"meanings": [...],
"source": "wiktionary"
},
"word_families": {
"starts_with": [{"word": "hellos", "length": 6, "points": 9}],
"ends_with": [],
"contains": [{"word": "shell", "length": 5, "points": 8}]
},
"cross_languages": [
{"code": "de", "name": "German", "flag": "🇩🇪", "points": 6}
]
}GET /api/v1/words/{lang}
Browse dictionary words with optional length, prefix, suffix, and contains filters. Complete, uncapped lists — mirrors the web word-list pages (e.g. /en/words/5/a).
- Required path params:
lang(path) - Optional query params:
length,prefix,suffix,contains,limit,offset - At least one filter required: Optional query params — at least one of
length,prefix,suffix,contains
Word list response fields:
length/prefix/suffix/contains- filters: The applied length/prefix/suffix/contains values (omitted when unset)total- total: Total number of matching words (uncapped for browse)words- words: Array of Word objects, sorted by length then alphabeticallytool,language,offset,limit,returned,has_more,description- same pagination fields as search responses
GET /api/v1/words/{lang}/lengths
Returns per-length word counts (the /words hub data) for one language.
Example
{
"language": "en",
"language_name": "English",
"total_words": 517000,
"lengths": [
{"length": 2, "count": 127},
{"length": 3, "count": 1347},
{"length": 4, "count": 5810}
]
}GET /api/v1/words/{lang}/exists
Check many words at once: one dictionary answer per word instead of one request per word.
- Required query params:
lang(path),words(comma-separated) - Maximum words per request:
100 - words holds one entry per requested word, in the order asked; an absent word has present: false and no length or points.
Example
curl "https://api.allthewords.app/api/v1/words/en/exists?words=example,exempla,zzz"
{
"language": "en",
"requested": 3,
"found": 2,
"words": [
{"word": "example", "present": true, "length": 7, "points": 18},
{"word": "exempla", "present": true, "length": 7, "points": 17},
{"word": "zzz", "present": false}
]
}GET /api/v1/suggest
Prefix completion for a search box: words that start with the prefix, ordered by length then alphabetically.
- Required query params:
lang,prefix - Optional query params:
limit - At most 20 words come back. A prefix with no match is an empty list, not an error.
Example
curl "https://api.allthewords.app/api/v1/suggest?lang=en&prefix=exa&limit=5"
{
"language": "en",
"prefix": "exa",
"limit": 5,
"returned": 2,
"has_more": false,
"words": [
{"word": "exempla", "length": 7, "points": 17},
{"word": "example", "length": 7, "points": 18}
]
}GET /api/v1/random
One random word for a puzzle or a demo, chosen from the words that match the filters.
- Required query params:
lang - Optional query params:
length,min_points - A filter that matches nothing answers 404 with the no_match error code, never an empty 200.
Example
curl "https://api.allthewords.app/api/v1/random?lang=en&length=5"
{
"word": "pizza",
"language": "en",
"length": 5,
"points": 25,
"has_points": true
}MCP API
MCP endpoint is JSON-RPC at POST /mcp.
Implemented methods:
initializeping— liveness check, returns an empty resulttools/listtools/call
JSON-RPC notifications (messages without an id, such as notifications/initialized) are accepted and answered with 202 Accepted and an empty body, as the protocol requires.
Available MCP tools
list_languagessearch_patternsearch_anagramget_language_statsget_global_statsget_word_details— Get word definition, families, and cross-language infolist_words— Browse dictionary words with length/prefix/suffix/contains filters (uncapped, paginated)get_word_lengths— Per-length word counts for a language
Example tools/call
Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "search_pattern",
"arguments": {
"lang": "en",
"pattern": "?a?e",
"contains": "r",
"limit": 10
}
}
}OpenAI-compatible API
GET /v1/models
Returns currently exposed model list for integration clients.
POST /v1/chat/completions
Supports OpenAI-compatible request/response format, including tool-calling style responses. This endpoint maps to the same functionality exposed via MCP tools.
Tool-calling example
Example
{
"model": "allthewords-mcp-1",
"messages": [
{
"role": "user",
"content": "lang=en pattern=?a?e contains=r"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "search_pattern"
}
}
],
"tool_choice": "auto"
}Pagination and limits
- REST and MCP search calls support
limitandoffset. - Default limit:
100. - Maximum limit:
200. - Response includes
total,returned, andhas_more. - API rate limit:
120 requests per 60 secondsfor/api/v1/*,/v1/*, and/mcp. /api/v1/healthzis excluded from rate limiting for monitoring probes.- When limited, responses return
429withRetry-After,X-RateLimit-Limit, andX-RateLimit-Windowheaders.
Word object fields
Each word in the response includes:
word- word: The word itselflength- length: Number of letterspoints- points: Scrabble/Wordfeud point value
Search response fields
Search responses include these fields:
tool- tool: Either 'pattern' or 'anagram'language- language: Language codequery- query: The search query usedtotal- total: Number of matching words (capped at 1000 for pattern, 5000 for anagram)returned- returned: Number of words in this responsehas_more- has_more: True if more results availabletruncated- truncated: True when the match set exceeds the cap or the candidate scan hits its bounded-work limit; the returned words are the best available, not exhaustiveoffset- offset: Current pagination offsetlimit- limit: Current pagination limitdescription- description: Human-readable search summarywords- words: Array of Word objects
Error handling
Authentication
The dictionary routes are public and need no token. The MCP endpoint /mcp and the OpenAI-compatible routes /v1/models and /v1/chat/completions require the header Authorization: Bearer <token> and answer 401 unauthorized without it.
Error codes
missing_pattern- missing_pattern: Pattern parameter is requiredmissing_letters- missing_letters: Letters parameter is requiredmissing_lang- missing_lang: Language parameter is requiredinvalid_language- invalid_language: Language code not supportedinvalid_length_range- invalid_length_range: min_length exceeds max_lengthrate_limited- rate_limited: Too many requests (120 per 60s)unauthorized- unauthorized: The Bearer token is missing or not valid for this routemethod_not_allowed- method_not_allowed: HTTP method not supportedrequest_too_large- request_too_large: Request body exceeds 64KB limitmissing_words- missing_words: words parameter is requiredtoo_many_words- too_many_words: More than 100 words in one requestinvalid_words- invalid_words: A word in the list is empty or longer than 50 lettersmissing_prefix- missing_prefix: prefix parameter is requiredinvalid_prefix- invalid_prefix: prefix must contain only letterstoo_many_patterns- too_many_patterns: More than 10 patterns in one requestno_match- no_match: No word matches the filters
OpenAPI Specification
The same OpenAPI 3.0 specification in both forms, generated from the YAML file that is its source
Client generators and gateways read JSON from a stable URL.
Fetch it as JSON:
GET /openapi.json
Quick curl examples
Example
curl "https://api.allthewords.app/api/v1/languages"
curl "https://api.allthewords.app/api/v1/search/pattern?lang=en&pattern=?a?e&contains=r&limit=20"
curl "https://api.allthewords.app/api/v1/search/anagram?lang=en&letters=react?&min_length=3&max_length=7"
curl "https://api.allthewords.app/api/v1/words/en?length=5&prefix=a&limit=20"
curl "https://api.allthewords.app/api/v1/words/en/lengths"
curl "https://api.allthewords.app/api/v1/words/en/exists?words=example,exempla,zzz"
curl "https://api.allthewords.app/api/v1/suggest?lang=en&prefix=exa&limit=5"
curl "https://api.allthewords.app/api/v1/random?lang=en&length=5"
curl "https://api.allthewords.app/api/v1/search/patterns?lang=en&pattern=?ake&pattern=c*e&limit=5"
curl "https://api.allthewords.app/openapi.json"
curl -X POST "https://api.allthewords.app/mcp" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
curl -X POST "https://api.allthewords.app/v1/chat/completions" \
-H "Content-Type: application/json" \
-d '{"model":"allthewords-mcp-1","messages":[{"role":"user","content":"lang=en pattern=?a?e"}],"tools":[{"type":"function","function":{"name":"search_pattern"}}],"tool_choice":"auto"}'