For the deepgram guys reading this. Aura 1 models return these headers from the TTS post request:
< HTTP/2 200
< content-type: audio/mpeg
< dg-model-name: aura-asteria-en
< dg-model-uuid: ecb76e9d-f2db-4127-8060-79b05590d22f
< dg-char-count: 32
< vary: origin, access-control-request-method, access-control-request-headers
< vary: accept-encoding
< access-control-allow-credentials: true
< access-control-expose-headers: dg-model-name,dg-model-uuid,dg-char-count,dg-request-id,dg-error
< dg-request-id: 53ff6fd3-6502-49db-b205-a6c3c4e7005f
< date: Tue, 15 Apr 2025 18:20:01 GMT
Specifically this includes model-uuid and char-count
Aura 2 models return much fewer headers:
< HTTP/2 200
< content-type: audio/mpeg
< x-dg-request-id: 6f01ad8b-0f80-4686-98aa-e0aaf205a48c
< x-dg-model-name: aura-2-thalia-en
< x-dg-characters: 32
< date: Tue, 15 Apr 2025 18:15:10 GMT
Notably, model-uuid is missing and it seems char-count is replaced with characters
You should probably either make the response headers consistent across aura 1 and aura 2. If you can't for some reason, then in the python sdk, you should handle the response for aura 1 and aura 2 models differently
For aura 2 models this works:
return_vals = [
"content-type",
"request-id",
"model-name",
"characters",
"transfer-encoding",
"date",
]
...
resp = SpeakRESTResponse(
content_type=str(result["content-type"]),
request_id=str(result["request-id"]),
model_name=str(result["model-name"]),
characters=int(str(result["characters"])),
transfer_encoding=str(result["transfer-encoding"]),
date=str(result["date"]),
stream=cast(io.BytesIO, result["stream"]),
stream_memory=cast(io.BytesIO, result["stream"]),
)