connectionType parameter determine how each request is processed.
All requests go to: https://api.dashboard.valuez.ai
Authentication uses the x-api-key header. See Authentication for details on key types and security practices.
Agent Chat API
Endpoint:POST /api/v1/external/chat
All four agent interaction modes use this single endpoint. The connectionType parameter tells the orchestrator how to handle the request.
Common Headers
Every request to this endpoint requires:Mode 1 - Text to Text (TTT)
Send a text message to your agent and receive a text response. Use this for chat interfaces, CRM integrations, and any text-based interaction.Synchronous Response
Returns the full answer in a single JSON response.cURL
Streaming Response
Streams the answer chunk by chunk using Server-Sent Events (SSE). Use this for real-time chat interfaces where you want to display text as it is generated.cURL
TTT Parameters
Mode 2 - Speech to Text (STT)
Send an audio file to the agent. The platform transcribes the audio, runs it through the agent, and returns both the transcription and the agent’s text response.Option A - Upload a Binary Audio File
cURL
When uploading a file using
multipart/form-data, the system automatically detects the audio and sets connectionType to "stt". Do not set Content-Type: application/json for file uploads.Option B - Pass Base64 Encoded Audio
cURL
Mode 3 - Text to Speech (TTS)
Send a text question to the agent and receive the agent’s response as a synthesized WAV audio file instead of text. Use this when you need to play the agent’s response through a speaker or phone system.cURL
The session UUID for continuing the conversation is returned in the response header
X-Session-UUID. Store this value and pass it in subsequent requests to maintain conversation context.Mode 4 - Speech to Speech (STS)
Initializes a real-time voice session. Since HTTP is not suitable for duplex real-time streaming, this endpoint returns a WebSocket URL that you connect to for the live voice conversation.cURL
wsUrl using a WebSocket client to begin the real-time voice session.
Mode Comparison
STT/TTS External API
These endpoints give you direct access to Valuez AI’s speech processing infrastructure - independent of any agent. Use your STT/TTS API key (ext_api_...) for these requests.
Text to Speech (TTS)
Convert any text string into a WAV audio file. Endpoint:POST /api/v1/tts/external
cURL
Speech to Text (STT)
Convert an audio file into a text transcription. Endpoint:POST /api/v1/stt/external
cURL
Supported languages:
english, hindi, marathi
Generating Your API Keys
API keys are generated from the Integrations section of your dashboard - not from Settings. See Integrations for step-by-step instructions on creating:- Agent API keys for the
/api/v1/external/chatendpoint - STT/TTS API keys for the
/api/v1/tts/externaland/api/v1/stt/externalendpoints
Next Steps
Integrations
Generate your API keys and configure endpoint access for your integration.
Authentication
Learn about the x-api-key header and security best practices.
API Logs
Monitor all STT/TTS API calls - usage, latency, and transcriptions.
Agents
Configure the agent your API key is connected to.