Skip to main content
Version: 1.3 Last updated: 2025-10-08 This document covers the /tasks endpoints for accessing Sunbird’s language models.

Quickstart

  1. Get an API key from your Sunbird dashboard.
  2. Call any endpoint with Authorization: Bearer YOUR_API_KEY.

Sunbird API — Tasks Endpoints (Authoritative Reference)

Version: 1.3 Last updated: 2025-10-08
1

Get an API Key

Obtain your key from the Sunbird dashboard.
2

Make a Request

Include the header Authorization: Bearer YOUR_KEY in all requests.
Tokens do not expire. Store them securely.

Speech-to-Text (STT)

Upload audio files for transcription. Endpoint: POST /tasks/stt

Limits

Max 10 minutes per file. Longer files are trimmed.

Formats

mp3, wav, ogg, m4a, aac

Usage Example

curl -X POST "https://api.sunbird.ai/tasks/stt" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected];type=audio/mpeg" \
  -F "language=lug"
For best results, upload audio re-encoded to 16kHz mono.

Language Identification

Detect the language of a text snippet. Endpoint: POST /tasks/language_id
curl -X POST "https://api.sunbird.ai/tasks/language_id" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Nkwagala nnyo"}'

Text Summarisation

Generate anonymised summaries for long texts. Endpoint: POST /tasks/summarise
Do not rely on this service for strict legal PII removal.
curl -X POST "https://api.sunbird.ai/tasks/summarise" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Long text content..."}'

Text-to-Speech (TTS)

Convert text to speech for multiple Ugandan languages. Endpoint: POST /tasks/tts
Speaker IDs: See the Languages page for a list of valid speaker_id values.
Parameters
{
  "text": "Webale nyo", // Required (1-5000 chars)
  "speaker_id": 248,      // See Languages page
  "temperature": 0.7,     // 0.0 - 2.0 (expressiveness)
  "max_new_audio_tokens": 2000
}

Response

Returns a signed URL in output.audio_url that expires in ~2 minutes.
curl -X POST "https://api.sunbird.ai/tasks/tts" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{"text":"Webale","speaker_id":248}'
Download the audio immediately. The URL is temporary.