Skip to main content
Valuez AI provides API keys for connecting external applications to AI agents and speech services. Two key families are supported:
API keys are credentials. Never paste a real key into public documentation, browser JavaScript, screenshots, Git repositories, support tickets, or client-side mobile application code.

Base URL

The production API base URL is:
All endpoint paths in this guide are relative to that base URL. Development and staging environments can use different hosts. Confirm the correct base URL with your Valuez administrator before integrating.

Authentication header

Send the API key in the x-api-key header:
For JSON requests, also include:
For audio uploads, use multipart/form-data. When using curl -F, do not manually set the multipart Content-Type; curl adds the required boundary automatically.
Dashboard APIs use a JWT bearer token. The external endpoints on this page use x-api-key. A dashboard JWT cannot replace an external API key.

Choose the correct API


Agent API

An Agent API key is associated with a specific Valuez agent. That agent supplies the model, prompt, knowledge base, language configuration, voice, and transcriber used by the request.

Unified agent endpoint

The endpoint supports four communication modes:

Requirements applied to every agent request

Before processing a request, Valuez checks:
  1. The API key is present.
  2. The key format is valid.
  3. The key exists and is active.
  4. The key is associated with an agent.
  5. The individual key credit limit has not been exceeded.
  6. The account has an active subscription.
  7. The subscription includes integrations.
  8. The API key permits the requested communication mode.
  9. Voice access is available for STT, TTS, or STS requests.
  10. Sufficient account credits are available.
  11. The configured agent has the required model, knowledge, voice, and transcription settings.
A valid key can still receive 403 if the requested mode is disabled for that key or unavailable under the current subscription.

Text-to-Text

Text-to-Text sends a question to the configured agent and returns an answer as text. Typical use cases include:
  • website chat;
  • CRM assistants;
  • internal support tools;
  • messaging integrations;
  • server-side automation;
  • testing agent knowledge.

Synchronous request

A synchronous request returns the complete answer in one response.
The text can alternatively be supplied as input.text:

TTT request parameters

Example synchronous response

The exact response can include additional fields depending on the deployed version.
Store the sessionUUID if the user is expected to continue the same conversation.

Streaming Text-to-Text

Set responseMode to "stream" to receive Server-Sent Events.
The response content type is:
A stream can contain events similar to:

Streaming client requirements

Your client should:
  • keep the HTTP connection open;
  • process each data: event;
  • preserve the returned sessionUUID;
  • concatenate text in received order;
  • detect normal completion;
  • handle connection interruption;
  • avoid automatically replaying a non-idempotent user message without confirming whether it was processed.

Continue an existing conversation

Pass the previously returned sessionUUID:
Never reuse one customer’s sessionUUID for another customer. A session contains conversation context and can contain personal information.

Retrieve conversation history

Use the history endpoint to restore a conversation after a refresh or application restart.

Example response

The API verifies that the session belongs to the agent associated with the supplied key.

Speech-to-Text Agent Interaction

STT mode accepts user audio, transcribes it, sends the transcription to the configured agent, and returns the agent’s text response. The agent must have:
  • a configured transcription provider;
  • a valid transcription model;
  • a connected knowledge base;
  • a configured language supported by the selected provider;
  • permission for Speech-to-Text;
  • a subscription with voice access.

Upload an audio file

Do not manually add Content-Type: multipart/form-data when using curl -F. Curl generates the multipart boundary automatically.

Submit Base64 audio

Send only the Base64 data unless your client and deployed API explicitly support a data-URL prefix.

Submit an audio URL

The audio URL must be reachable by the Valuez backend. Do not use expiring URLs that become invalid before the server can download the file.

STT response

A successful response can include both the transcription and the agent answer:
Audio quality, language selection, background noise, sample rate, and the selected transcription provider affect accuracy.

Text-to-Speech Agent Interaction

TTS mode sends a text question to the configured agent and returns the agent’s generated response as audio. This is different from the standalone TTS endpoint. Agent TTS first generates an answer using the agent’s prompt and knowledge base, then synthesizes that answer using the agent’s saved voice.
The response can be returned as audio/wav or another configured audio content type. The conversation UUID can be returned through:
Store that header when continuing the same conversation. Your client should inspect the response Content-Type before treating the body as audio. An error response can be JSON rather than an audio file.

Speech-to-Speech

STS initializes a real-time duplex voice session. The HTTP endpoint performs the handshake and returns a WebSocket URL.

Create the STS session

responseMode: "realtime" is treated as an STS request.

Example handshake response

Connect to the WebSocket

Connect to the exact wsUrl returned by the handshake. Do not construct the URL manually when the response provides one. The current runtime instructs the client to send a start message after connection:
Your deployed WebSocket protocol can require additional agent or session fields. Follow the handshake response and deployed API specification.

Client responsibilities

A production STS client should handle:
  • WebSocket connection and reconnection;
  • authentication and session initialization;
  • binary audio framing;
  • supported sample rate and encoding;
  • microphone permission;
  • playback buffering;
  • interruption and barge-in;
  • server processing and error messages;
  • clean session completion;
  • network timeout and retry policy.
