OpenAI Compatible
Cantonese.AI's API is compatible with OpenAI's libraries, making it easy to integrate our specialized Cantonese language models into your existing applications.
To start using Cantonese.AI with OpenAI's client libraries, pass in your Cantonese.AI API key to the api_key
option, and change the base_url
to https://stt-api.cantonese.ai/v1/
for Speech-to-Text.
Example Request
Here are examples of how to transcribe audio files using different programming languages.
curl -X POST "https://stt-api.cantonese.ai/v1/audio/transcriptions" \
-H "Authorization: Bearer XXXXXXX" \
-F "[email protected]" \
-F "language=zh"
Status Codes
The API returns standard HTTP status codes to indicate the success or failure of requests.
Status Code | Description |
---|---|
200 | Success - Audio transcribed successfully |
400 | Bad Request - Invalid parameters or malformed request |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - API key doesn't have permission for this endpoint |
413 | Payload Too Large - Audio file exceeds maximum size limit |
415 | Unsupported Media Type - Audio format not supported |
422 | Unprocessable Entity - Audio file corrupted or invalid parameter values |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Server encountered an unexpected condition |
503 | Service Unavailable - Server is temporarily unable to handle the request |