openapi: "3.1.0" info: title: "Gabber API Reference" version: "1.0.0" description: "The Gabber API is a set of APIs that allow you to interact with the Gabber platform." tags: - name: Usage - name: Realtime - name: Session - name: Inference x-displayName: Inference + Completions - name: Voice - name: Scenario - name: Persona - name: LLM - name: Credit - name: Webhook components: securitySchemes: ApiKeyAuth: type: apiKey in: header name: x-api-key BearerAuth: type: http name: UsageToken bearer auth description: "Usage token authentication. Used from the client side with a token generated by the POST/v1/usage/token" scheme: bearer bearerFormat: JWT schemas: # SDK SDKSessionTranscription: type: object required: - id - agent - final - created_at - speaking_ended_at - text properties: id: type: string agent: type: boolean final: type: boolean created_at: type: string format: date-time speaking_ended_at: type: string format: date-time text: type: string tool_calls: type: array items: $ref: "#/components/schemas/ContextMessageToolCall" SDKConnectOptions: oneOf: - type: object required: - connection_details properties: connection_details: $ref: "#/components/schemas/RealtimeSessionConnectionDetails" - type: object required: - token - config properties: token: type: string config: $ref: "#/components/schemas/RealtimeSessionConfigCreate" SDKSendChatMessageParams: type: object properties: text: type: string SDKConnectionState: type: string enum: - not_connected - connecting - waiting_for_agent - connected SDKAgentState: type: string enum: - warmup - listening - thinking - speaking - time_limit_exceeded - usage_limit_exceeded # Personas Persona: type: object properties: created_at: type: string format: date-time description: type: string id: type: string image_url: type: string nullable: true name: type: string project: type: string human: type: string nullable: true gender: type: string enum: - male - female nullable: true tags: type: array items: type: object properties: human_name: type: string name: type: string required: - human_name - name voice: type: string required: - created_at - description - id - name - project - voice CreatePersonaRequest: type: object properties: description: type: string image_url: type: string name: type: string gender: type: string enum: - male - female voice: type: string required: - description - name - voice UpdatePersonaRequest: type: object properties: description: type: string image_url: type: string nullable: true name: type: string gender: type: string enum: - male - female nullable: true voice: type: string # Scenarios Scenario: type: object properties: created_at: type: string format: date-time id: type: string name: type: string project: type: string prompt: type: string human: type: string nullable: true required: - created_at - id - name - project - prompt CreateScenarioRequest: type: object properties: name: type: string project: type: string prompt: type: string required: - name - project - prompt UpdateScenarioRequest: type: object properties: name: type: string project: type: string prompt: type: string # Usage Usage: type: object required: - id - type - value - project properties: id: type: string type: $ref: "#/components/schemas/UsageType" value: type: number human: type: string project: type: string metadata: type: object additionalProperties: true UsageTokenRequest: type: object required: - limits - human_id properties: limits: $ref: "#/components/schemas/UsageLimits" human_id: description: "The ID of the human that the token is for. (this is typically your user id from your system)" type: string UsageLimits: type: array items: type: object required: - type - value properties: type: $ref: "#/components/schemas/UsageType" value: type: number UsageType: type: string enum: - conversational_seconds - voice_synthesis_seconds - token_cnt UpdateUsageLimitsRequest: type: object required: - limits - human_id properties: limits: $ref: "#/components/schemas/UsageLimits" human_id: description: "The ID of the human that the token is for. (this is typically your user id from your system)" type: string # Human HumanDataType: type: string enum: - phone_number HumanData: type: object required: - id - created_at - human - project - type - value properties: id: type: string created_at: type: string format: date-time human: type: string project: type: string type: $ref: "#/components/schemas/HumanDataType" value: type: string # Voice Voice: type: object properties: created_at: type: string format: date-time id: type: string name: type: string language: type: string service: type: string nullable: true model: type: string nullable: true voice: type: string nullable: true embeddings: type: array nullable: true items: type: number cartesia_voice_id: type: string nullable: true elevenlabs_voice_id: type: string nullable: true project: type: string nullable: true human: type: string nullable: true preview_url: type: string nullable: true _extra: type: object description: Extra configuration for the voice. Usually this is for internal purposes. additionalProperties: true required: - created_at - id - name - language UpdateVoiceRequest: type: object required: - name - language properties: name: type: string language: description: "The language of the voice" type: string # Credit Credit: type: object properties: created_at: type: string description: The date and time the credit was created. format: date-time id: type: string description: The unique identifier of the credit. project: type: string description: The project the credit belongs to. name: type: string description: The name of the credit. description: type: string description: The description of the credit. allow_negative_balance: type: boolean description: Whether the credit can have a negative balance. required: - created_at - id - name - project - description - allow_negative_balance CreateCreditRequest: type: object properties: name: type: string description: The name of the credit. description: type: string description: The description of the credit. allow_negative_balance: type: boolean description: Whether the credit can have a negative balance. required: - created_at - id - name - project - description - allow_negative_balance CreditLedgerEntry: type: object properties: created_at: type: string format: date-time id: type: string credit: type: string human: type: string amount: type: integer balance: type: integer idempotency_key: type: string decsription: Set this to dedupe credit charges. Should be something unique to the charge. required: - created_at - id - credit - human - amount - balance - idempotency_key CreateCreditLedgerEntryRequest: type: object properties: amount: type: integer idempotency_key: type: string decsription: Set this to dedupe credit charges. Should be something unique to the charge. required: - amount - idempotency_key # LLM LLM: type: object properties: created_at: type: string format: date-time id: type: string name: type: string project: type: string nullable: true type: type: string compliance: type: boolean description: type: string required: - created_at - id - name - type - compliance - description Context: type: object required: - id - created_at - project properties: id: type: string created_at: type: string format: date-time project: type: string human: type: string ContextCreateRequest: type: object required: - id - created_at properties: persona: type: string scenario: type: string messages: type: array items: $ref: "#/components/schemas/ContextMessageCreateParams" ContextMessageToolCallFunction: type: object required: - name - arguments properties: name: type: string arguments: type: object additionalProperties: true decsription: named arguments for the function call ContextMessageToolCall: type: object required: - id - type - function properties: id: type: string type: type: string enum: - function - gabber_tool function: $ref: "#/components/schemas/ContextMessageToolCallFunction" ContextMessageCreateParams: type: object required: - role - content properties: speaking_ended_at: type: string format: date-time speaking_started_at: type: string format: date-time role: type: string enum: - assistant - system - user - tool content: type: string tool_calls: type: array items: $ref: "#/components/schemas/ContextMessageToolCall" ContextMessageContentText: type: object required: - type properties: type: type: string enum: - text text: type: string ContextMessageContent: oneOf: - $ref: "#/components/schemas/ContextMessageContentText" ContextMessage: type: object required: - id - created_at - role - content properties: id: type: string speaking_ended_at: type: string format: date-time speaking_started_at: type: string format: date-time created_at: type: string format: date-time role: type: string enum: - assistant - system - user - tool realtime_session: type: string content: type: array items: $ref: "#/components/schemas/ContextMessageContent" tool_calls: type: array items: $ref: "#/components/schemas/ContextMessageToolCall" # Realtime RealtimeSessionDataType: type: string enum: - caller_phone_number - agent_phone_number RealtimeSessionData: type: object required: - type - value properties: type: type: string enum: - caller_phone_number - agent_phone_number value: type: string RealtimeSession: type: object required: - id - config - project - state - created_at - simulated - data properties: id: type: string description: The unique identifier of the RealtimeSession. state: type: string enum: - ended - in_progress - not_started description: The current state of the RealtimeSession. created_at: type: string format: date-time description: The time the RealtimeSession was created. ended_at: type: string format: date-time description: The time the RealtimeSession ended. project: type: string description: The project identifier. human: type: string description: The human identifier. simulated: type: boolean description: Whether the session is simulated or not. config: $ref: "#/components/schemas/RealtimeSessionConfig" data: type: array items: $ref: "#/components/schemas/RealtimeSessionData" _extra: type: object description: Extra configuration for the RealtimeSession. Usually this is for internal purposes. additionalProperties: true RealtimeSessionConfig: type: object required: - general - input - generative - output properties: general: $ref: "#/components/schemas/RealtimeSessionGeneralConfig" input: $ref: "#/components/schemas/RealtimeSessionInputConfig" generative: $ref: "#/components/schemas/RealtimeSessionGenerativeConfig" output: $ref: "#/components/schemas/RealtimeSessionOutputConfig" RealtimeSessionGeneralConfig: type: object required: - save_messages properties: time_limit_s: type: integer description: The time limit in seconds for the RealtimeSession. nullable: true default: null save_messages: type: boolean description: | Whether to save messages in the RealtimeSession. These will be saved to the context provided in the generative config. If no context is provided, a new context will be created when the session starts. default: true RealtimeSessionGenerativeConfig: type: object description: Configuration for the generative AI in the RealtimeSession. required: - llm - context - tool_definitions properties: llm: $ref: "#/components/schemas/LLM" voice_override: $ref: "#/components/schemas/Voice" persona: $ref: "#/components/schemas/Persona" scenario: $ref: "#/components/schemas/Scenario" context: $ref: "#/components/schemas/Context" tool_definitions: type: array items: $ref: "#/components/schemas/ToolDefinition" description: The tool definitions to use for the generative AI. _extra: type: object description: Extra configuration for the generative AI. Usually this is for internal purposes. additionalProperties: true RealtimeSessionGenerativeConfigCreate: type: object description: Configuration for the generative AI in the RealtimeSession. required: - llm properties: llm: type: string description: The LLM to use for the RealtimeSession. voice_override: type: string description: The voice to use for the RealtimeSession. persona: type: string description: The persona to use for the RealtimeSession. scenario: type: string description: The scenario to use for the RealtimeSession. context: type: string description: The context to use for the RealtimeSession. If unspecified, a new context will be created. tool_definitions: type: array items: type: string description: The tool definitions to use for the generative AI. _extra: type: object description: Extra configuration for the generative AI. Usually this is for internal purposes. additionalProperties: true RealtimeSessionGenerativeConfigUpdate: type: object description: Configuration for the generative AI in the RealtimeSession. properties: llm: type: string description: The LLM to use for the RealtimeSession. voice_override: type: string description: The voice to use for the RealtimeSession. persona: type: string description: The persona to use for the RealtimeSession. scenario: type: string description: The scenario to use for the RealtimeSession. context: type: string description: The context to use for the RealtimeSession. If unspecified, a new context will be created. tool_definitions: type: array items: type: string description: The tool definitions to use for the generative AI. _extra: type: object description: Extra configuration for the generative AI. Usually this is for internal purposes. additionalProperties: true RealtimeSessionInputConfig: type: object description: Configuration for the output of the RealtimeSession. required: - interruptable - parallel_listening properties: interruptable: type: boolean description: Whether the system allows interruption during speech. default: true parallel_listening: type: boolean description: | Whether the AI should continue listening while speaking. If true, the AI will produce another response immediately after the first one. This is only relevant if interruptable is false. default: false RealtimeSessionOutputConfig: type: object description: Configuration for the output of the RealtimeSession. required: - stream_transcript - speech_synthesis_enabled properties: stream_transcript: type: boolean description: Whether to stream agent spoken transcript or send full transcript when it's available all at once. defualt: true speech_synthesis_enabled: type: boolean description: Whether to enable speech synthesis for the RealtimeSession. default: true answer_message: type: string description: The message for the agent to speak first when the human joins. If exluded the agent will not speak first. RealtimeSessionConfigCreate: type: object required: - general - input - generative - output properties: general: $ref: "#/components/schemas/RealtimeSessionGeneralConfig" input: $ref: "#/components/schemas/RealtimeSessionInputConfig" generative: $ref: "#/components/schemas/RealtimeSessionGenerativeConfigCreate" output: $ref: "#/components/schemas/RealtimeSessionOutputConfig" RealtimeSessionConfigUpdate: type: object properties: general: $ref: "#/components/schemas/RealtimeSessionGeneralConfig" input: $ref: "#/components/schemas/RealtimeSessionInputConfig" generative: $ref: "#/components/schemas/RealtimeSessionGenerativeConfigUpdate" output: $ref: "#/components/schemas/RealtimeSessionOutputConfig" RealtimeSessionStartResponse: type: object required: - session - connection_details properties: session: $ref: "#/components/schemas/RealtimeSession" connection_details: $ref: "#/components/schemas/RealtimeSessionConnectionDetails" RealtimeSessionTimelineItem: type: object properties: seconds: type: number type: type: string enum: - silence - agent - user RealtimeSessionConnectionDetails: type: object required: - url - token properties: url: type: string description: The URL to connect to the RealtimeSession token: type: string description: The token to use to connect to the RealtimeSession RealtimeSessionInitiateOutboundCallRequestPhone: type: object required: - source_phone_number - destination_phone_number - type properties: type: type: string enum: - phone source_phone_number: type: string description: The phone number to call from destination_phone_number: type: string description: The phone number to call RealtimeSessionInitiateOutboundCallRequest: oneOf: - $ref: "#/components/schemas/RealtimeSessionInitiateOutboundCallRequestPhone" RealtimeSessionDTMFDigit: type: object required: - digit - duration properties: digit: type: string enum: - "0" - "1" - "2" - "3" - "4" - "5" - "6" - "7" - "8" - "9" - "*" - "#" - "A" - "B" - "C" - "D" - "" description: The DTMF digit to send duration: type: integer description: The duration in milliseconds to play the tone RealtimeSessionDTMFRequest: type: object required: - digits properties: digits: type: array items: $ref: "#/components/schemas/RealtimeSessionDTMFDigit" # Sessions (old) Session: type: object properties: created_at: type: string format: date-time ended_at: type: string format: date-time id: type: string livekit_room: type: string metadata: {} persona: type: string nullable: true project: type: string scenario: type: string nullable: true llm: type: string nullable: true state: type: string enum: - ended - in_progress - not_started voice_override: type: string nullable: true time_limit_s: type: integer nullable: true required: - created_at - id - livekit_room - metadata - persona - project - scenario - simulated - state - time_limit_s SessionMessage: type: object properties: agent: type: boolean created_at: type: string format: date-time deleted_at: type: string format: date-time id: type: string import_id: type: string nullable: true media: type: string session: type: string speaking_ended_at: type: string format: date-time text: type: string required: - agent - created_at - id - import_id - session - speaking_ended_at HistoryMessage: type: object properties: content: type: string import_id: type: string nullable: true role: type: string enum: - assistant - system - user required: - content - role SessionTimelineItem: type: object properties: seconds: type: number type: type: string enum: - silence - agent - user SessionStartRequest: oneOf: - type: object properties: history: type: array items: $ref: "#/components/schemas/HistoryMessage" time_limit_s: type: integer nullable: true voice_override: type: string nullable: true llm: type: string nullable: true persona: type: string nullable: true save_messages: description: "save session messages" type: boolean nullable: true default: true _extra: description: "reserved for internal use" type: object nullable: true - type: object properties: time_limit_s: type: integer nullable: true voice_override: type: string nullable: true llm: type: string nullable: true scenario: type: string persona: type: string save_messages: description: "save session messages" type: boolean nullable: true default: true _extra: description: "reserved for internal use" type: object nullable: true SessionStartResponse: type: object properties: session: $ref: "#/components/schemas/Session" persona: $ref: "#/components/schemas/Persona" scenario: $ref: "#/components/schemas/Scenario" connection_details: type: object properties: token: type: string url: type: string required: - session - connection_details UpdateSessionRequest: type: object properties: time_limit_s: type: number voice_override: type: string required: [] # Completions FunctionObject: type: object properties: description: type: string description: A description of what the function does, used by the model to choose when and how to call the function. name: type: string description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. parameters: $ref: "#/components/schemas/FunctionParameters" strict: type: boolean nullable: true default: false description: Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling). required: - name FunctionParameters: type: object description: >- The parameters the functions accepts, described as a JSON Schema object. See the [guide](/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. Omitting `parameters` defines a function with an empty parameter list. additionalProperties: true ChatCompletionTool: type: object properties: type: type: string enum: - function - gabber_tool description: The type of the tool. function: $ref: "#/components/schemas/FunctionObject" required: - type - function ChatCompletionNamedToolChoice: type: object description: Specifies a tool the model should use. Use to force the model to call a specific function. properties: type: type: string enum: - function description: The type of the tool. Currently, only `function` is supported. function: type: object properties: name: type: string description: The name of the function to call. required: - name required: - type - function ChatCompletionToolChoiceOption: description: > Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. `none` is the default when no tools are present. `auto` is the default if tools are present. oneOf: - type: string description: > `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools. enum: - none - auto - required - $ref: "#/components/schemas/ChatCompletionNamedToolChoice" ChatCompletionRequestGabber: type: object properties: voice: type: string description: Gabber voice id context: type: string description: Gabber memory context id advanced_memory: description: When set to true, gabber will use it's advanced memory system to generate responses. A context must be set to enable this feature. type: boolean ChatCompletionRequest: type: object properties: messages: description: Chat context type: array minItems: 1 items: $ref: "#/components/schemas/ChatCompletionRequestMessage" model: description: Gabber llm_id type: string metadata: type: object nullable: true gabber: $ref: "#/components/schemas/ChatCompletionRequestGabber" stream: description: > If set, partial message deltas will be sent, like in ChatGPT. type: boolean nullable: true default: false temperature: description: > Temperature for sampling from the model. Higher values mean more randomness. type: number max_tokens: description: > Maximum number of tokens to generate. Requests can be up to 4096 tokens. type: integer tools: description: > List of tools to call during the completion. Each tool will be called in the order they are listed. type: array items: $ref: "#/components/schemas/ChatCompletionTool" tool_choice: $ref: "#/components/schemas/ChatCompletionToolChoiceOption" parallel_tool_calls: type: boolean default: true description: Whether to enable parallel function calling required: - model - messages ChatCompletionMessageToolCallFunction: type: object properties: name: type: string description: The name of the function to call. arguments: type: string description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. required: - name - arguments ChatCompletionMessageToolCall: type: object properties: id: type: string description: The ID of the tool call. type: type: string enum: - function - gabber_tool description: The type of the tool. Currently, only `function` is supported. function: $ref: "#/components/schemas/ChatCompletionMessageToolCallFunction" required: - id - type - function ChatCompletionMessageToolCallChunk: type: object properties: index: type: integer id: type: string description: The ID of the tool call. type: type: string enum: - function - gabber_tool description: The type of the tool. If 'gabber' is specified, the id will be the gabber call id. function: $ref: "#/components/schemas/ChatCompletionMessageToolCallFunction" required: - index ChatCompletionMessageToolCalls: type: array description: The tool calls generated by the model, such as function calls. items: $ref: "#/components/schemas/ChatCompletionMessageToolCall" ChatCompletionResponseGabberMessageData: type: object required: - message_index - content_index - type - data properties: message_index: type: integer content_index: type: integer type: type: string enum: - audio_transcript data: type: object required: - transcript properties: transcript: type: string ChatCompletionResponseGabberAdvancedMemoryThread: type: object description: Message thread details required: - context_message_ids properties: context_message_ids: type: array items: type: string ChatCompletionResponseGabberAdvancedMemory: type: object description: Advanced memory details that were used to generate the response required: - threads properties: threads: type: array items: $ref: "#/components/schemas/ChatCompletionResponseGabberAdvancedMemoryThread" ChatCompletionResponseGabber: type: object description: Gabber-specific fields required: - message_data - usage properties: usage: type: array description: Gabber usage for this request items: $ref: "#/components/schemas/Usage" message_data: type: array items: $ref: "#/components/schemas/ChatCompletionResponseGabberMessageData" advanced_memory: $ref: "#/components/schemas/ChatCompletionResponseGabberAdvancedMemory" ChatCompletionResponse: type: object description: > Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape. required: - model - choices properties: choices: type: array description: A list of chat completion choices. items: type: object required: - message properties: message: $ref: "#/components/schemas/ChatCompletionResponseMessage" model: type: string description: The model used for completion. gabber: $ref: "#/components/schemas/ChatCompletionResponseGabber" ChatCompletionStreamResponse: type: object required: - choices - created - id - model - object description: Represents a streamed chunk of a chat completion response returned by model, based on the provided input. properties: id: type: string description: A unique identifier for the chat completion. Each chunk has the same ID. choices: type: array description: > A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. Can also be empty for the last chunk if you set `stream_options: {"include_usage": true}`. items: $ref: "#/components/schemas/ChatCompletionStreamResponseChoice" created: type: integer description: The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp. model: type: string description: The model to generate the completion. object: type: string description: The object type, which is always `chat.completion.chunk`. enum: - chat.completion.chunk gabber: $ref: "#/components/schemas/ChatCompletionResponseGabber" nullable: true ChatCompletionStreamResponseChoice: type: object required: - delta - finish_reason - index properties: delta: $ref: "#/components/schemas/ChatCompletionStreamResponseDelta" finish_reason: type: string description: The reason the model stopped generating tokens. enum: - stop - length - tool_calls - content_filter - function_call index: type: integer ChatCompletionStreamResponseDeltaGabberVoice: type: object required: - audio_url - expires_at properties: audio_url: type: string description: This will be the URL to the audio file expires_at: type: integer description: The Unix timestamp (in seconds) when the audio file expires ChatCompletionStreamResponseDeltaGabber: type: object description: If the audio output modality is requested, this object contains data properties: voice: $ref: "#/components/schemas/ChatCompletionStreamResponseDeltaGabberVoice" ChatCompletionStreamResponseDelta: type: object description: A chat completion delta generated by streamed model responses. required: - content - role properties: content: type: string description: The contents of the chunk message. role: type: string enum: - system - user - assistant description: The role of the author of this message. tool_calls: type: array items: $ref: "#/components/schemas/ChatCompletionMessageToolCallChunk" refusal: type: string description: The refusal message generated by the model. gabber: $ref: "#/components/schemas/ChatCompletionStreamResponseDeltaGabber" nullable: true ChatCompletionRequestMessageContentPartText: type: object title: Text content part description: Text content properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. required: - type - text ChatCompletionRequestMessageContentPartAudio: type: object title: Audio content part required: - type - input_audio properties: type: type: string enum: - input_audio description: Audio content type. input_audio: type: object properties: data: type: string description: Base64 encoded audio data. format: type: string enum: - wav - mp3 - ogg description: The format of the audio data. required: - data - format ChatCompletionRequestUserMessageContentPart: oneOf: - $ref: "#/components/schemas/ChatCompletionRequestMessageContentPartText" - $ref: "#/components/schemas/ChatCompletionRequestMessageContentPartAudio" ChatCompletionRequestSystemMessage: type: object title: System message properties: content: description: The contents of the message. oneOf: - type: string description: The text contents of the message. title: Text content - type: array description: An array of content parts with a defined type. title: Array of content parts items: $ref: "#/components/schemas/ChatCompletionRequestMessageContentPartText" minItems: 1 role: type: string enum: - system description: The role of the messages author. required: - content - role ChatCompletionRequestUserMessage: type: object title: User message properties: content: description: The contents of the message. oneOf: - type: string description: The text contents of the message. title: Text content - type: array description: An array of content parts with a defined type. title: Array of content parts items: $ref: "#/components/schemas/ChatCompletionRequestUserMessageContentPart" minItems: 1 role: type: string enum: - user description: The role of the messages author. required: - content - role ChatCompletionRequestAssistantMessage: type: object title: Assistant message description: | Messages sent by the model in response to user messages. properties: content: description: The contents of the message. oneOf: - type: string description: The text contents of the message. title: Text content - type: array description: An array of content parts with a defined type. title: Array of content parts items: $ref: "#/components/schemas/ChatCompletionRequestMessageContentPartText" minItems: 1 refusal: nullable: true type: string description: The refusal message by the assistant. role: type: string enum: - assistant description: The role of the messages author, in this case `assistant`. tool_calls: $ref: "#/components/schemas/ChatCompletionMessageToolCalls" required: - role ChatCompletionRequestToolMessage: type: object title: Tool message properties: role: type: string enum: - tool description: The role of the messages author, in this case `tool`. content: description: The contents of the message. oneOf: - type: string description: The text contents of the message. title: Text content - type: array description: An array of content parts with a defined type. title: Array of content parts items: $ref: "#/components/schemas/ChatCompletionRequestMessageContentPartText" minItems: 1 tool_call_id: type: string description: Tool call that this message is responding to. required: - role - content - tool_call_id ChatCompletionRequestMessage: oneOf: - $ref: "#/components/schemas/ChatCompletionRequestSystemMessage" - $ref: "#/components/schemas/ChatCompletionRequestUserMessage" - $ref: "#/components/schemas/ChatCompletionRequestAssistantMessage" - $ref: "#/components/schemas/ChatCompletionRequestToolMessage" ChatCompletionResponseMessage: type: object description: A chat completion message generated by the model. properties: content: type: string description: The contents of the message. nullable: true refusal: type: string description: The refusal message generated by the model. nullable: true role: type: string enum: - assistant description: The role of the author of this message. tool_calls: type: array items: $ref: "#/components/schemas/ChatCompletionMessageToolCall" gabber: type: object nullable: true description: If the audio output modality is requested, this object contains data properties: voice: nullable: true type: object required: - audio_url - expires_at properties: audio_url: type: string description: This will be the URL to the audio file expires_at: type: integer description: The Unix timestamp (in seconds) when the audio file expires required: - role - content - refusal # Tools ToolDefinitionParameter: type: object required: - name - description - type - required properties: name: type: string description: type: string type: type: string enum: - string - number - boolean - object - array required: type: boolean default: type: string ToolDefinitionCallSettingDestinationWebRequest: type: object required: - type - url properties: type: type: string enum: - web_request url: type: string ToolDefinitionCallSettingDestinationClientApp: type: object required: - type properties: type: type: string enum: - client_app ToolDefinitionCallSettings: type: object required: - id - destination properties: id: type: string destination: oneOf: - $ref: "#/components/schemas/ToolDefinitionCallSettingDestinationWebRequest" ToolDefinition: type: object required: - id - name - description - parameters - call_settings properties: id: type: string name: type: string description: type: string parameters: type: array items: $ref: "#/components/schemas/ToolDefinitionParameter" call_settings: $ref: "#/components/schemas/ToolDefinitionCallSettings" CreateToolDefinitionCallSettings: type: object required: - destination properties: destination: oneOf: - $ref: "#/components/schemas/ToolDefinitionCallSettingDestinationWebRequest" - $ref: "#/components/schemas/ToolDefinitionCallSettingDestinationClientApp" CreateToolDefinitionRequest: type: object required: - name - description - parameters - call_settings properties: name: type: string description: type: string parameters: type: array items: $ref: "#/components/schemas/ToolDefinitionParameter" call_settings: $ref: "#/components/schemas/CreateToolDefinitionCallSettings" ToolCallResult: type: object required: - tool_call_id - tool_definition_id - status - code properties: tool_call_id: type: string tool_definition_id: type: string response_string: type: string error_message: type: string code: type: integer # Webhooks WebhookMessageUsageTrackedPayload: allOf: - $ref: "#/components/schemas/Usage" - type: object properties: human_id: deprecated: true description: "Use `human` instead." type: string extra: type: object additionalProperties: true WebhookMessageUsageTracked: type: object required: - type - payload properties: type: type: string enum: - usage.tracked payload: $ref: "#/components/schemas/WebhookMessageUsageTrackedPayload" WebhookMessageRealtimeSessionStateChangedpayloadSession: type: object required: - id - state properties: id: type: string state: type: string enum: - not_started - in_progress - ended WebhookMessageRealtimeSessionStateChangedPayload: type: object required: - current_realtime_session properties: previous_realtime_session: $ref: "#/components/schemas/WebhookMessageRealtimeSessionStateChangedpayloadSession" current_realtime_session: $ref: "#/components/schemas/WebhookMessageRealtimeSessionStateChangedpayloadSession" WebhookMessageRealtimeSessionStateChanged: type: object required: - type - payload properties: type: type: string enum: - realtime_session.state_changed payload: $ref: "#/components/schemas/WebhookMessageRealtimeSessionStateChangedPayload" WebhookMessageRealtimeSessionMessageCommittedPayload: type: object required: - message - session properties: message: $ref: "#/components/schemas/ContextMessage" realtime_session_id: type: string WebhookMessageRealtimeSessionMessageCommitted: type: object required: - type - payload properties: type: type: string enum: - realtime_session.message_committed payload: $ref: "#/components/schemas/WebhookMessageRealtimeSessionMessageCommittedPayload" WebhookMessageToolCallFunction: type: object required: - name - arguments properties: name: type: string description: The name of the function to call. arguments: type: object additionalProperties: true description: The named arguments to call the function with the function was called with WebhookMessageToolCall: type: object required: - id - tool_definition_id - function properties: id: type: string tool_definition_id: type: string function: $ref: "#/components/schemas/WebhookMessageToolCallFunction" WebhookMessageToolCallsStartedPayload: type: object required: - tool_calls - group properties: realtime_session: type: string group: type: string tool_calls: type: array items: $ref: "#/components/schemas/WebhookMessageToolCall" WebhookMessageToolCallsStarted: type: object required: - type - payload properties: type: type: string enum: - tool.calls_started payload: $ref: "#/components/schemas/WebhookMessageToolCallsStartedPayload" WebhookMessageToolCallsFinishedPayload: type: object required: - tool_calls - tool_call_results - group properties: realtime_session: type: string group: type: string tool_calls: type: array items: $ref: "#/components/schemas/WebhookMessageToolCall" tool_call_results: type: array items: $ref: "#/components/schemas/ToolCallResult" WebhookMessageToolCallsFinished: type: object required: - type - payload properties: type: type: string enum: - tool.calls_finished payload: $ref: "#/components/schemas/WebhookMessageToolCallsFinishedPayload" WebhookMessage: oneOf: - $ref: "#/components/schemas/WebhookMessageUsageTracked" - $ref: "#/components/schemas/WebhookMessageRealtimeSessionStateChanged" - $ref: "#/components/schemas/WebhookMessageRealtimeSessionMessageCommitted" - $ref: "#/components/schemas/WebhookMessageToolCallsStarted" - $ref: "#/components/schemas/WebhookMessageToolCallsFinished" BadRequest: type: object properties: type: type: string description: "The type of the error." enum: - usage_limit_exceeded - project_disabled - moderation_error - invalid_input message: type: string description: "A human-readable message describing the error." parameters: HumanIdIdentifier: name: x-human-id in: header required: false description: "When using x-api-key authentication, this header is used to scope requests to a specific human." schema: type: string responses: BadRequest: description: "Bad request" content: application/json: schema: $ref: "#/components/schemas/BadRequest" InternalServerError: description: "Internal server error" content: application/json: schema: type: object properties: error: type: string description: Error message. security: - ApiKeyAuth: [] - BearerAuth: [] servers: - url: https://api.gabber.dev paths: /v1/persona/list: get: tags: - Persona summary: "Get a list of personas" operationId: listPersonas parameters: - $ref: "#/components/parameters/HumanIdIdentifier" responses: "200": description: "List of personas" content: application/json: schema: type: object required: - values - total_count - next_page properties: next_page: type: string nullable: true description: "The token for the next page of results, or null if there are no more pages." total_count: type: integer description: "The total number of items available." values: type: "array" items: $ref: "#/components/schemas/Persona" description: "The array of personas." "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/usage/token: post: security: - ApiKeyAuth: [] operationId: createUsageToken tags: - Usage summary: "Create a new usage token" description: "Requests a token for a human" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UsageTokenRequest" responses: "200": description: "Token created successfully" content: application/json: schema: type: object required: - token properties: token: type: string "400": $ref: "#/components/responses/BadRequest" "429": description: "Usage limit exceeded" "500": description: "Internal server error" put: security: - ApiKeyAuth: [] operationId: updateUsageToken tags: - Usage summary: "Update limits on a usage token" description: "Updates the usage limits of a human" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateUsageLimitsRequest" responses: "200": description: "Usage limits updated successfully" content: application/json: schema: type: object additionalProperties: false "400": $ref: "#/components/responses/BadRequest" "429": description: "Usage limit exceeded" "500": description: "Internal server error" /v1/usage/limits: get: operationId: getUsageLimits tags: - Usage summary: "Get usage limits" description: "Gets the usage limits of a token" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" responses: "200": description: "Token created successfully" content: application/json: schema: $ref: "#/components/schemas/UsageLimits" "400": $ref: "#/components/responses/BadRequest" "429": description: "Usage limit exceeded" "500": description: "Internal server error" /v1/voice/clone: post: operationId: cloneVoice tags: - Voice summary: "Clone a voice" description: "Creates a new cloned voice based on the input audio file" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" requestBody: required: true content: multipart/form-data: schema: type: object properties: name: type: string description: "Name of the new voice" language: type: string description: "Language of the voice (e.g., 'en', 'es', 'fr')" file: type: string format: binary description: "Audio file for voice cloning (MP3 format)" required: - name - language - file encoding: file: contentType: "audio/mpeg" responses: "200": description: "Voice cloned successfully" content: application/json: schema: $ref: "#/components/schemas/Voice" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/voice/generate: post: operationId: generateVoice tags: - Voice summary: "Generate voice" description: "Generates speech from input text and specified voice" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" requestBody: required: true content: application/json: schema: type: object properties: text: type: string description: "Text to synthesize into voice" voice_id: type: string moderation: type: boolean description: "Whether to moderate the text." required: - text - voice_id responses: "200": description: Returns MP3 data content: audio/mpeg: schema: type: string format: binary audio/wav: schema: type: string format: binary "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/voice/{voice_id}: get: operationId: getVoice tags: - Voice summary: "Get a voice" parameters: - name: "voice_id" in: "path" required: true schema: type: string responses: "200": description: "Voice fetched successfully" content: application/json: schema: $ref: "#/components/schemas/Voice" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" delete: operationId: deleteVoice tags: - Voice summary: "Delete a voice" parameters: - name: "voice_id" in: "path" required: true schema: type: string responses: "200": description: "Voice deleted successfully" content: application/json: schema: type: object properties: message: type: string example: "Voice deleted successfully" "400": $ref: "#/components/responses/BadRequest" "404": description: "Voice not found" "500": description: "Internal server error" put: operationId: updateVoice tags: - Voice summary: "Update a voice" parameters: - name: "voice_id" in: "path" required: true schema: type: string description: "Updates a voice based on the input request data" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateVoiceRequest" responses: "200": description: "Voice updated successfully" content: application/json: schema: $ref: "#/components/schemas/Voice" "400": $ref: "#/components/responses/BadRequest" "404": description: "Voice not found" "500": description: "Internal server error" /v1/voice/list: get: operationId: listVoices tags: - Voice summary: "Get a list of voices" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" responses: "200": description: "List of voices" content: application/json: schema: type: object required: - values - total_count - next_page properties: next_page: type: string nullable: true description: "The token for the next page of results, or null if there are no more pages." total_count: type: integer description: "The total number of items available." values: type: "array" items: $ref: "#/components/schemas/Voice" description: "The array of voices." "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/credit/{credit}: get: operationId: getCredit tags: - Credit summary: "Get a single credit object" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: "credit" in: "path" required: true schema: type: string responses: "200": description: "Credit fetched successfully" content: application/json: schema: $ref: "#/components/schemas/Credit" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/credit: post: security: - ApiKeyAuth: [] operationId: createCredit tags: - Credit summary: "Create a new credit type" description: | Creates a new credit based on the input request data. parameters: - $ref: "#/components/parameters/HumanIdIdentifier" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateCreditRequest" responses: "200": description: "Credit created successfully" content: application/json: schema: $ref: "#/components/schemas/Credit" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/credit/list: get: operationId: listCredits tags: - Credit summary: "Get a list of credits" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" responses: "200": description: "List of credits" content: application/json: schema: type: object required: - values - total_count - next_page properties: next_page: type: string nullable: true description: "The token for the next page of results, or null if there are no more pages." total_count: type: "integer" description: "The total number of items available." values: type: "array" items: $ref: "#/components/schemas/Credit" description: "The array of credits." "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/credit/{credit}/ledger: post: security: - ApiKeyAuth: [] operationId: createCreditLedgerEntry tags: - Credit summary: "Create a new credit ledger entry" description: "Creates a new credit ledger entry for human. Requires a human id." parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: "credit" in: "path" required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateCreditLedgerEntryRequest" responses: "200": description: "Credit ledger entry created successfully" content: application/json: schema: $ref: "#/components/schemas/CreditLedgerEntry" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/credit/{credit}/ledger/latest: get: operationId: getLatestCreditLedgerEntry tags: - Credit summary: "Get the latest credit ledger entry for a human. Requires a human id." parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: "credit" in: "path" required: true schema: type: string responses: "200": description: "Credit balance fetched successfully" content: application/json: schema: $ref: "#/components/schemas/CreditLedgerEntry" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/chat/completions: post: operationId: chatCompletions tags: - Inference summary: "Chat Completions (+ Voice)" description: "Given messages, generates LLM output text and optionally speech" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ChatCompletionRequest" responses: "200": x-gabber-generator-raw-return: true description: "Response including text and audio" content: application/json: schema: $ref: "#/components/schemas/ChatCompletionResponse" text/event-stream: schema: $ref: "#/components/schemas/ChatCompletionStreamResponse" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/persona/{persona_id}: get: operationId: getPersona tags: - Persona summary: "Get a persona" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: "persona_id" in: "path" required: true schema: type: string responses: "200": description: "Persona fetched successfully" content: application/json: schema: $ref: "#/components/schemas/Persona" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" put: operationId: updatePersona tags: - Persona summary: "Update a persona" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: "persona_id" in: "path" required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdatePersonaRequest" responses: "200": description: "Persona updated successfully" content: application/json: schema: $ref: "#/components/schemas/Persona" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" delete: operationId: deletePersona tags: - Persona summary: "Delete a persona" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: "persona_id" in: "path" required: true schema: type: string responses: "200": description: "Persona deleted successfully" content: application/json: schema: type: object properties: message: type: string example: "Persona deleted successfully" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/persona: post: operationId: createPersona tags: - Persona summary: "Create a persona" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreatePersonaRequest" responses: "200": description: "Persona created successfully" content: application/json: schema: $ref: "#/components/schemas/Persona" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/scenario/{scenario_id}: put: operationId: updateScenario tags: - Scenario summary: "Update a scenario" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: "scenario_id" in: "path" required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateScenarioRequest" responses: "200": description: "Scenario updated successfully" content: application/json: schema: $ref: "#/components/schemas/Scenario" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" delete: operationId: deleteScenario tags: - Scenario summary: "Delete a scenario" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: "scenario_id" in: "path" required: true schema: type: string responses: "200": description: "Scenario deleted successfully" content: application/json: schema: type: object properties: message: type: string example: "Scenario deleted successfully" "400": $ref: "#/components/responses/BadRequest" "404": description: "Scenario not found" "500": description: "Internal server error" get: tags: - Scenario summary: "Get a scenario" operationId: getScenario parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: "scenario_id" in: "path" required: true schema: type: string responses: "200": description: "Scenario fetched successfully" content: application/json: schema: $ref: "#/components/schemas/Scenario" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/scenario/list: get: operationId: listScenarios tags: - Scenario summary: "Get a list of scenarios" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" responses: "200": description: "List of scenarios" content: application/json: schema: type: object required: - values - total_count properties: next_page: type: string nullable: true description: "The token for the next page of results, or null if there are no more pages." total_count: type: "integer" description: "The total number of items available." values: type: "array" items: $ref: "#/components/schemas/Scenario" description: "The array of scenarios." "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/scenario: post: operationId: CreateScenario tags: - Scenario summary: "Create a scenario" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateScenarioRequest" responses: "200": description: "Scenario deleted successfully" content: application/json: schema: $ref: "#/components/schemas/Scenario" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/llm/list: get: operationId: listLLMs tags: - LLM summary: "Get a list of llms" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" responses: "200": description: "List of llms" content: application/json: schema: type: object required: - values - total_count - next_page properties: next_page: type: string nullable: true description: "The token for the next page of results, or null if there are no more pages." total_count: type: "integer" description: "The total number of items available." values: type: "array" items: $ref: "#/components/schemas/LLM" description: "The array of voices." "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/llm/{llm}: get: operationId: getLLM tags: - LLM summary: "Get a list of llms" parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: "llm" in: "path" required: true schema: type: string responses: "200": description: "LLM fetched successfully" content: application/json: schema: $ref: "#/components/schemas/LLM" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/llm/context: post: tags: - LLM summary: Create a new Context. description: | Create a new Context with the given configuration. operationId: createContext parameters: - $ref: "#/components/parameters/HumanIdIdentifier" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ContextCreateRequest" responses: "200": description: Context created successfully content: application/json: schema: $ref: "#/components/schemas/Context" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/llm/context/{context}: get: tags: - LLM summary: Retrieve a Context. description: | Retrieve the Context with the given identifier. operationId: getContext parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: context in: path required: true description: The unique identifier of the Context. schema: type: string responses: "200": description: Context fetched successfully content: application/json: schema: $ref: "#/components/schemas/Context" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/llm/context/{context}/message/list: get: tags: - LLM summary: List ContextMessages. description: | List all ContextMessages associated with the given Context. operationId: listContextMessages parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: context in: path required: true description: The unique identifier of the Context. schema: type: string - name: message_ids in: query required: false description: A comma-separated list of message IDs to fetch. schema: type: array items: type: string responses: "200": description: ContextMessages fetched successfully content: application/json: schema: type: object required: - values - total_count properties: next_page: type: string description: The URL to the next page of items. nullable: true total_count: type: integer description: The total number of items. values: type: array description: The list of items. items: $ref: "#/components/schemas/ContextMessage" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/llm/context/{context}/message: post: tags: - LLM summary: Create a new ContextMessage. description: | Create a new ContextMessage with the given configuration. operationId: createContextMessage parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: context in: path required: true description: The unique identifier of the Context. schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ContextMessageCreateParams" responses: "200": description: ContextMessage created successfully content: application/json: schema: $ref: "#/components/schemas/ContextMessage" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/llm/context/{context}/message/{message}: get: tags: - LLM summary: Retrieve a ContextMessage. description: | Retrieve the ContextMessage with the given identifier. operationId: getContextMessage parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: context in: path required: true description: The unique identifier of the Context. schema: type: string - name: message in: path required: true description: The unique identifier of the ContextMessage. schema: type: string responses: "200": description: ContextMessage fetched successfully content: application/json: schema: $ref: "#/components/schemas/ContextMessage" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/realtime/start: post: tags: - Realtime summary: Start a new RealtimeSession. description: | Start a new RealtimeSession with the given configuration. operationId: startRealtimeSession parameters: - $ref: "#/components/parameters/HumanIdIdentifier" requestBody: required: true content: application/json: schema: type: object required: - config properties: simulated: type: boolean description: Whether the session is simulated. config: $ref: "#/components/schemas/RealtimeSessionConfigCreate" _extra: type: object description: Extra data for certain Gabber partner integrations. additionalProperties: true responses: "200": description: Session created successfully content: application/json: schema: $ref: "#/components/schemas/RealtimeSessionStartResponse" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/realtime/{session}/outbound_call: post: tags: - Realtime summary: Initiate an outbound call. description: | Initiate an outbound call from a RealtimeSession. operationId: initiateOutboundCall parameters: - name: session in: path required: true description: The unique identifier of the RealtimeSession. schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RealtimeSessionInitiateOutboundCallRequest" responses: "200": description: Session called successfully content: application/json: schema: $ref: "#/components/schemas/RealtimeSession" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/realtime/{session}/update: post: tags: - Realtime summary: Update a RealtimeSession. description: | Update the RealtimeSession with the given identifier. operationId: updateRealtimeSession parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: session in: path required: true description: The unique identifier of the RealtimeSession. schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RealtimeSessionConfigUpdate" responses: "200": description: Session updated successfully content: application/json: schema: $ref: "#/components/schemas/RealtimeSession" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/realtime/{session}/end: post: tags: - Realtime summary: End a RealtimeSession. description: | End the RealtimeSession with the given identifier. operationId: endRealtimeSession parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: session in: path required: true description: The unique identifier of the RealtimeSession. schema: type: string responses: "200": description: Session ended successfully content: application/json: schema: $ref: "#/components/schemas/RealtimeSession" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/realtime/{session}: get: tags: - Realtime summary: Get a RealtimeSession. description: | End the RealtimeSession with the given identifier. operationId: getRealtimeSession parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: session in: path required: true description: The unique identifier of the RealtimeSession. schema: type: string responses: "200": description: Session fetched successfully content: application/json: schema: $ref: "#/components/schemas/RealtimeSession" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/realtime/{session}/timeline: get: tags: - Realtime summary: Get a RealtimeSession timeline. description: | Get the timeline of the RealtimeSession with the given identifier. operationId: getRealtimeSessionTimeline parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: session in: path required: true description: The unique identifier of the RealtimeSession. schema: type: string responses: "200": description: Session timeline fetched successfully content: application/json: schema: type: object required: - values - total_count properties: next_page: type: string description: The URL to the next page of items. total_count: type: integer description: The total number of items. values: type: array description: The list of items. items: $ref: "#/components/schemas/RealtimeSessionTimelineItem" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/realtime/{session}/messages: get: tags: - Realtime summary: Get a RealtimeSession messages. description: | Get all ContextMessages associated with the given RealtimeSession. operationId: getRealtimeSessionMessages parameters: - $ref: "#/components/parameters/HumanIdIdentifier" - name: session in: path required: true description: The unique identifier of the RealtimeSession. schema: type: string responses: "200": description: Session messages fetched successfully content: application/json: schema: type: object required: - values - total_count properties: next_page: type: string description: The URL to the next page of items. total_count: type: integer description: The total number of items. values: type: array description: The list of items. items: $ref: "#/components/schemas/ContextMessage" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/realtime/list: get: tags: - Realtime summary: List Realtime Sessions. description: | List all Realtime Sessions. operationId: listRealtimeSessions parameters: - $ref: "#/components/parameters/HumanIdIdentifier" responses: "200": description: Realtime Sessions fetched successfully content: application/json: schema: type: object required: - values - total_count properties: next_page: type: string description: The URL to the next page of items. total_count: type: integer description: The total number of items. values: type: array description: The list of items. items: $ref: "#/components/schemas/RealtimeSession" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/realtime/session/{session}/attach_human: post: security: - ApiKeyAuth: [] operationId: attachHuman tags: - Realtime summary: "Attach a human to a RealtimeSession" description: "Attaches a human to a RealtimeSession. This is useful for previously anonymous sessions, for example sessions created via a phone call." parameters: - name: session in: path required: true description: The unique identifier of the RealtimeSession. schema: type: string requestBody: required: true content: application/json: schema: type: object required: - human properties: human: type: string description: The unique identifier of the Human. responses: "200": description: "Token created successfully" content: application/json: schema: $ref: "#/components/schemas/RealtimeSession" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/realtime/{session}/speak: post: security: - ApiKeyAuth: [] operationId: speak tags: - Realtime summary: "Speak" description: "For a live session, force the agent to speak a given text." parameters: - name: session in: path required: true description: The unique identifier of the RealtimeSession. schema: type: string requestBody: required: true content: application/json: schema: type: object required: - text properties: text: type: string description: The text to be spoken by the agent. responses: "200": description: "Speak request sent successfully" content: application/json: schema: $ref: "#/components/schemas/RealtimeSession" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/realtime/{session}/dtmf: post: security: - ApiKeyAuth: [] operationId: dtmf tags: - Realtime summary: "DTMF" description: "For a live session, force agent to send DTMF tones" parameters: - name: session in: path required: true description: The unique identifier of the RealtimeSession. schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/RealtimeSessionDTMFRequest" responses: "200": description: "DTMF queued successfully" "400": $ref: "#/components/responses/BadRequest" "500": description: "Internal server error" /v1/tool: post: operationId: createToolDefinition security: - ApiKeyAuth: [] tags: - Tool summary: "Create a tool definition" description: "Create a tool definition" requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateToolDefinitionRequest" responses: "200": description: "Tool created" content: application/json: schema: $ref: "#/components/schemas/ToolDefinition" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/tool/{tool}: get: operationId: getToolDefinition security: - ApiKeyAuth: [] tags: - Tool summary: "Get a tool definition" description: "Get a tool definition" parameters: - name: "tool" in: "path" required: true schema: type: string responses: "200": description: "Tool fetched" content: application/json: schema: $ref: "#/components/schemas/ToolDefinition" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" delete: operationId: deleteToolDefinition security: - ApiKeyAuth: [] tags: - Tool summary: "Delete a tool definition" description: "Delete a tool definition" parameters: - name: "tool" in: "path" required: true schema: type: string responses: "200": description: "Tool deleted" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" put: operationId: updateToolDefinition security: - ApiKeyAuth: [] tags: - Tool summary: "Update a tool definition" description: "Update a tool definition" parameters: - name: "tool" in: "path" required: true schema: type: string requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateToolDefinitionRequest" responses: "200": description: "Tool updated" content: application/json: schema: $ref: "#/components/schemas/ToolDefinition" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/tool/list: get: operationId: listToolDefinitions security: - ApiKeyAuth: [] tags: - Tool summary: "List tools" description: "List tools" responses: "200": description: "List of tools" content: application/json: schema: type: object required: - values - total_count properties: next_page: type: string nullable: true description: "The token for the next page of results, or null if there are no more pages." total_count: type: "integer" description: "The total number of items available." values: type: "array" items: $ref: "#/components/schemas/ToolDefinition" description: "The array of tools." "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /v1/tool/call/{call}/result: get: operationId: getToolCallResult security: - ApiKeyAuth: [] tags: - Tool summary: "Get a tool call result" description: "Get a tool call result" parameters: - name: "call" in: "path" required: true schema: type: string responses: "200": description: "Tool call status fetched" content: application/json: schema: $ref: "#/components/schemas/ToolCallResult" "400": $ref: "#/components/responses/BadRequest" "500": $ref: "#/components/responses/InternalServerError" /dummy: get: tags: - Dummy summary: "Dummy endpoint" description: "Dummy endpoint for forcing generation objeects" responses: "200": description: "Dummy endpoint" content: application/json: schema: type: object properties: webhook_message: $ref: "#/components/schemas/WebhookMessage" "500": description: "Internal server error" webhooks: webhook: post: tags: - Webhook security: [] parameters: - name: "X-Webhook-Signature" description: "Hex string of HMAC-SHA256 signature of the request body signed using your configured service key" in: "header" required: true schema: type: string summary: "Webhook" description: "Receives events from the server." requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/WebhookMessage" responses: "200": description: "Webhook received successfully" "400": description: "Invalid request data" "500": description: "Internal server error"