
API Docs
We provide public API's to interact with the models. Please contact us to try out the models with API key.
Alphabet Recognition
POST https://api.aipanjab.com/v1/models/alphabet-recognitionPredict alphabet from the input image.
Request body
file
file
Required
The image file object in one of these formats: png or jpeg. The maxmium file size is 15kb.
top-k
number
Optional
Default to 3 (min=1, max=5)
The number of predictions.
Returns
A list of predictions.
Example requestcurl --request POST \ --url https://api.aipanjab.com/v1/models/alphabet-recognition \ --header "Authorization: Bearer $AIPANJAB_API_KEY" \ --header "Content-Type: multipart/form-data" \ --form file=@/path/to/file/alphabet.pngExample response{ "predictions": [ { "label": "ਸ", "score": 0.9824657626 }, ... ]}Digit Recognition
POST https://api.aipanjab.com/v1/models/digit-recognitionPredict digit from the input image.
Request body
file
file
Required
The image file object in one of these formats: png or jpeg. The maxmium file size is 15kb.
top-k
number
Optional
Default to 3 (min=1, max=5)
The number of predictions.
Returns
A list of predictions.
Example requestcurl --request POST \ --url https://api.aipanjab.com/v1/models/digit-recognition \ --header "Authorization: Bearer $AIPANJAB_API_KEY" \ --header "Content-Type: multipart/form-data" \ --form file=@/path/to/file/digit.pngExample response{ "predictions": [ { "label": "੨", "score": 0.9928627836 }, ... ]}Handwriting Generator
POST https://api.aipanjab.com/v1/models/handwriting-generatorConvert input text into handwritten text.
Request body
text
string
Required
size (min=2, max=100)
The input text in Panjabi characters only.
line-space
number
Optional
Default to 125 (min=120, max=150)
The space between the lines.
char-space
number
Optional
Default to 35 (min=30, max=50)
The space between the chars.
word-space
number
Optional
Default to 75 (min=70, max=100)
The space between the words.
page-width
number
Optional
Default to 550 (min=300, max=950)
The width (x-axis) of the page.
page-length
number
Optional
Default to 550 (min=300, max=950)
The length (y-axis) of the page.
with-image
boolean
Optional
Default to false
Generate a png image of handwritten text.
stroke-color
string
Optional
Default to black (options=black, blue, pink, green, yellow, brown)
The color of the strokes. Required: with-image set to true.
stroke-width
decimal
Optional
Default to 2.5 (min=1.0, max=8.0)
The width of the strokes. Required: with-image set to true.
Returns
Representation of strokes in x and y points or in a png image.
Example requestcurl --request POST \ --url https://api.aipanjab.com/v1/models/handwriting-generator \ --header "Authorization: Bearer $AIPANJAB_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "text": "ਮੇਰਾ ਸੋਹਣਾ ਦੇਸ ਪੰਜਾਬ" }'Example response{ "points": { // each array represents a single stroke "x": [ [ 149, 150, ... ], ... ], "y": [ [ 164, 164, ... ], ... ] }}Speech Recognition
POST https://api.aipanjab.com/v1/models/speech-recognitionTranscribe and translate speech from the input audio file
Request body
file
file
Required
The audio file object in one of these formats: mp3 or wav. The maxmium file size is 2mb.
lang
string
Optional
Default to pa (options=pa, en)
The language code of speech in audio file.
with-translation
boolean
Optional
Default to false
Translate Panjabi speech to English or vice versa.
with-timestamps
boolean
Optional
Default to false
The timestamps of transcription and translation.
Returns
A transcription, translation and timestamps.
Example requestcurl --request POST \ --url https://api.aipanjab.com/v1/models/speech-recognition \ --header "Authorization: Bearer $AIPANJAB_API_KEY" \ --header "Content-Type: multipart/form-data" \ --form file=@/path/to/file/audio.mp3Example response{ "transcription": "ਏਆਈ ਪੰਜਾਬ ਉੱਤੇ ਤੁਹਾਡਾ ਸਵਾਗਤ ਹੈ...",
// if with-translation param set to true "translation": "Welcome to AI Punjab...",
// if with-timestamps param set to true "timestamps": [ { "start": 0.304, "end": 5.904, "transcription": "ਏਆਈ ਪੰਜਾਬ ਉੱਤੇ ਤੁਹਾਡਾ ਸਵਾਗਤ ਹੈ...", "translation": "Welcome to AI Punjab...", }, ... ]}