Skip to main content
POST
Generate Sudoku Puzzle

Request contract

  • Method and path: POST /apis/v1/api-ninjas/generate-sudoku
  • Availability: enabled
  • Request URL template: https://api.aisa.one/apis/v1/api-ninjas/generate-sudoku
Complete OpenAPI definition Effective request declaration (including authentication and referenced schemas):

Cost and request rules

Usage-based pricing. Default request estimate: $0.00089 USD. The final charge depends on actual usage. Your account price may differ; use a request quote where supported.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
difficulty
enum<string>
default:medium

Supported difficulty levels for Sudoku puzzle generation.

Available options:
easy,
medium,
hard
height
integer
default:3

Height of each box in the Sudoku grid. Must be between 2 and 4. Default is 3 (standard 9x9 Sudoku).

Required range: 2 <= x <= 4
Examples:

2

3

4

seed
integer

Seed value for reproducible puzzle generation. Use the same seed to generate the same puzzle. Optional.

Examples:

12345

67890

width
integer
default:3

Width of each box in the Sudoku grid. Must be between 2 and 4. Default is 3 (standard 9x9 Sudoku).

Required range: 2 <= x <= 4
Examples:

2

3

4

Response

Tool result data

puzzle
((integer | null)[])[]
required
solution
integer[][]
required