{"components":{"schemas":{"AnsweredClue":{"additionalProperties":false,"description":"Une d\u00e9finition et le mot qu'elle d\u00e9finit : une d\u00e9finition ne peut pas glisser sur le mot voisin.","properties":{"answer":{"maxLength":40,"minLength":1,"title":"Answer","type":"string"},"clue":{"maxLength":400,"title":"Clue","type":"string"}},"required":["answer","clue"],"title":"AnsweredClue","type":"object"},"CellIn":{"properties":{"x":{"exclusiveMaximum":20,"minimum":0,"title":"X","type":"integer"},"y":{"exclusiveMaximum":20,"minimum":0,"title":"Y","type":"integer"}},"required":["x","y"],"title":"CellIn","type":"object"},"CheckRequest":{"additionalProperties":false,"description":"Deux fa\u00e7ons de faire v\u00e9rifier des d\u00e9finitions : le fichier entier (`grid`), ou, plus court pour un assistant, le\nnum\u00e9ro d'une g\u00e9n\u00e9ration des derni\u00e8res 24 heures (`id`) et ses d\u00e9finitions (`clues`).\n\n`clues` : de pr\u00e9f\u00e9rence des paires `{answer, clue}`, dans n'importe quel ordre (essai dans Claude du 28/10/2026 :\navec une simple liste dans l'ordre des mots, deux d\u00e9finitions se sont invers\u00e9es) ; ou une liste dans l'ordre.","properties":{"clues":{"anyOf":[{"anyOf":[{"items":{"$ref":"#/components/schemas/AnsweredClue"},"type":"array"},{"items":{"anyOf":[{"maxLength":400,"type":"string"},{"type":"null"}]},"type":"array"}],"maxLength":900},{"type":"null"}],"default":null,"title":"Clues"},"grid":{"anyOf":[{"$ref":"#/components/schemas/GridFileIn"},{"type":"null"}],"default":null},"id":{"anyOf":[{"pattern":"^gen_[A-Za-z0-9_-]{8,40}$","type":"string"},{"type":"null"}],"default":null,"title":"Id"}},"title":"CheckRequest","type":"object"},"CheckResult":{"properties":{"clues":{"items":{"properties":{"answer":{"type":"string"},"clue":{"type":["string","null"]},"direction":{"enum":["across","down"],"type":"string"},"findings":{"items":{"properties":{"level":{"enum":["error","warning"],"type":"string"},"message":{"type":"string"},"reason":{"type":"string"}},"type":"object"},"type":"array"},"ok":{"type":"boolean"},"x":{"type":"integer"},"y":{"type":"integer"}},"type":"object"},"type":"array"},"errors":{"type":"integer"},"genre":{"items":{"type":"object"},"type":"array"},"grid":{"$ref":"#/components/schemas/GridFileIn","description":"When ok: the checked grid file."},"links":{"description":"When ok: `play` (play online) and `open` (print, PDF, edit).","properties":{"open":{"format":"uri","type":"string"},"play":{"format":"uri","type":"string"}},"type":"object"},"ok":{"description":"True when no clue is refused.","type":"boolean"},"warnings":{"type":"integer"}},"required":["ok","errors","warnings","clues"],"type":"object"},"CreateGridRequest":{"additionalProperties":false,"properties":{"author":{"anyOf":[{"maxLength":60,"minLength":1,"pattern":"^[^\\x00-\\x1f\\x7f<>]+$","type":"string"},{"type":"null"}],"default":null,"title":"Author"},"height":{"default":10,"maximum":100,"minimum":1,"title":"Height","type":"integer"},"lang":{"pattern":"^[a-z]{2}$","title":"Lang","type":"string"},"level":{"default":"medium","enum":["easy","medium","hard"],"title":"Level","type":"string"},"mystery_word":{"anyOf":[{"maxLength":40,"pattern":"^[^\\x00-\\x1f\\x7f<>]+$","type":"string"},{"type":"null"}],"default":null,"title":"Mystery Word"},"preferred_words":{"items":{"maxLength":40,"minLength":1,"pattern":"^[^\\x00-\\x1f\\x7f<>]+$","type":"string"},"maxItems":60,"title":"Preferred Words","type":"array"},"required_words":{"items":{"maxLength":40,"minLength":1,"pattern":"^[^\\x00-\\x1f\\x7f<>]+$","type":"string"},"maxItems":10,"title":"Required Words","type":"array"},"seed":{"anyOf":[{"maximum":2147483647,"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"title":"Seed"},"type":{"const":"arrowword","default":"arrowword","title":"Type","type":"string"},"width":{"default":10,"maximum":100,"minimum":1,"title":"Width","type":"integer"}},"required":["lang"],"title":"CreateGridRequest","type":"object"},"Error":{"additionalProperties":true,"properties":{"error":{"description":"Human-readable message, in the language of Accept-Language (en, fr, de).","type":"string"},"reason":{"description":"Stable code: branch on this, never on the message.","type":"string"}},"required":["error","reason"],"type":"object"},"GridFileIn":{"properties":{"author":{"anyOf":[{"maxLength":60,"minLength":1,"pattern":"^[^\\x00-\\x1f\\x7f<>]+$","type":"string"},{"type":"null"}],"default":null,"title":"Author"},"format":{"const":"flechoir.grid","default":"flechoir.grid","title":"Format","type":"string"},"lang":{"pattern":"^[a-z]{2}$","title":"Lang","type":"string"},"level":{"anyOf":[{"enum":["easy","medium","hard"],"type":"string"},{"type":"null"}],"default":null,"title":"Level"},"mystery":{"anyOf":[{"$ref":"#/components/schemas/MysteryIn"},{"type":"null"}],"default":null},"rows":{"items":{"maxLength":20,"pattern":"^[A-Z#.]+$","type":"string"},"maxItems":20,"minItems":5,"title":"Rows","type":"array"},"seed":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"title":"Seed"},"type":{"const":"arrowword","default":"arrowword","title":"Type","type":"string"},"version":{"const":1,"default":1,"title":"Version","type":"integer"},"words":{"items":{"$ref":"#/components/schemas/WordIn"},"maxItems":1600,"title":"Words","type":"array"}},"required":["lang","rows","words"],"title":"GridFileIn","type":"object"},"Job":{"properties":{"created_at":{"format":"date-time","type":"string"},"error":{"$ref":"#/components/schemas/Error","description":"When failed (`no_solution`, `timeout`, `must_words_unplaced`\u2026)."},"expires_at":{"format":"date-time","type":"string"},"finished_at":{"format":"date-time","type":"string"},"grid":{"$ref":"#/components/schemas/GridFileIn","description":"When done: the grid file, yours to keep (deleted on our side after 24 hours). Each word gives its clue_max_chars."},"id":{"pattern":"^gen_[A-Za-z0-9_-]{8,40}$","type":"string"},"lang":{"type":"string"},"next":{"description":"What to do next, in plain words.","type":"string"},"queue_position":{"description":"While queued.","type":"integer"},"started_at":{"format":"date-time","type":"string"},"status":{"enum":["queued","running","done","failed"],"type":"string"},"warnings":{"items":{"type":"object"},"type":"array"}},"required":["id","status","lang"],"type":"object"},"MysteryIn":{"properties":{"cells":{"items":{"$ref":"#/components/schemas/CellIn"},"maxItems":20,"title":"Cells","type":"array"},"word":{"maxLength":40,"pattern":"^[A-Z]+( [A-Z]+)*$","title":"Word","type":"string"}},"required":["word","cells"],"title":"MysteryIn","type":"object"},"RenderRequest":{"additionalProperties":false,"properties":{"embed_font":{"default":true,"title":"Embed Font","type":"boolean"},"format":{"default":"svg","enum":["svg","png","pdf"],"title":"Format","type":"string"},"grid":{"$ref":"#/components/schemas/GridFileIn"},"view":{"default":"puzzle","enum":["puzzle","solution"],"title":"View","type":"string"},"width":{"anyOf":[{"maximum":3000,"minimum":400,"type":"integer"},{"type":"null"}],"default":null,"title":"Width"}},"required":["grid"],"title":"RenderRequest","type":"object"},"WordIn":{"properties":{"answer":{"pattern":"^[A-Z]{2,20}$","title":"Answer","type":"string"},"clue":{"anyOf":[{"maxLength":400,"type":"string"},{"type":"null"}],"default":null,"title":"Clue"},"direction":{"enum":["across","down"],"title":"Direction","type":"string"},"display":{"anyOf":[{"maxLength":40,"pattern":"^[^\\x00-\\x1f\\x7f<>]+$","type":"string"},{"type":"null"}],"default":null,"title":"Display"},"source":{"anyOf":[{"enum":["required","preferred","lexicon"],"type":"string"},{"type":"null"}],"default":null,"title":"Source"},"x":{"exclusiveMaximum":20,"minimum":0,"title":"X","type":"integer"},"y":{"exclusiveMaximum":20,"minimum":0,"title":"Y","type":"integer"}},"required":["answer","x","y","direction"],"title":"WordIn","type":"object"}},"securitySchemes":{"apiKey":{"bearerFormat":"flk_\u2026","description":"Optional. Created in the account page of the website; higher quotas.","scheme":"bearer","type":"http"}}},"externalDocs":{"description":"Documentation","url":"https://leflechoir.fr/developpeurs"},"info":{"description":"The engine builds the grid; you (or your AI) write the clues. Free, with or without a key. Start with GET /v1: it explains the genre, the style of clues per language and your quotas. Documentation: https://leflechoir.fr/developpeurs","summary":"Builds valid arrowword grids (mots fl\u00e9ch\u00e9s) around your words; checks and draws them.","termsOfService":"https://leflechoir.fr/terms#api","title":"Arrowword grid API","version":"1","x-terms-version":"2026-11-09"},"openapi":"3.1.0","paths":{"/v1":{"get":{"operationId":"getNotice","responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"The notice, for a program or a language model."}},"summary":"The notice: genre rules, clue style, formats, your quotas."}},"/v1/clues/check":{"post":{"operationId":"checkClues","requestBody":{"content":{"application/json":{"example":{"clues":[{"answer":"ERIC","clue":"Pr\u00e9nom du jour"}],"id":"gen_9PK9G9I9u-BrvxMsnuGE5g"},"schema":{"$ref":"#/components/schemas/CheckRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckResult"}}},"description":"Clue by clue."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request or settings (see `reason`)."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid or revoked API key (`invalid_api_key`)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unknown or expired grid (`not_found`)."},"411":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Content-Length missing (`length_required`)."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Body too large (`payload_too_large`)."},"415":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Content-Type must be application/json (`unsupported_media_type`)."}},"summary":"Check your clues: they must fit and not give the answer away. Returns play/print links."}},"/v1/grids":{"post":{"operationId":"createGrid","requestBody":{"content":{"application/json":{"example":{"height":10,"lang":"fr","level":"medium","preferred_words":["anniversaire","gateau"],"required_words":["Eric"],"type":"arrowword","width":10},"schema":{"$ref":"#/components/schemas/CreateGridRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"description":"Queued: poll the Location.","headers":{"Location":{"description":"GET this address for the result.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before polling again.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Generations allowed per minute for this caller.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Generations left this minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the minute window resets.","schema":{"type":"integer"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request or settings (see `reason`)."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid or revoked API key (`invalid_api_key`)."},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"A generation of yours is still running (`generation_in_progress`)."},"411":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Content-Length missing (`length_required`)."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Body too large (`payload_too_large`)."},"415":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Content-Type must be application/json (`unsupported_media_type`)."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Quota reached (`quota_minute`, `quota_day`, `quota_words`, `quota_global`, `rate_limited`): wait Retry-After seconds."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Language unavailable or the API paused (`lang_unavailable`, `api_paused`, `busy`, `api_disabled`)."}},"summary":"Start building a grid around your words."}},"/v1/grids/{id}":{"get":{"operationId":"getGrid","parameters":[{"in":"path","name":"id","required":true,"schema":{"pattern":"^gen_[A-Za-z0-9_-]{8,40}$","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}},"description":"Queued, running, done or failed.","headers":{"Retry-After":{"description":"Seconds to wait before polling again.","schema":{"type":"integer"}}}},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid or revoked API key (`invalid_api_key`)."},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Unknown or expired grid (`not_found`)."}},"summary":"The state of a generation; the grid file when done."}},"/v1/limits":{"get":{"operationId":"getLimits","responses":{"200":{"content":{"application/json":{"schema":{"properties":{"keyed":{"type":"boolean"},"limits":{"type":"object"},"time_budget_s":{"type":"number"},"used":{"type":"object"}},"type":"object"}}},"description":"Quotas."}},"summary":"Your quotas and what you used."}},"/v1/openapi.json":{"get":{"operationId":"getOpenApi","responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"OpenAPI 3.1."}},"summary":"This specification."}},"/v1/render":{"post":{"operationId":"renderGrid","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderRequest"}}},"required":true},"responses":{"200":{"content":{"application/pdf":{"schema":{"contentEncoding":"binary","type":"string"}},"image/png":{"schema":{"contentEncoding":"binary","type":"string"}},"image/svg+xml":{"schema":{"type":"string"}}},"description":"The drawing, signed."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request or settings (see `reason`)."},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid or revoked API key (`invalid_api_key`)."},"411":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Content-Length missing (`length_required`)."},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Body too large (`payload_too_large`)."},"415":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Content-Type must be application/json (`unsupported_media_type`)."}},"summary":"Draw the grid (puzzle or solution) as SVG, PNG or PDF."}}},"security":[{},{"apiKey":[]}],"servers":[{"url":"http://api.leflechoir.fr"}]}
