Build With Sro
Write the question, choose the answer type,
and stream the audio.
Write your questions
Each question gets a name you choose and a type that sets the shape of the answer. Write the question the way you would ask a person.
| Type | You get back | Example |
|---|---|---|
noul | The probability that the answer is yes | "noul: Is the caller upset?" |
choice(a, b, c) | The most likely option, with every option's probability | "choice(calm, annoyed, upset): How does the caller sound?" |
score(low, mid, high) | The expected level, counting from 0 | "score(quiet, normal, loud): How loud is the room?" |
when | The stretches of a recording where a yes holds (files only) | "when: Is someone laughing?" |
Live: open a session
curl https://rasha-rahman123--sro-api.us-east.modal.run/v1/live/sessions \
-H "Authorization: Bearer $SRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"questions": {
"asked": "noul: Is the speaker asking a question?",
"over": "noul: Are people talking over each other?",
"tone": "choice(calm, warm, annoyed, upset): How does the speaker sound?"}}'
The reply holds a WebSocket URL. Send 16 kHz mono 16-bit PCM as binary frames. Every half second, starting one second in, a decision about the newest seven seconds comes back:
{"type": "decision", "at": 14.0, "span": 7.0, "ms": 160,
"values": {"asked": 0.99, "over": 0.493, "tone": "annoyed"},
"probabilities": {"tone": {"calm": 0.255, "warm": 0.146, "annoyed": 0.32, "upset": 0.23}}}
A live session takes up to 12 questions of type noul, choice or score.
Recordings: one call
curl https://rasha-rahman123--sro-api.us-east.modal.run/v1/answers \
-H "Authorization: Bearer $SRO_API_KEY" \
-F file=@call.mp3 \
-F 'schema={"upset": "noul(share): Is the caller upset?",
"laughs": "when: Is someone laughing?"}'
Any common audio or video file up to 100 MB, with up to 24 questions. Sro reads up to 12 seven-second windows spread evenly over the file. The reply includes a recording id you can ask new questions of for 24 hours, and every answer to a measured kind of question carries its published accuracy.
Pricing
| Live | $0.06 per minute of audio for up to 4 questions, billed by the second. Each further 4 questions add $0.06 per minute. |
| Recordings | $0.01 per file for up to 8 questions. Each further 8 questions add $0.01. Uploading is free. |
| Free credit | $1 when you sign up, with an API key straight away. Add a card and get $4 more; past your credit, usage is billed monthly at the prices above. |