A real-time voice session is stateful. Do not reconnect repeatedly with different session identifiers or replay stale audio after the server has finalized the call.

Standalone Speech APIs

Standalone speech endpoints use an external speech key. They do not run an agent prompt, query an agent knowledge base, or maintain an agent conversation.

External key configuration

An external speech key stores its selected:
  • STT provider;
  • STT model;
  • TTS provider;
  • TTS voice or model;
  • individual credit limit;
  • used-credit total;
  • active status.
The secret is returned when the key is created. Store it immediately in a secret manager. External speech key formats include:
The shorter ext_api_... format is supported for compatibility.

Standalone Text-to-Speech

The endpoint synthesizes the supplied text using the provider and voice saved on the external speech key.

TTS parameters

The current external TTS request accepts text, language, and optional pace. The older documentation fields pitch and volume are not accepted by the current validation schema.
For Ganas voices, the saved voice determines the output language. Valuez can translate the supplied text to the saved voice language before synthesis. The request’s language field does not override the saved Ganas voice.

TTS response

The response is a binary attachment:
A provider can also return a compatible binary content type such as application/octet-stream.

TTS errors


Standalone Speech-to-Text

Upload an audio file and provide the required transcription language.
The language can be provided through the accepted query or body input used by your client.

STT parameters

Example STT response

STT errors


Generate an API Key

API keys are created from APIs and Integrations in the Valuez dashboard.

Generate an Agent API key

1

Open Integrations

Sign in to the Valuez dashboard and open APIs and Integrations, then Integrations.
2

Create an API integration

Choose the Agent API integration type.
3

Select an agent

Associate the key with the agent that should process external requests.
4

Configure permissions

Enable only the required modes: Text-to-Text, Speech-to-Text, Text-to-Speech, or Speech-to-Speech.
5

Set a credit limit

Apply an individual key limit when you need to restrict integration consumption. A configured no-limit value still remains subject to the account subscription and available credits.
6

Generate and store the key

Copy the generated secret into a secure server-side secret store.
7

Test the key

Start with a small synchronous Text-to-Text request before enabling voice or production traffic.

Generate an external speech key

1

Open external speech integration

Open the external STT/TTS integration configuration.
2

Name the key

Use a name that identifies the application and environment, such as CRM Production Speech.
3

Select STT configuration

Choose an active transcription provider and a model belonging to that provider.
4

Select TTS configuration

Choose an active voice provider and a compatible voice or model.
5

Set the credit limit

Use at least the configured minimum limit or the supported no-limit value.
6

Save the generated secret

The generated key is returned at creation. Store it immediately.
Updating an external key can preserve saved provider selections when those fields are omitted. Updating the configuration does not mean the secret will be displayed again.

API Usage Logs

The Valuez dashboard provides Speech API History for standalone STT and TTS requests. Authorized dashboard users can filter logs by:
  • external key;
  • date range;
  • action type;
  • search text;
  • page number and page size.
A log can include: Detailed log access and audio download require an authenticated dashboard session and appropriate authorization.
API history can contain customer text, transcripts, and audio. Apply workspace permissions, retention policies, and privacy controls.

Error Handling

Common HTTP statuses

Example JSON error

Some middleware errors use a message field instead:
Clients should safely read both errorMessage and message.

Retry guidance

Automatically retry only when:
  • the operation is safe to repeat;
  • the server returned a transient failure;
  • the client uses bounded exponential backoff;
  • the request is not already being processed.
Do not endlessly retry authentication, validation, permission, credit, or subscription errors.

Security Best Practices

Browser applications should call your own backend. Your backend should attach the Valuez API key and forward the authorized request.
Separate keys make revocation, credit limiting, monitoring, and incident investigation easier.
A text-only integration should not receive Speech-to-Speech permission.
A per-key limit reduces the impact of a faulty client or compromised credential.
Redact credentials in application logs. If identification is necessary, log a safe key name or internal UUID.
Disable or delete the exposed integration, create a replacement, update the trusted client, and review API history for misuse.
Session UUIDs can provide access to conversation context when combined with the correct key. Treat them as sensitive application data.
Check the HTTP status and Content-Type before saving a response as audio. A JSON error saved as .wav is not a valid audio file.

Production Checklist

Before enabling production traffic:
  • The key is stored in a secret manager.
  • Development and production use separate keys.
  • The key is associated with the correct agent or speech configuration.
  • Only required communication modes are enabled.
  • A suitable per-key credit limit is configured.
  • The account has an active subscription and sufficient credits.
  • Text-to-Text sync has been tested.
  • Streaming behavior has been tested if used.
  • Audio format and language have been tested.
  • Session continuation has been tested.
  • WebSocket reconnection has been tested for STS.
  • Errors and rate limits are handled safely.
  • Logs redact credentials and sensitive customer data.
  • Monitoring and key-rotation ownership are assigned.

Next Steps

Authentication

Understand dashboard sessions, workspace access, and external API authentication.

Integrations

Create Agent API and external speech integrations from the dashboard.

Agents

Configure the agent, knowledge base, voice, and transcriber used by an Agent API key.

API Logs

Review standalone STT and TTS requests, credits, transcripts, and audio history.