logo image

Hasab

Transcription

Convert audio files to text accurately using Hasab AI APIs

Transcription Endpoints

1. Upload and Transcribe Audio

Endpoint: POST /v1/upload-audio

Description: Upload an audio file and get its transcription text.

Request Body (multipart/form-data):

{
  "translate": false,
  "summarize": false,
  "language": "auto",
  "transcribe": true,
  "timestamps": false,
  "source_language": "eng",
  "file": "audio_file"
}

Validation

ParameterTypeRequiredDescription
fileFileYesThe audio file to process (MP3, WAV, or M4A).
transcribeBooleanYesWhether to transcribe the audio (default: true).
translateBooleanYesWhether to translate the transcription (default: false).
summarizeBooleanYesWhether to generate a summary of the transcription (default: false).
languageStringYesTarget language code for translation or transcription (default: "auto").
source_languageStringNoLanguage code of the original audio (e.g., "amh" for Amharic).
timestampsBooleanNoWhether to include timestamps for each segment of the transcription (default: false).

Response:

{
  "success": true,
  "message": "Audio uploaded and processed successfully",
  "audio": {
    "user_id": 1298,
    "filename": "35f90f42-6390-4f22-8e41-2245c2834fd9.mp3",
    "original_filename": "35f90f42-6390-4f22-8e41-2245c2834fd9.mp3",
    "duration_in_seconds": 23.980419718502525,
    "mime_type": "audio/mpeg",
    "file_size": 384459,
    "path": "audios/original/35f90f42-6390-4f22-8e41-2245c2834fd9.mp3",
    "description": null,
    "is_meeting": true,
    "updated_at": "2025-10-31T15:28:44.000000Z",
    "created_at": "2025-10-31T15:28:30.000000Z",
    "id": 8769,
    "transcription": "የፋሲልለደስ ቤተመንግስት እዚህ ጋር እንደምታዩት በፊት ከነበረው ከለር አሁን በጣም ከፍተኛ የሆነ ልዩነት አምጥቶ ታይቷል ማለት ነው። እዚህ ጋር እንደምታዩት ወደ ቢጫ የሄደ ከለር ነው። ያ አሁን የታደሰው ደግሞ እንደዚህ ጋር እንደምታዩት ወደ ነጭ ወይም ሞራ ከለር ተቀይሯል። እና ከለሩ መቀየርም በዚህ ሰአት ብዙዎችን እያነጋገረ ይገኛል። እስኪዚህ የዘርፉ ባለሙያዎች ካላችሁ አስተያየት ስጡበት? እድሳት ሲደረግ በዚህ ልክ የከለር ዲፈረንስ ቢኖረው ችግር አለ ወይስ ችግር የለውም? የሚለውን አስተያየት ስጡበት።",
    "translation": "",
    "summary": "",
    "tokens_used": 6,
    "audio_url": "https://hasab.s3.amazonaws.com/audios/original/35f90f42-6390-4f22-8e41-2245c2834fd9.mp3?response-content-type=audio%2Fmpeg&response-content-disposition=attachment%3B%20filename%3D%2235f90f42-6390-4f22-8e41-2245c2834fd9.mp3%22&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA3ARKCU2R5ANLKWXX%2F20251031%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20251031T152844Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1800&X-Amz-Signature=2ae39699d79cdb6bcbd5f98284b1adf66321fed7d878b8de118b2f61e059c542",
    "subtitle_url": null
  },
  "transcription": "የፋሲልለደስ ቤተመንግስት እዚህ ጋር እንደምታዩት በፊት ከነበረው ከለር አሁን በጣም ከፍተኛ የሆነ ልዩነት አምጥቶ ታይቷል ማለት ነው። እዚህ ጋር እንደምታዩት ወደ ቢጫ የሄደ ከለር ነው። ያ አሁን የታደሰው ደግሞ እንደዚህ ጋር እንደምታዩት ወደ ነጭ ወይም ሞራ ከለር ተቀይሯል። እና ከለሩ መቀየርም በዚህ ሰአት ብዙዎችን እያነጋገረ ይገኛል። እስኪዚህ የዘርፉ ባለሙያዎች ካላችሁ አስተያየት ስጡበት? እድሳት ሲደረግ በዚህ ልክ የከለር ዲፈረንስ ቢኖረው ችግር አለ ወይስ ችግር የለውም? የሚለውን አስተያየት ስጡበት።",
  "timestamp": [
    {
      "index": 1,
      "start": 0,
      "end": 1.52,
      "content": "የፋሲልለደስ ቤተመንግስት እዚህ ጋር",
      "proprietary": ""
    },
    {
      "index": 2,
      "start": 1.6,
      "end": 3.36,
      "content": "እንደምታዩት በፊት ከነበረው ከለር",
      "proprietary": ""
    }
    // other timestamps
  ],
  "translation": "",
  "summary": "",
  "metadata": {
    "tokens_charged": 6,
    "remaining_tokens": 150,
    "charge_message": "Tokens charged successfully"
  }
}

2. Transcription History

Endpoint: GET /v1/audios

Description: Retrieve a list of all transcription jobs uploaded by the user.

Query Parameter

ParameterTypeRequiredDescription
pageIntNoSpecify which page of results to retrieve. Default is 1.

Response:

{
  "status": "success",
  "data": {
    "current_page": 1,
    "data": [
      {
        "id": 8689,
        "user_id": "5",
        "device_id": null,
        "filename": "demo_audio_file_001.wav",
        "original_filename": "meeting_recording_oct29.wav",
        "mime_type": "wav",
        "duration_in_seconds": "120",
        "file_size": "1024000",
        "path": "audios/demo/meeting_recording_oct29.wav",
        "subtitle_path": "audios/subtitles/meeting_recording_oct29.srt",
        "description": "Weekly team meeting discussion about project progress",
        "transcription": "This is a demo transcription of the audio content. It contains sample text that would normally be generated from speech-to-text processing. The content includes discussions about project timelines, team updates, and action items for the upcoming week.",
        "translation": "Esta es una transcripción de demostración del contenido de audio. Contiene texto de muestra que normalmente se generaría a partir del procesamiento de voz a texto.",
        "summary": "Team discussed Q3 progress, assigned new tasks, and set deadlines for project milestones.",
        "audio_type": "meeting",
        "is_meeting": "1",
        "created_at": "2025-10-29T13:08:09.000000Z",
        "updated_at": "2025-10-29T13:08:09.000000Z",
        "tokens_used": "40.00",
        "user": {
          "id": 5,
          "name": "John Doe",
          "email": "user_email@example.com"
        }
      }
    ],
    "first_page_url": "https://hasab.co/api/v1/audios?page=1",
    "from": 1,
    "last_page": 30,
    "last_page_url": "https://hasab.co/api/v1/audios?page=30",
    "links": [
      {
        "url": null,
        "label": "« Previous",
        "active": false
      }
    ],
    "next_page_url": "https://hasab.co/api/v1/audios?page=2",
    "path": "https://hasab.co/api/v1/audios",
    "per_page": 15,
    "prev_page_url": null,
    "to": 1,
    "total": 439
  }
}