Converse
curl --request POST \
--url https://api.namuai-lab.com/v1/converse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://api.namuai-lab.com/v1/converse"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.namuai-lab.com/v1/converse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"model": "voice-agent",
"persona": "nadia",
"session_id": "<string>",
"heard": "<string>",
"reply": "<string>",
"audio": "<string>",
"sample_rate": 24000,
"audio_seconds": 123
}{
"error": {
"type": "unknown_voice",
"message": "Unknown voice. Try one of: nadia, warm, fr, mouhamad.",
"request_id": "3f2a9c1e5b7d4e8fa0c2b6d9e1f3a5c7"
}
}{
"error": {
"type": "missing_api_key",
"message": "Send your key as 'Authorization: Bearer namu_sk_...'.",
"request_id": "3f2a9c1e5b7d4e8fa0c2b6d9e1f3a5c7"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}Voice agent
Converse
One turn of a spoken conversation in Hausa: send what the person said, get back what was heard, the reply as text and the reply spoken. A research preview. New keys do not include the converse scope: tick it when you create the key. Counts the audio sent plus the reply.
POST
/
v1
/
converse
Converse
curl --request POST \
--url https://api.namuai-lab.com/v1/converse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://api.namuai-lab.com/v1/converse"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.namuai-lab.com/v1/converse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"model": "voice-agent",
"persona": "nadia",
"session_id": "<string>",
"heard": "<string>",
"reply": "<string>",
"audio": "<string>",
"sample_rate": 24000,
"audio_seconds": 123
}{
"error": {
"type": "unknown_voice",
"message": "Unknown voice. Try one of: nadia, warm, fr, mouhamad.",
"request_id": "3f2a9c1e5b7d4e8fa0c2b6d9e1f3a5c7"
}
}{
"error": {
"type": "missing_api_key",
"message": "Send your key as 'Authorization: Bearer namu_sk_...'.",
"request_id": "3f2a9c1e5b7d4e8fa0c2b6d9e1f3a5c7"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"type": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}Authorizations
Your secret key: Authorization: Bearer namu_sk_.... Create one at https://www.namuai-lab.com/account/keys.
Body
multipart/form-data