Voice agent: spoken question in, spoken answer out, with memory
One turn of a voice assistant: send the user's voice note (or text), your instructions and the earlier turns; get back what was heard, a short reply, the reply spoken in English, Spanish, French, Chinese, Japanese or Korean and the updated history to send next time. Speech up to 2 minutes (MP3/WAV, or 1 MB of other formats); replies up to 600 characters. Use for voice bots in Telegram or WhatsApp, phone menus, kiosks and hands-free helpers.
Inputs
| Name | Type | Description |
|---|---|---|
text | string | The user's turn as text (or send audio with url or a POSTed file) |
url | string | Absolute http(s) URL of the user's spoken turn (MP3/WAV up to 2 minutes, other formats up to 1 MB); or POST the file; or send text instead |
instructions | string | Who the assistant is and what it knows (up to 2,000 characters) |
history | string | Earlier turns as a JSON array of {role, content}, as returned in history by the last call |
lang | string | Reply language and voice: en, es (Aura-2 MP3), fr, zh, ja or ko (MeloTTS WAV); default en. One of: en, es, fr, zh, ja, ko. |
voice | string | Aura-2 voice for an en or es reply (default luna for en, aquila for es); fr, zh, ja and ko have one voice each |
Request
Over HTTP, with a card key from /credits:
curl -H "Authorization: Bearer adt_…" "https://api.glyphcall.com/voice/agent?text=What%20time%20do%20you%20open%20on%20Saturday%3F"
Without a key, the same URL answers 402 Payment Required with x402 and MPP terms, so an agent with a wallet pays per call in USDC (Base, Polygon, Arbitrum or Solana over x402; Base or Tempo over MPP) and retries.
Example result
{
"heard": "What time do you open on Saturday?",
"reply": "On Saturday we are open from seven in the morning until five in the afternoon.",
"contentType": "audio/mpeg",
"audioBase64": "SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjYwLjMuMTAwAAAA…",
"audioBytes": 61440,
"voice": "luna",
"lang": "en",
"history": [
{
"role": "user",
"content": "What time do you open on Saturday?"
},
{
"role": "assistant",
"content": "On Saturday we are open from seven in the morning until five in the afternoon."
}
],
"model": "@cf/meta/llama-4-scout-17b-16e-instruct",
"speechModel": "@cf/deepgram/aura-2-en"
}
From an AI agent (MCP)
Add the MCP server to Claude, Cursor or any MCP client. This tool is voice_agent, and the first 25 successful calls are free:
https://api.glyphcall.com/mcp