Appearance
Voice
17 operations. Paths are relative to https://api.frege.io.
Show the environment's speech vendors
GET/v1/projects/{id}/voice
Every speech vendor the voice worker can drive, whether this environment has an account connected for it, and which vendor and model it speaks and listens with by default. A credential is never returned — only a hint (the last characters of a key, or a service account's email) to tell accounts apart. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
List the environment's voice calls
GET/v1/projects/{id}/voice/calls
The voice sessions opened in this environment — from the dashboard, a widget or Telegram — newest first, one page at a time. started_at, ended_at and duration_seconds come from LiveKit and stay empty until it reports them; a call with no agent_joined_at is one the voice worker never answered. Paginated by page/page_size like every other listing in this API, or by limit/offset. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
page | query | integer | Page to return, 1-based (default 1) |
page_size | query | integer | Rows per page (default 50, max 200) |
sort | query | string | Order: created_at, also accepted with a leading - for descending (default -created_at) |
limit | query | integer | Max calls per window (max 200); with offset, instead of page/page_size |
offset | query | integer | Calls to skip (default 0) |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 422 | Unprocessable Entity | error envelope |
One voice call, turn by turn
GET/v1/projects/{id}/voice/calls/{callID}
The call as listed, plus its conversation: each turn's words as speech-to-text heard them, the agent's answer, the tools it called, the model and tokens. A call that never reached a turn has none. The newest 200 turns at most. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
callID (required) | path | integer | Call ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
The environment's phone numbers
GET/v1/projects/{id}/voice/numbers
Every number that reaches this environment, oldest first, with the route its calls take: virtual lines (reached from the dashboard and tests, never the phone network) and the numbers of the environment's own SIP trunks. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
Add a phone number
POST/v1/projects/{id}/voice/numbers
With buy, Frege buys that number, on sale through its carrier account (GET .../numbers/available), for this environment, at the carrier's price; with trunk_id, number is one of that trunk's numbers, which the trunk then may call; with neither, Frege picks a virtual line ("*7" and six digits). route says which agent answers, when (hours in a time zone, and where calls go after hours: another agent, or a spoken message and hang up), and whether a caller proves the customer their number suggests with a code sent by SMS. 409 phone_number_taken when any environment has the number. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.voiceNumberRequest.
| Field | Type | Description |
|---|---|---|
buy | string | Buy is a number on sale through Frege, as GET .../numbers/available answered it, bought for this environment; Country is the one it was found in. |
country | string | |
number | string | |
route | api.voiceRoute | |
trunk_id | integer | TrunkID adds the trunk's number; with neither, Frege picks a virtual line. |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Created | data |
| 404 | Not Found | error envelope |
| 409 | Conflict | error envelope |
| 422 | Unprocessable Entity | error envelope |
| 503 | Service Unavailable | error envelope |
One phone number
GET/v1/projects/{id}/voice/numbers/{numberID}
The number and its route. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
numberID (required) | path | integer | Number ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
Remove a phone number
DELETE/v1/projects/{id}/voice/numbers/{numberID}
The number stops reaching this environment at once; a trunk's number is taken off what the trunk may call. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
numberID (required) | path | integer | Number ID |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | No Content | |
| 404 | Not Found | error envelope |
Change where a number's calls go
PUT/v1/projects/{id}/voice/numbers/{numberID}/route
Replaces the number's route; the next call takes it. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
numberID (required) | path | integer | Number ID |
Request body (application/json)
Schema: api.voiceRoute.
| Field | Type | Description |
|---|---|---|
after_hours | api.voiceDestination | |
agent_id | string | |
hours | api.voiceHours | |
proof | string | One of: sms, none. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
Call a virtual line from the dashboard
POST/v1/projects/{id}/voice/numbers/{numberID}/test-call
Calls one of the environment's virtual lines as the phone network would, from the number in from (a customer's, to try how a caller is recognised; empty for none): the call takes the line's route, and Frege's voice worker joins it. Answers the LiveKit room to join from the browser, and, when the route asks the caller to prove who they are, the code that would have been texted to them, shown here instead. 422 for a number that is not a virtual line, 503 when live voice is not configured. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
numberID (required) | path | integer | Number ID |
Request body (application/json)
Schema: api.voiceTestCallRequest.
| Field | Type | Description |
|---|---|---|
from | string | From is the number the call comes from: a customer's, to try how a caller is recognised; empty for none. |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Created | data |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
| 503 | Service Unavailable | error envelope |
Phone numbers on sale through Frege
GET/v1/projects/{id}/voice/numbers/available
Numbers Frege can buy for this environment through its carrier account, in a country (ISO 3166-1 alpha-2, like US) and optionally containing some digits (an area code), at the carrier's price: a number costs what the carrier charges, with no margin. At most 50, 20 unless limit says. 503 when the deployment has no carrier. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
country (required) | query | string | Country, like US |
contains | query | string | Digits the number contains |
limit | query | integer | How many, at most 50 |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 422 | Unprocessable Entity | error envelope |
| 503 | Service Unavailable | error envelope |
Hear a voice before choosing it
POST/v1/projects/{id}/voice/preview
Speaks a short text with one of Frege's own speech models and one of its voices, through the deployment's gateway on the project's key, and answers with the audio: MP3 (audio/mpeg), or WAV (audio/wav) from a model that speaks only raw PCM, such as Gemini's. Without text it reads a sample line in language (en, ru or uz; en otherwise). speed paces it as the agent's speaking speed would pace a call. Recorded as usage of kind voice_tts. At most 300 characters. Organization admin or a manager of the environment. 409 when Frege's own voice is not offered, 402 when the organization's billing is suspended, 502 when the gateway fails.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.voicePreviewRequest.
| Field | Type | Description |
|---|---|---|
language | string | |
speed | number | Speed paces it, as a call would be: 0.5 to 2, 1 by default. |
text | string | |
tts | string | |
voice | string |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | |
| 402 | Payment Required | |
| 409 | Conflict | |
| 422 | Unprocessable Entity | |
| 502 | Bad Gateway |
Choose the environment's default speech vendors
PUT/v1/projects/{id}/voice/settings
Each choice is "provider/model" — "deepgram/nova-3", "elevenlabs/eleven_flash_v2_5" — or empty for none. The vendor must be connected in this environment and able to do that job. An agent can still choose its own in config.voice.stt / config.voice.tts, or a text-to-speech vendor in tts_model. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.voiceSettingsRequest.
| Field | Type | Description |
|---|---|---|
stt | string | |
tts | string |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 422 | Unprocessable Entity | error envelope |
The environment's SIP trunks
GET/v1/projects/{id}/voice/trunks
The trunks members point their own carriers' numbers at, oldest first; a trunk's password is never answered here. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
Create a SIP trunk
POST/v1/projects/{id}/voice/trunks
A trunk for the member's own carrier: point its calls at sip_address and sign them with username and password, answered only here; or, with allowed_addresses, its calls are admitted by the carrier's public IPs and there is no password. 503 when this deployment has no SIP bridge. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.voiceTrunkRequest.
| Field | Type | Description |
|---|---|---|
allowed_addresses | string[] | AllowedAddresses, for a carrier that answers no password challenge: its public IPs or networks, at most 10. |
name | string |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Created | data |
| 422 | Unprocessable Entity | error envelope |
| 503 | Service Unavailable | error envelope |
Remove a SIP trunk
DELETE/v1/projects/{id}/voice/trunks/{trunkID}
The trunk's numbers go with it and its calls are refused at once. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
trunkID (required) | path | integer | Trunk ID |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | No Content | |
| 404 | Not Found | error envelope |
Connect a speech vendor account to the environment
PUT/v1/projects/{id}/voice/vendors/{provider}
Stores the vendor's credential encrypted, replacing any this environment already had for that vendor. Deepgram, ElevenLabs, OpenAI and Cartesia take api_key; Google Cloud takes service_account_json, the service account key file's contents. The credential is never shown again. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
provider (required) | path | string | Vendor One of: deepgram, elevenlabs, openai, cartesia, google. |
Request body (application/json)
Schema: api.connectVoiceVendorRequest.
| Field | Type | Description |
|---|---|---|
api_key | string | |
service_account_json | string |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
Disconnect a speech vendor account
DELETE/v1/projects/{id}/voice/vendors/{provider}
Deletes the stored credential. Refused (409) while the environment's default speech-to-text or text-to-speech still names this vendor; choose another first. Agents that name the vendor themselves stop connecting until they are changed. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
provider (required) | path | string | Vendor |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 409 | Conflict | error envelope |