Phonic · AsyncAPI Specification
API Reference
Version 1.0.0
View Spec
View on GitHub
CompanyArtificial IntelligenceVoice AIConversational AISpeechVoice AgentsTelephonySpeech To SpeechAsyncAPIWebhooksEvents
Channels
/v1/sts/ws
publish
conversations-publishServer messages
Real-time speech-to-speech (STS) communication WebSocket API for Phonic's AI voice conversation platform. All connections require authentication using one of the following methods: #### Option 1: API Key (Server-side) Use your Phonic API key in the Authorization header: `Authorization: Bearer PHONIC_API_KEY` #### Option 2: Session Token (Client-side) For client-side applications where you don't want to expose your API key, first create a short-lived session token via the REST API: `POST /v1/auth/session_token` Then connect to the WebSocket with the session token as a query parameter: `wss://api.phonic.ai/v1/sts/ws?session_token=ph_session_abc123...`
Messages
✉
subpackage_conversations.conversations-server-0-ready_to_start_conversation
ready_to_start_conversation
✉
subpackage_conversations.conversations-server-1-conversation_created
conversation_created
✉
subpackage_conversations.conversations-server-2-input_text
input_text
✉
subpackage_conversations.conversations-server-3-input_cancelled
input_cancelled
✉
subpackage_conversations.conversations-server-4-audio_chunk
audio_chunk
✉
subpackage_conversations.conversations-server-5-user_started_speaking
user_started_speaking
✉
subpackage_conversations.conversations-server-6-user_finished_speaking
user_finished_speaking
✉
subpackage_conversations.conversations-server-7-assistant_started_speaking
assistant_started_speaking
✉
subpackage_conversations.conversations-server-8-assistant_finished_speaking
assistant_finished_speaking
✉
subpackage_conversations.conversations-server-9-dtmf
dtmf
✉
subpackage_conversations.conversations-server-10-tool_call
tool_call
✉
subpackage_conversations.conversations-server-11-tool_call_output_processed
tool_call_output_processed
✉
subpackage_conversations.conversations-server-12-tool_call_interrupted
tool_call_interrupted
✉
subpackage_conversations.conversations-server-13-assistant_chose_not_to_respond
assistant_chose_not_to_respond
✉
subpackage_conversations.conversations-server-14-assistant_ended_conversation
assistant_ended_conversation
✉
subpackage_conversations.conversations-server-15-error
error
✉
subpackage_conversations.conversations-server-16-warning
warning
✉
subpackage_conversations.conversations-client-0-config
config
✉
subpackage_conversations.conversations-client-1-audio_chunk
audio_chunk
✉
subpackage_conversations.conversations-client-2-update_system_prompt
update_system_prompt
✉
subpackage_conversations.conversations-client-3-add_system_message
add_system_message
✉
subpackage_conversations.conversations-client-4-update_tools_subset
update_tools_subset
✉
subpackage_conversations.conversations-client-5-set_external_id
set_external_id
✉
subpackage_conversations.conversations-client-6-tool_call_output
tool_call_output
✉
subpackage_conversations.conversations-client-7-unmute
unmute
✉
subpackage_conversations.conversations-client-8-mute
mute
✉
subpackage_conversations.conversations-client-9-generate_reply
generate_reply
✉
subpackage_conversations.conversations-client-10-say
say
✉
subpackage_conversations.conversations-client-11-reset
reset
Servers
wss
https://api.phonic.ai/v1
wss://api.phonic.ai/
AsyncAPI Specification
asyncapi: 2.6.0
info:
title: API Reference
version: 1.0.0
channels:
/v1/sts/ws:
description: >
Real-time speech-to-speech (STS) communication WebSocket API for Phonic's AI voice conversation platform.
All connections require authentication using one of the following methods:
#### Option 1: API Key (Server-side)
Use your Phonic API key in the Authorization header:
`Authorization: Bearer PHONIC_API_KEY`
#### Option 2: Session Token (Client-side)
For client-side applications where you don't want to expose your API key, first create a short-lived session token
via the REST API: `POST /v1/auth/session_token`
Then connect to the WebSocket with the session token as a query parameter:
`wss://api.phonic.ai/v1/sts/ws?session_token=ph_session_abc123...`
bindings:
ws:
headers:
type: object
properties:
Authorization:
type: string
publish:
operationId: conversations-publish
summary: Server messages
message:
oneOf:
- $ref: '#/components/messages/subpackage_conversations.conversations-server-0-ready_to_start_conversation'
- $ref: '#/components/messages/subpackage_conversations.conversations-server-1-conversation_created'
- $ref: '#/components/messages/subpackage_conversations.conversations-server-2-input_text'
- $ref: '#/components/messages/subpackage_conversations.conversations-server-3-input_cancelled'
- $ref: '#/components/messages/subpackage_conversations.conversations-server-4-audio_chunk '
- $ref: '#/components/messages/subpackage_conversations.conversations-server-5-user_started_speaking'
- $ref: '#/components/messages/subpackage_conversations.conversations-server-6-user_finished_speaking'
- $ref: '#/components/messages/subpackage_conversations.conversations-server-7-assistant_started_speaking'
- $ref: '#/components/messages/subpackage_conversations.conversations-server-8-assistant_finished_speaking'
- $ref: '#/components/messages/subpackage_conversations.conversations-server-9-dtmf'
- $ref: '#/components/messages/subpackage_conversations.conversations-server-10-tool_call'
- $ref: '#/components/messages/subpackage_conversations.conversations-server-11-tool_call_output_processed'
- $ref: '#/components/messages/subpackage_conversations.conversations-server-12-tool_call_interrupted'
- $ref: '#/components/messages/subpackage_conversations.conversations-server-13-assistant_chose_not_to_respond'
- $ref: '#/components/messages/subpackage_conversations.conversations-server-14-assistant_ended_conversation'
- $ref: '#/components/messages/subpackage_conversations.conversations-server-15-error'
- $ref: '#/components/messages/subpackage_conversations.conversations-server-16-warning'
subscribe:
operationId: conversations-subscribe
summary: Client messages
message:
oneOf:
- $ref: '#/components/messages/subpackage_conversations.conversations-client-0-config'
- $ref: '#/components/messages/subpackage_conversations.conversations-client-1-audio_chunk'
- $ref: '#/components/messages/subpackage_conversations.conversations-client-2-update_system_prompt'
- $ref: '#/components/messages/subpackage_conversations.conversations-client-3-add_system_message'
- $ref: '#/components/messages/subpackage_conversations.conversations-client-4-update_tools_subset'
- $ref: '#/components/messages/subpackage_conversations.conversations-client-5-set_external_id'
- $ref: '#/components/messages/subpackage_conversations.conversations-client-6-tool_call_output'
- $ref: '#/components/messages/subpackage_conversations.conversations-client-7-unmute'
- $ref: '#/components/messages/subpackage_conversations.conversations-client-8-mute'
- $ref: '#/components/messages/subpackage_conversations.conversations-client-9-generate_reply'
- $ref: '#/components/messages/subpackage_conversations.conversations-client-10-say'
- $ref: '#/components/messages/subpackage_conversations.conversations-client-11-reset'
servers:
https://api.phonic.ai/v1:
url: wss://api.phonic.ai/
protocol: wss
x-default: true
components:
messages:
subpackage_conversations.conversations-server-0-ready_to_start_conversation:
name: ready_to_start_conversation
title: ready_to_start_conversation
description: Server indicates readiness to start conversation
payload:
$ref: '#/components/schemas/sts_readyToStartConversation'
subpackage_conversations.conversations-server-1-conversation_created:
name: conversation_created
title: conversation_created
description: Conversation has been created in database
payload:
$ref: '#/components/schemas/sts_conversationCreated'
subpackage_conversations.conversations-server-2-input_text:
name: input_text
title: input_text
description: Transcribed user speech text
payload:
$ref: '#/components/schemas/sts_inputText'
subpackage_conversations.conversations-server-3-input_cancelled:
name: input_cancelled
title: input_cancelled
description: User input was cancelled (no speech detected)
payload:
$ref: '#/components/schemas/sts_inputCancelled'
'subpackage_conversations.conversations-server-4-audio_chunk ':
name: 'audio_chunk '
title: 'audio_chunk '
description: AI-generated audio chunk with text
payload:
$ref: '#/components/schemas/sts_audioChunkResponse'
subpackage_conversations.conversations-server-5-user_started_speaking:
name: user_started_speaking
title: user_started_speaking
description: User started speaking
payload:
$ref: '#/components/schemas/sts_userStartedSpeaking'
subpackage_conversations.conversations-server-6-user_finished_speaking:
name: user_finished_speaking
title: user_finished_speaking
description: User finished speaking
payload:
$ref: '#/components/schemas/sts_userFinishedSpeaking'
subpackage_conversations.conversations-server-7-assistant_started_speaking:
name: assistant_started_speaking
title: assistant_started_speaking
description: Assistant started speaking
payload:
$ref: '#/components/schemas/sts_assistantStartedSpeaking'
subpackage_conversations.conversations-server-8-assistant_finished_speaking:
name: assistant_finished_speaking
title: assistant_finished_speaking
description: Assistant finished speaking (Not sent if interrupted by `user_started_speaking`)
payload:
$ref: '#/components/schemas/sts_assistantFinishedSpeaking'
subpackage_conversations.conversations-server-9-dtmf:
name: dtmf
title: dtmf
description: DTMF tone for phone calls
payload:
$ref: '#/components/schemas/sts_dtmf'
subpackage_conversations.conversations-server-10-tool_call:
name: tool_call
title: tool_call
description: WebSocket tool call requiring client-side execution
payload:
$ref: '#/components/schemas/sts_toolCall'
subpackage_conversations.conversations-server-11-tool_call_output_processed:
name: tool_call_output_processed
title: tool_call_output_processed
description: Tool call has been processed and completed
payload:
$ref: '#/components/schemas/sts_toolCallOutputProcessed'
subpackage_conversations.conversations-server-12-tool_call_interrupted:
name: tool_call_interrupted
title: tool_call_interrupted
description: Tool call was interrupted before completion
payload:
$ref: '#/components/schemas/sts_toolCallInterrupted'
subpackage_conversations.conversations-server-13-assistant_chose_not_to_respond:
name: assistant_chose_not_to_respond
title: assistant_chose_not_to_respond
description: AI chose not to respond to user input
payload:
$ref: '#/components/schemas/sts_assistantChoseNotToRespond'
subpackage_conversations.conversations-server-14-assistant_ended_conversation:
name: assistant_ended_conversation
title: assistant_ended_conversation
description: AI ended the conversation
payload:
$ref: '#/components/schemas/sts_assistantEndedConversation'
subpackage_conversations.conversations-server-15-error:
name: error
title: error
description: Error occurred during conversation
payload:
$ref: '#/components/schemas/sts_error'
subpackage_conversations.conversations-server-16-warning:
name: warning
title: warning
description: Non-fatal warning about conversation configuration or state
payload:
$ref: '#/components/schemas/sts_warning'
subpackage_conversations.conversations-client-0-config:
name: config
title: config
description: Initialize conversation with configuration parameters
payload:
$ref: '#/components/schemas/sts_config'
subpackage_conversations.conversations-client-1-audio_chunk:
name: audio_chunk
title: audio_chunk
description: Send audio chunk for real-time voice input
payload:
$ref: '#/components/schemas/sts_audioChunk'
subpackage_conversations.conversations-client-2-update_system_prompt:
name: update_system_prompt
title: update_system_prompt
description: >-
Update system prompt mid-conversation. This message is deprecated. Using `add_system_message` is recommended
instead.
payload:
$ref: '#/components/schemas/sts_updateSystemPrompt'
subpackage_conversations.conversations-client-3-add_system_message:
name: add_system_message
title: add_system_message
description: Add system message mid-conversation
payload:
$ref: '#/components/schemas/sts_addSystemMessage'
subpackage_conversations.conversations-client-4-update_tools_subset:
name: update_tools_subset
title: update_tools_subset
description: Update the subset of tools available to the assistant mid-conversation
payload:
$ref: '#/components/schemas/sts_updateToolsSubset'
subpackage_conversations.conversations-client-5-set_external_id:
name: set_external_id
title: set_external_id
description: Set external ID for conversation tracking
payload:
$ref: '#/components/schemas/sts_setExternalId'
subpackage_conversations.conversations-client-6-tool_call_output:
name: tool_call_output
title: tool_call_output
description: Respond to WebSocket tool call with output
payload:
$ref: '#/components/schemas/sts_toolCallOutput'
subpackage_conversations.conversations-client-7-unmute:
name: unmute
title: unmute
description: Only for push to talk. Interrupts the assistant and turns on listening
payload:
$ref: '#/components/schemas/sts_unmute'
subpackage_conversations.conversations-client-8-mute:
name: mute
title: mute
description: Only for push to talk. Turns off listening and starts assistant reply
payload:
$ref: '#/components/schemas/sts_mute'
subpackage_conversations.conversations-client-9-generate_reply:
name: generate_reply
title: generate_reply
description: Trigger the assistant to generate a reply, optionally with a system message
payload:
$ref: '#/components/schemas/sts_generateReply'
subpackage_conversations.conversations-client-10-say:
name: say
title: say
description: Trigger the assistant to say some text, optionally can be configured to make the turn uninterruptible
payload:
$ref: '#/components/schemas/sts_say'
subpackage_conversations.conversations-client-11-reset:
name: reset
title: reset
description: >
Soft-reset the conversation mid-stream, clearing the agent's conversation memory and allowing for a new system
prompt, tools, etc.
payload:
$ref: '#/components/schemas/sts_reset'
schemas:
sts_readyToStartConversation:
type: object
properties:
type:
type: string
enum:
- ready_to_start_conversation
required:
- type
title: sts_readyToStartConversation
sts_conversationCreated:
type: object
properties:
type:
type: string
enum:
- conversation_created
conversation_id:
type: string
description: ID of the created conversation
required:
- type
- conversation_id
title: sts_conversationCreated
sts_inputText:
type: object
properties:
type:
type: string
enum:
- input_text
language:
type: string
description: Detected ISO 639-1 language code of user speech
text:
type: string
description: Transcribed user speech
required:
- type
- language
- text
title: sts_inputText
sts_inputCancelled:
type: object
properties:
type:
type: string
enum:
- input_cancelled
required:
- type
title: sts_inputCancelled
sts_audioChunkResponse:
type: object
properties:
type:
type: string
enum:
- audio_chunk
audio:
type: string
description: Base64-encoded AI audio data
text:
type: string
description: Text corresponding to audio chunk
timings:
type: object
additionalProperties:
type: number
format: double
description: >-
Optional latency-breakdown metrics for the audio chunk, expressed as named millisecond durations. Only
present on the first audio chunk of a turn.
required:
- type
- audio
- text
title: sts_audioChunkResponse
sts_userStartedSpeaking:
type: object
properties:
type:
type: string
enum:
- user_started_speaking
required:
- type
title: sts_userStartedSpeaking
sts_userFinishedSpeaking:
type: object
properties:
type:
type: string
enum:
- user_finished_speaking
required:
- type
title: sts_userFinishedSpeaking
sts_assistantStartedSpeaking:
type: object
properties:
type:
type: string
enum:
- assistant_started_speaking
required:
- type
title: sts_assistantStartedSpeaking
sts_assistantFinishedSpeaking:
type: object
properties:
type:
type: string
enum:
- assistant_finished_speaking
required:
- type
title: sts_assistantFinishedSpeaking
sts_dtmf:
type: object
properties:
type:
type: string
enum:
- dtmf
digits:
type: string
description: DTMF digits to play
timings:
type: object
additionalProperties:
type: number
format: double
description: Optional latency-breakdown metrics for the message, expressed as named millisecond durations.
required:
- type
- digits
title: sts_dtmf
sts_toolCall:
type: object
properties:
type:
type: string
enum:
- tool_call
tool_call_id:
type: string
description: Unique ID for this tool call
tool_name:
type: string
description: Name of the tool to execute
parameters:
type: object
additionalProperties:
description: Any type
description: Parameters for tool execution
required:
- type
- tool_call_id
- tool_name
- parameters
title: sts_toolCall
ChannelsStsMessagesToolCallOutputProcessedTool:
type: object
properties:
id:
type: string
description: Tool ID
name:
type: string
description: Human-readable tool name
required:
- id
- name
title: ChannelsStsMessagesToolCallOutputProcessedTool
sts_toolCallOutputProcessed:
type: object
properties:
type:
type: string
enum:
- tool_call_output_processed
tool_call_id:
type: string
description: ID of the completed tool call
tool:
$ref: '#/components/schemas/ChannelsStsMessagesToolCallOutputProcessedTool'
tool_config:
type:
- object
- 'null'
additionalProperties:
description: Any type
description: Configuration of the tool that was called
endpoint_method:
type:
- string
- 'null'
description: HTTP method used for webhook endpoint (null for WebSocket tools)
endpoint_url:
type:
- string
- 'null'
description: Webhook endpoint URL (null for WebSocket tools)
endpoint_timeout_ms:
type:
- integer
- 'null'
description: Webhook timeout in milliseconds (null for WebSocket tools)
endpoint_called_at:
type:
- string
- 'null'
format: date-time
description: When webhook was called (null for WebSocket tools)
query_params:
type:
- object
- 'null'
additionalProperties:
type: string
description: Query string parameters sent to webhook endpoint (null for WebSocket tools)
request_body:
type:
- object
- 'null'
additionalProperties:
description: Any type
description: Webhook request body (null for WebSocket tools)
response_body:
oneOf:
- description: Any type
- type: 'null'
description: Webhook response body (null for WebSocket tools)
parameters:
type:
- object
- 'null'
additionalProperties:
description: Any type
description: WebSocket tool parameters (null for webhook tools)
output:
oneOf:
- description: Any type
- type: 'null'
description: WebSocket tool output (null for webhook tools)
response_status_code:
type:
- integer
- 'null'
description: Webhook HTTP status code (null for WebSocket tools)
duration_ms:
type:
- number
- 'null'
format: double
description: Duration of the tool call in milliseconds
timed_out:
type:
- boolean
- 'null'
description: Whether the tool call timed out
error_message:
type:
- string
- 'null'
description: Error message if tool call failed
required:
- type
- tool_call_id
- tool
title: sts_toolCallOutputProcessed
sts_toolCallInterrupted:
type: object
properties:
type:
type: string
enum:
- tool_call_interrupted
tool_call_id:
type: string
description: ID of the interrupted tool call
tool_name:
type: string
description: Name of the interrupted tool
required:
- type
- tool_call_id
- tool_name
title: sts_toolCallInterrupted
sts_assistantChoseNotToRespond:
type: object
properties:
type:
type: string
enum:
- assistant_chose_not_to_respond
required:
- type
title: sts_assistantChoseNotToRespond
sts_assistantEndedConversation:
type: object
properties:
type:
type: string
enum:
- assistant_ended_conversation
required:
- type
title: sts_assistantEndedConversation
ChannelsStsMessagesErrorError:
type: object
properties:
message:
type: string
description: Error message
code:
type: string
description: Error code
required:
- message
title: ChannelsStsMessagesErrorError
sts_error:
type: object
properties:
type:
type: string
enum:
- error
error:
$ref: '#/components/schemas/ChannelsStsMessagesErrorError'
param_errors:
type: object
additionalProperties:
type: string
description: Parameter-specific validation errors
required:
- type
- error
title: sts_error
ChannelsStsMessagesWarningWarning:
type: object
properties:
message:
type: string
description: Warning message
code:
type: string
description: Warning code
required:
- message
title: ChannelsStsMessagesWarningWarning
sts_warning:
type: object
properties:
type:
type: string
enum:
- warning
warning:
$ref: '#/components/schemas/ChannelsStsMessagesWarningWarning'
required:
- type
- warning
title: sts_warning
ChannelsStsMessagesConfigModel:
type: string
enum:
- merritt
default: merritt
description: STS model to use
title: ChannelsStsMessagesConfigModel
ChannelsStsMessagesConfigBackgroundNoise:
type: string
enum:
- office
- call-center
- coffee-shop
description: Background noise type for the conversation
title: ChannelsStsMessagesConfigBackgroundNoise
ChannelsStsMessagesConfigInputFormat:
type: string
enum:
- pcm_44100
- pcm_24000
- pcm_16000
- pcm_8000
- mulaw_8000
default: pcm_44100
description: Audio input format
title: ChannelsStsMessagesConfigInputFormat
ChannelsStsMessagesConfigOutputFormat:
type: string
enum:
- pcm_44100
- pcm_24000
- pcm_16000
- pcm_8000
- mulaw_8000
default: pcm_44100
description: Audio output format
title: ChannelsStsMessagesConfigOutputFormat
ChannelsStsMessagesConfigMultilingualMode:
type: string
enum:
- auto
- request
- initial
default: request
description: >-
If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user
must request to change language (recommended). If `"initial"` the first turn user audio determines the language
for the rest of the conversation.
title: ChannelsStsMessagesConfigMultilingualMode
ChannelsStsMessagesConfigIntelligenceLevel:
type: string
enum:
- standard
- high
default: standard
description: >-
The intelligence level of the agent. `high` uses a more capable model for more complex reasoning, while
`standard` is optimized for lower latency.
title: ChannelsStsMessagesConfigIntelligenceLevel
ChannelsStsMessagesConfigPronunciationDictionaryItems:
type: object
properties:
word:
type: string
pronunciation:
type: string
required:
- word
- pronunciation
title: ChannelsStsMessagesConfigPronunciationDictionaryItems
ToolName:
type: string
description: Name of a pre-defined tool or built-in tool available to the assistant.
title: ToolName
BuiltInToolDefinitionName:
type: string
enum:
- keypad_input
- natural_conversation_ending
description: The name of the built-in tool.
title: BuiltInToolDefinitionName
BuiltInToolConfigSpeechBeforeToolCall:
type: string
enum:
- required
- optional
- suppressed
description: >-
Controls whether the assistant speaks before the tool is called. `required`: the assistant must speak first.
`optional`: the model decides. `suppressed`: the assistant is strongly instructed to stay silent before the call
(best effort).
title: BuiltInToolConfigSpeechBeforeToolCall
BuiltInToolConfig:
type: object
properties:
speech_before_tool_call:
$ref: '#/components/schemas/BuiltInToolConfigSpeechBeforeToolCall'
description: >-
Controls whether the assistant speaks before the tool is called. `required`: the assistant must speak first.
`optional`: the model decides. `suppressed`: the assistant is strongly instructed to stay silent before the
call (best effort).
required:
- speech_before_tool_call
description: >-
Configuration for a simple built-in tool (`keypad_input`, `natural_conversation_ending`, or
`choose_not_to_respond`).
title: BuiltInToolConfig
BuiltInToolDefinition:
type: object
properties:
type:
type: string
enum:
- built_in
name:
$ref: '#/components/schemas/BuiltInToolDefinitionName'
description: The name of the built-in tool.
tool_config:
$ref: '#/components/schemas/BuiltInToolConfig'
required:
- type
- name
- tool_config
description: >-
A built-in tool with an explicit configuration, as an alternative to referencing it by bare name (which uses the
tool's default configuration). Only `keypad_input` and `natural_conversation_ending` accept configuration this
way.
title: BuiltInToolDefinition
OpenAIFunctionParameters:
type: object
additionalProperties:
description: Any type
description: JSON Schema object describing the tool parameters. This follows OpenAI's function tool `parameters` field.
title: OpenAIFunctionParameters
OpenAIFunction:
type: object
properties:
name:
type: string
description: Function name the assistant will use in `tool_call.tool_name`.
description:
type: string
description: Description of what the tool does and when to call it.
parameters:
$ref: '#/components/schemas/OpenAIFunctionParameters'
strict:
type: boolean
enum:
- true
description: Inline tools require strict function calling.
required:
- name
- description
- parameters
- strict
title: OpenAIFunction
OpenAITool:
type: object
properties:
type:
type: string
enum:
- function
function:
$ref: '#/components/schemas/OpenAIFunction'
required:
- type
- function
description: OpenAI-compatible function tool schema.
title: OpenAITool
InlineWebSocketToolExecutionMode:
type: string
enum:
- sync
- async
default: sync
description: Whether the assistant waits for the tool output before continuing.
title: InlineWebSocketToolExecutionMode
InlineWebSocketTool:
type: object
properties:
type:
type: string
enum:
- custom_websocket
tool_schema:
$ref: '#/components/schemas/OpenAITool'
execution_mode:
$ref: '#/components/schemas/InlineWebSocketToolExecutionMode'
default: sync
description: Whether the assistant waits for the tool output before continuing.
tool_call_output_timeout_ms:
type: integer
default: 5000
description: Timeout in milliseconds for the client to send a `tool_call_output` message.
require_speech_before_tool_call:
type: boolean
default: false
description: When true, forces the assistant to speak before executing the tool.
wait_for_speech_before_tool_call:
type: boolean
default: false
description: When true, waits for the assistant's speech to finish before sending the tool call.
forbid_speech_after_tool_call:
type: boolean
default: false
description: When true, prevents the assistant from speaking after executing the tool.
allow_tool_chaining:
type: boolean
default: true
description: When true, allows the assistant to call another tool after this tool.
wait_for_response:
type: boolean
default: false
description: For async tools, when true, the assistant waits for the response and speaks when it arrives.
required:
- type
- tool_schema
description: >-
Inline WebSocket tool definition for this conversation. Inline tools are not persisted to your workspace; they
are executed by your connected WebSocket application when Phonic sends a `tool_call` message.
title: InlineWebSocketTool
ToolDefinition:
oneOf:
- $ref: '#/components/schemas/ToolName'
- $ref: '#/components/schemas/BuiltInToolDefinition'
- $ref: '#/components/schemas/InlineWebSocketTool'
title: ToolDefinition
ChannelsStsMessagesConfigObservabilityIntegrationsItems:
type: string
enum:
- braintrust
title: ChannelsStsMessagesConfigObservabilityIntegrationsItems
ChannelsStsMessagesConfigTasksItems:
type: object
properties:
name:
type: string
description: Name of the task.
description:
type: string
description: Description of the task.
required:
- name
- description
title: ChannelsStsMessagesConfigTasksItems
ChannelsStsMessagesConfigOutboundNumberPool:
type: object
properties:
active:
type: array
items:
type: string
description: Active E.164 phone numbers to use for outbound calls. Numbers must be unique.
blocked:
type: array
items:
type: string
description: Blocked E.164 phone numbers that should not be used for outbound calls.
required:
- active
- blocked
description: Pool of phone numbers to use as the caller ID for outbound calls.
title: ChannelsStsMessagesConfigOutboundNumberPool
ChannelsStsMessagesConfigConfigurationEndpoint:
type: object
properties:
url:
type: string
description: URL to call.
headers:
type: object
additionalProperties:
type: string
description: Object of key-value pairs sent as headers when calling the endpoint.
timeout_ms:
type: integer
default: 3000
description: Timeout in milliseconds for the endpoint call.
required:
- url
description: When not `null`, the agent will call this endpoint to get configuration options for the conversation.
title: ChannelsStsMessagesConfigConfigurationEndpoint
ChannelsStsMessagesConfigDataRetentionPolicy0:
type: object
properties:
zero_data_retention:
type: boolean
description: When `true`, no transcripts or audio recordings are retained.
required:
- zero_data_retention
description: Zero data retention mode. No transcripts or audio recordings are retained.
title: ChannelsStsMessagesConfigDataRetentionPolicy0
ChannelsStsMessagesConfigDataRetentionPolicyOneOf1Transcripts:
type: object
properties:
delete_after_hours:
type:
- integer
- 'null'
description: Number of hours after which transcripts are deleted. When `null`, transcripts are retained indefinitely.
required:
- delete_after_hours
title: ChannelsStsMessagesConfigDataRetentionPolicyOneOf1Transcripts
# --- truncated at 32 KB (62 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/phonic/refs/heads/main/asyncapi/phonic-sts-asyncapi-original.yaml