> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sunbird.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Verify Email

> Landing endpoint for the emailed verification link. Opening the link marks the account as verified and **always redirects** to the web app — it never reveals whether an account exists.

You normally do not call this endpoint yourself; it is the target of the link sent by `POST /auth/register` and `POST /auth/resend-verification`.



## OpenAPI

````yaml api-reference/openapi.json GET /auth/verify-email
openapi: 3.1.0
info:
  title: Sunbird AI API
  description: >

    Welcome to the Sunbird AI API documentation. The Sunbird AI API provides
    access to

    Sunbird's language models and AI services for Ugandan languages.


    ## Supported Languages

    **English**, **Acholi**, **Ateso**, **Luganda**, **Lugbara**,
    **Runyankole**, **Swahili**

    and **20+** more Ugandan languages supported via sunflower.


    ## Getting Started

    You can checkout the [usage guide](https://salt.sunbird.ai/API/) for a full
    tutorial.


    For quickstart tutorials, visit our

    [GitHub
    repository](https://github.com/SunbirdAI/sunbird-ai-api/blob/main/docs/tutorial.md)


    ### Authentication


    #### Signing Up

    If you don't already have an account, use the `/auth/register` endpoint to
    create one.


    #### Getting an Access Token

    Authentication is done via a Bearer token. Use the `/auth/token` endpoint to
    get your

    access token. This token lasts for 7 days.


    Use the `Authorize` button below to login and access the protected
    endpoints.


    ## API Endpoints


    ### Translation

    - **`POST /tasks/translate`** - Translate text between 32 Ugandan and East
    African
      languages using the Sunflower model. Languages are accepted as ISO codes (`lug`)
      or full names (`Luganda`); `source_language` is optional (auto-detected when
      omitted). Translation works between any pair of supported languages.

    ### Language Detection

    - **`POST /tasks/language_id`** - Auto-detect the language of text input
      (supports Acholi, Ateso, English, Luganda, Lugbara, Runyankole)

    ### Speech-to-Text (STT)

    - **`POST /tasks/audio/transcriptions`** - STT endpoint, powered by
      Sunbird's faster-whisper ASR model covering **51 African languages**
      (`Sunbird/faster-whisper-51-african-languages`, a Whisper large-v3 fine-tune).
      - `audio`: the audio file to transcribe (**required**). Supports WAV, MP3,
        OGG, M4A, and more.
      - `language`: ISO 639-3 code (**required**). The model reuses Whisper's
        language-token slots for African languages, so automatic detection is
        unreliable — always pass a language explicitly.
      - `timestamps`: set `true` to also receive per-segment start/end times in the
        `segments` field. Defaults to `false`.
      - **51 supported languages**: Acholi (`ach`), Afrikaans (`afr`), Akan (`aka`),
        Amharic (`amh`), Ateso (`teo`), Bambara (`bam`), Bemba (`bem`),
        Berber (`ber`), Chichewa (`nya`), Dagaare (`dga`), Dagbani (`dag`),
        English (`eng`), Ewe (`ewe`), French (`fra`), Fulani (`ful`), Hausa (`hau`),
        Igbo (`ibo`), Ikposo (`kpo`), Kabyle (`kab`), Kalenjin (`kln`),
        Kanuri (`kau`), Kikuyu (`kik`), Kinyarwanda (`kin`), Kwamba (`rwm`),
        Lendu (`led`), Lingala (`lin`), Lugbara (`lgg`), Luganda (`lug`),
        Luhya (`luy`), Lumasaba (`myx`), Luo (`luo`), Lusoga (`xog`),
        Malagasy (`mlg`), Ndebele (`nbl`), Nigerian Pidgin (`pcm`), Oromo (`orm`),
        Rukiga (`cgg`), Rukonjo (`koo`), Runyankole (`nyn`), Ruruuli (`ruc`),
        Rutooro (`ttj`), Shona (`sna`), Somali (`som`), Sotho (`sot`),
        Swahili (`swa`), Thur (`lth`), Tswana (`tsn`), Wolof (`wol`),
        Xhosa (`xho`), Yoruba (`yor`), Zulu (`zul`).
      - **Removed parameters** (previously accepted, now rejected): `platform`,
        `adapter`, `whisper`, `recognise_speakers`, `org`, `gcs_blob_name`. Speaker
        diarization and the organization workflow remain on the legacy routes below.
      - **Deprecated** → use `POST /tasks/audio/transcriptions`:
        - `POST /tasks/stt`, `POST /tasks/stt_from_gcs`, `POST /tasks/org/stt`,
          `POST /tasks/modal/stt`

    ### Text-to-Speech (TTS)

    All TTS is served by the **RunPod Orpheus-3B** deployment

    (`sunbird-orpheus-tts`, 20 African languages / 40+ speakers). The earlier

    model/platform matrix (spark-tts, Modal) and the per-provider TTS routes
    were

    removed — **breaking change**.

    - **`POST /tasks/audio/speech`** - Single-synthesis endpoint.
      - `voice`: Orpheus speaker tag (e.g. `salt_lug_0001`). If omitted, a speaker is
        chosen for `language` (Luganda by default).
      - `response_mode`: `url` (default — signed GCP Storage URL), `stream` (raw audio
        bytes proxied from RunPod), or `both` (raw audio bytes with the signed URL in
        the `X-Audio-Url` response header).
      - Tuning: `language`, `temperature`, `top_p`, `repetition_penalty`,
        `max_tokens`, `seed`.
      - **Removed parameters** (previously accepted, now rejected): `model`,
        `platform`, `max_new_audio_tokens`.
    - **`POST /tasks/audio/speech/batch`** - Batch synthesis, 1-16 items (RunPod
    cap).

    - **`GET /tasks/voice/speakers`** - List Orpheus voices (optional
    `language`).
      - **sunbird-orpheus-tts** covers 20 African languages: Acholi (`ach`), Afrikaans (`afr`),
        English (`eng`), Ewe (`ewe`), Fulah (`ful`), Hausa (`hau`), Igbo (`ibo`), Kikuyu (`kik`),
        Kinyarwanda (`kin`), Lugbara (`lgg`), Lingala (`lin`), Luganda (`lug`), Luo (`luo`),
        Runyankole (`nyn`), Sesotho (`sot`), Swahili (`swa`), Ateso (`teo`), Setswana (`tsn`),
        Xhosa (`xho`), Yoruba (`yor`). A few (`lgg`, `sot`, `tsn`) are in the training mix but
        expose no individual voice IDs yet. Full per-speaker catalog: see the
        [tutorial](https://github.com/SunbirdAI/sunbird-ai-api/blob/main/docs/tutorial.md)
        or call `GET /tasks/voice/speakers`.
    - **`GET /tasks/audio/speech/url`** - Refresh an expired signed URL for a
    stored audio object.
      - **Removed** → use the unified endpoints above:
        - `POST /tasks/modal/tts`, `POST /tasks/runpod/tts`,
          `POST /tasks/modal/orpheus/tts`, `POST /tasks/tts` → `POST /tasks/audio/speech`
        - `POST /tasks/modal/tts/stream` → `/tasks/audio/speech` (`response_mode=stream`)
        - `POST /tasks/modal/tts/stream-with-url` → `/tasks/audio/speech` (`response_mode=both`)
        - `POST /tasks/modal/orpheus/tts/batch` → `POST /tasks/audio/speech/batch`
        - `GET /tasks/modal/tts/speakers`, `GET /tasks/modal/orpheus/speakers`,
          `GET /tasks/modal/orpheus/speakers/{language}` → `GET /tasks/voice/speakers`
        - `GET /tasks/modal/tts/refresh-url` → `GET /tasks/audio/speech/url`

    ### Inference (Sunflower Chat)

    - **`POST /tasks/chat/completions`** - OpenAI-compatible chat completions
    (Sunflower models).
      Supports single instructions, multi-turn conversations, and SSE streaming (`stream: true`).
      - Select a model with the `model` field:
        - **`sunflower-14b`** (default) — Sunbird's flagship 14B model. Covers **English
          plus 31 Ugandan and regional languages** (32 total). Best for high-accuracy
          translation, factual Q&A, summarization, and explanation across Ugandan languages.
        - **`sunflower-9b`** — broader pan-African coverage: **67 African languages** across
          good/moderate/basic tiers. Optimized for translation, instruction-following, and
          multi-turn chat.
      - `sunflower-14b` is the default when `model` is omitted. The old identifier
        `Sunbird/Sunflower-14B` is **no longer accepted** — requests using it return
        `400` with a message to use `sunflower-14b` instead.
      - **Deprecated** → superseded by the unified endpoint above:
        - `POST /tasks/sunflower_inference` → `POST /tasks/chat/completions`
        - `POST /tasks/sunflower_simple` → `POST /tasks/chat/completions` (send the instruction as a single user message)

    ### File Upload

    - **`POST /tasks/generate-upload-url`** - Generate signed URLs for direct
    client uploads to GCP Storage
      - Supports audio files, images, and other content types
      - Includes path traversal protection and input validation
      - Returns temporary signed URL valid for 30 minutes

    ### WhatsApp Integration (Webhooks)

    - **`POST /tasks/webhook`** - Handle incoming WhatsApp Business API messages

    - **`GET /tasks/webhook`** - Verify webhook endpoint ownership for WhatsApp



    ## Rate Limiting

    API endpoints are rate-limited to ensure fair usage. Authentication is
    required for most endpoints.
  version: 2.1.0
servers:
  - url: https://api.sunbird.ai
security: []
tags:
  - name: Authentication Endpoints
    description: >-
      Operations for authentication, including user registration and login. Get
      access tokens to use protected endpoints.
  - name: Speech-to-Text
    description: >-
      Convert speech audio to text. The unified /tasks/audio/transcriptions
      endpoint is powered by Sunbird's faster-whisper ASR model covering 51
      African languages. It takes an uploaded audio file plus a required ISO
      639-3 language code, and optionally returns per-segment timestamps
      (timestamps=true). Speaker diarization and the organization workflow
      remain on the deprecated /tasks/stt* routes.
  - name: Text-to-Speech
    description: >-
      Synthesize speech from text via the RunPod Orpheus-3B deployment (20
      African languages, 40+ speakers). Endpoints: single (/tasks/audio/speech),
      batch up to 16 items (/tasks/audio/speech/batch), voice listing
      (/tasks/voice/speakers), and signed-URL refresh (/tasks/audio/speech/url).
      response_mode='url' returns a signed GCS URL; 'stream'/'both' return raw
      audio bytes.
  - name: Translation
    description: >-
      Translate text using the Sunflower model. Supports 32 languages (e.g.
      Luganda, Acholi, Ateso, Lugbara, Runyankole, Swahili, Kinyarwanda)
      accepted as ISO codes or full names; source language is optional and
      translation works between any supported pair.
  - name: Language
    description: >-
      Language identification and detection. Automatically detect the language
      of text input from supported languages.
  - name: Chat
    description: >-
      OpenAI-compatible chat completions powered by Sunbird's Sunflower models.
      Choose `sunflower-14b` (default; English + 31 Ugandan/regional languages)
      or `sunflower-9b` (67 African languages). The old `Sunbird/Sunflower-14B`
      identifier is no longer accepted — use `sunflower-14b`. Supports single
      instructions, multi-turn conversations, and SSE streaming.
  - name: Upload
    description: >-
      File upload utilities. Generate signed URLs for direct client uploads to
      GCP Storage with security validation.
  - name: Webhooks
    description: >-
      WhatsApp Business API webhook integration. Handle incoming messages and
      verify webhook endpoints for WhatsApp chatbot functionality.
paths:
  /auth/verify-email:
    get:
      tags:
        - Authentication Endpoints
      summary: Verify Email
      description: >-
        Landing endpoint for the emailed verification link. Opening the link
        marks the account as verified and **always redirects** to the web app —
        it never reveals whether an account exists.


        You normally do not call this endpoint yourself; it is the target of the
        link sent by `POST /auth/register` and `POST /auth/resend-verification`.
      operationId: verify_email_auth_verify_email_get
      parameters:
        - name: token
          in: query
          required: true
          schema:
            type: string
            title: Token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````