> ## Documentation Index
> Fetch the complete documentation index at: https://developers.namuai-lab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Create a key, make your first request, and hear a sentence spoken in Hausa.

5 min

Your first call in five minutes

The Namu API is a plain HTTPS API: every request is a `POST` or a `GET` to `https://api.namuai-lab.com/v1/...` with your key in the `Authorization` header. Anything that can send HTTP can use it.

**1. Create an API key**

Sign in to the [Namu console](https://www.namuai-lab.com/account/keys) and open **API keys**. Create a key, give it a name you will recognise, and copy it. It starts with `namu_sk_` and is shown **once**.

> [!WARNING]
>
> Your key is a password. Keep it on your server: never put it in a mobile app, a web page or a public repository. Anyone holding it can spend your allowance.

**2. Save the key as an environment variable**

Your code reads the key from the environment, so it never sits in a file you might share.

```bash macOS and Linux theme={null}
export NAMU_API_KEY="namu_sk_..."
```

```powershell Windows (PowerShell) theme={null}
setx NAMU_API_KEY "namu_sk_..."
```

On Windows, open a new terminal afterwards so it sees the variable.

**3. Make your first request**

Ask Nadia to say *"Sannu da zuwa! Muna farin cikin jin muryarku."* (Welcome! We are glad to hear your voice.)

```bash curl theme={null}
curl https://api.namuai-lab.com/v1/speech \
  -H "Authorization: Bearer $NAMU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Sannu da zuwa! Muna farin cikin jin muryarku.", "voice": "nadia"}' \
  -o welcome.wav
```

```python Python theme={null}
import os
import requests

response = requests.post(
    "https://api.namuai-lab.com/v1/speech",
    headers={"Authorization": f"Bearer {os.environ['NAMU_API_KEY']}"},
    json={"text": "Sannu da zuwa! Muna farin cikin jin muryarku.", "voice": "nadia"},
    timeout=120,
)
response.raise_for_status()

with open("welcome.wav", "wb") as f:
    f.write(response.content)
print("Saved", response.headers["X-Audio-Seconds"], "seconds of audio")
```

```javascript JavaScript theme={null}
import { writeFile } from "node:fs/promises";

const response = await fetch("https://api.namuai-lab.com/v1/speech", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.NAMU_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ text: "Sannu da zuwa! Muna farin cikin jin muryarku.", voice: "nadia" }),
});
if (!response.ok) throw new Error((await response.json()).error.message);

await writeFile("welcome.wav", Buffer.from(await response.arrayBuffer()));
console.log("Saved", response.headers.get("X-Audio-Seconds"), "seconds of audio");
```

**4. Play it**

Open `welcome.wav`. That is your app speaking Hausa. The first request after a quiet spell can take a little longer while the model wakes up; the next ones are faster.

## Now let it listen

Send the file you just made back to the API and read what it heard:

```bash curl theme={null}
curl https://api.namuai-lab.com/v1/transcribe \
  -H "Authorization: Bearer $NAMU_API_KEY" \
  -F file=@welcome.wav \
  -F language=ha
```

```python Python theme={null}
with open("welcome.wav", "rb") as audio:
    response = requests.post(
        "https://api.namuai-lab.com/v1/transcribe",
        headers={"Authorization": f"Bearer {os.environ['NAMU_API_KEY']}"},
        files={"file": audio},
        data={"language": "ha"},
        timeout=120,
    )
print(response.json()["text"])
```

```javascript JavaScript theme={null}
import { readFile } from "node:fs/promises";

const form = new FormData();
form.append("file", new Blob([await readFile("welcome.wav")]), "welcome.wav");
form.append("language", "ha");

const heard = await fetch("https://api.namuai-lab.com/v1/transcribe", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.NAMU_API_KEY}` },
  body: form,
}).then((r) => r.json());
console.log(heard.text);
```

```json Response theme={null}
{
  "model": "speech-recognition",
  "text": "sannu da zuwa muna farin cikin jin muryarku",
  "language": "ha",
  "audio_seconds": 3.1
}
```

> [!NOTE]
>
> Transcripts are written in lower case, without punctuation. Add your own if your screen needs it.

## Next steps

> [card] [Choose a voice](https://developers.namuai-lab.com/voices-and-languages.md)
>
> Nadia in Hausa, Mouhamad in Zarma and Hausa, and the French voice.

> [card] [Translate](https://developers.namuai-lab.com/capabilities/translation.md)
>
> Hausa to French and back, from text or from speech.

> [card] [Use an SDK](https://developers.namuai-lab.com/sdks/overview.md)
>
> A small Python or JavaScript client you can paste into your project.

> [card] [Watch your usage](https://developers.namuai-lab.com/guides/usage-and-rate-limits.md)
>
> How each request is counted against your 30 free minutes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.