ThunderPhone Realtime API

The realtime API from ThunderPhone — 2 operation(s) for realtime.

GitHub OpenAPI

Operations 2

POST /v1/realtime/sessions Realtime sessions create #
POST /v1/realtime/sessions/{call_id}/live-transcripts Realtime sessions live transcripts #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/thunderphone-com:thunderphone-com-realtime-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

thunderphone-com-realtime-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: ThunderPhone Realtime API
  version: 1.0.0
  description: Programmatic access to the ThunderPhone platform — agents, phone numbers, calls, billing, webhooks, and more. See https://thunderphone.com/docs and https://thunderphone.com/developers for the reference, tutorials and migration guides.
  contact:
    name: ThunderPhone support
    url: https://thunderphone.com/docs
servers:
- url: https://api.thunderphone.com
  description: Production
tags:
- name: Realtime
paths:
  /v1/realtime/sessions:
    post:
      operationId: realtime_sessions_create
      description: Create or run realtime / sessions. Parameters and returned fields are described below; organization-scoped resources use the organization associated with the authenticated credential. See https://thunderphone.com/docs for usage and access requirements.
      tags:
      - Realtime
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RealtimeSessionRequestRequest'
      security:
      - bearerAuth: []
      - bearerAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RealtimeSession'
          description: ''
      summary: Realtime sessions create
      x-summary-source: derived
  /v1/realtime/sessions/{call_id}/live-transcripts:
    post:
      operationId: realtime_sessions_live_transcripts
      description: The bridge reports a session that turned live transcripts on mid-call. session.update can enable the option after the mint (saved-agent sessions start at connect, before any session.update). Billing is per session, so the flag only ever goes to True; turning the stream off later stops the transcriber but does not remove the surcharge.
      parameters:
      - in: path
        name: call_id
        schema:
          type: integer
        required: true
      tags:
      - Realtime
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LiveTranscriptToggleRequest'
      security:
      - bearerAuth: []
      - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LiveTranscripts'
          description: ''
      summary: Realtime sessions live transcripts
      x-summary-source: derived
components:
  schemas:
    ToolEndpointRequest:
      type: object
      properties:
        url:
          type: string
          format: uri
          minLength: 1
        method:
          type: string
          minLength: 1
        headers:
          type: object
          additionalProperties:
            type: string
            minLength: 1
        request_format:
          type: string
      required:
      - url
    AgentWordRequest:
      type: object
      description: How the agent says one word or phrase, and whether it listens for it.
      properties:
        term:
          type: string
          minLength: 1
          description: The word as the agent writes it, e.g. Quayside.
          maxLength: 80
        say_as:
          type: string
          description: How to say it, respelled in plain words of the language's own script, e.g. "Kee side".
          maxLength: 80
        ipa:
          type: string
          description: Optional IPA, without slashes or brackets. Needs say_as.
          maxLength: 80
        language:
          type: string
          minLength: 1
          description: Language code, e.g. en. Defaults to the agent's primary language.
        case_sensitive:
          type: boolean
          default: false
          description: Match only this capitalization, e.g. for an acronym like US.
        speak_with:
          allOf:
          - $ref: '#/components/schemas/AgentWordSpeakWithEnum'
          default: auto
          description: 'auto: the IPA where it is proven to work on the voice, otherwise say_as. ipa: the IPA wherever the voice can take it. say_as: always the respelling.


            * `auto` - auto

            * `ipa` - ipa

            * `say_as` - say_as'
        hear:
          type: boolean
          default: false
          description: 'Also listen for this word in what the caller says: in its step, on turns where the agent says it, on turns whose agent line has a hear_when phrase, or on every turn with hear_always.'
        step:
          type:
          - string
          - 'null'
          minLength: 1
          description: 'With hear: listen for it in this step (a step id), on every turn of it, and elsewhere only where hear_when matches. Null for no step.'
        hear_always:
          type: boolean
          default: false
          description: Listen for it on every turn, such as the company name. Needs hear; at most 3.
        hear_when:
          type:
          - array
          - 'null'
          items:
            type: string
            minLength: 1
            maxLength: 40
          description: 'With hear: also listen for it on turns where the agent''s line contains one of these phrases, such as ["insurance"] for an insurer list when the agent asks "Who''s your insurance with?". Up to 5 phrases of up to 40 characters, each with a letter or digit, matched as whole words, ignoring case. With a step too, it is listened for in either case. Null (default) for none. On an edit, an entry sent without hear_when keeps the word''s current phrases; send null or [] to clear them.'
          maxItems: 5
        checked:
          allOf:
          - $ref: '#/components/schemas/AgentWordCheckRequest'
      required:
      - term
    TransferDestinationActionEnum:
      enum:
      - return
      type: string
      description: '* `return` - return'
    NullEnum:
      enum:
      - null
    LiveTranscriptToggleRequest:
      type: object
      properties:
        enabled:
          type: boolean
          default: true
    RealtimeInlineConfigRequest:
      type: object
      description: Strict, OpenAI-shaped configuration for ephemeral realtime sessions.
      properties:
        prompt:
          type: string
          minLength: 1
        voice:
          type: string
          minLength: 1
        product:
          allOf:
          - $ref: '#/components/schemas/Product235Enum'
          default: spark
        tools:
          type: array
          items:
            $ref: '#/components/schemas/ToolDefinitionRequest'
        primary_language:
          type: string
          minLength: 1
        additional_languages:
          type: array
          items:
            type: string
            minLength: 1
        background_track:
          type:
          - string
          - 'null'
        additional_audio_context:
          type:
          - boolean
          - 'null'
        telephony:
          type: boolean
          default: true
        outbound:
          type: boolean
          default: false
        ivr_mode:
          oneOf:
          - $ref: '#/components/schemas/IvrModeEnum'
          - $ref: '#/components/schemas/NullEnum'
        call_events:
          type: boolean
          default: false
        placeholders:
          type: array
          items:
            type: string
            maxLength: 200
          maxItems: 10
        max_hold_seconds:
          type:
          - integer
          - 'null'
          maximum: 900
          minimum: 10
        transfer_destinations:
          type:
          - array
          - 'null'
          items:
            $ref: '#/components/schemas/TransferDestinationRequest'
        words:
          type:
          - array
          - 'null'
          items:
            $ref: '#/components/schemas/AgentWordRequest'
          description: 'How the agent says specific words, and which words it listens for. Each entry: term (the word as the agent writes it), say_as (a plain respelling), optional ipa, language (defaults to this config''s primary language), case_sensitive, speak_with (auto, ipa or say_as), hear, step, hear_always and hear_when. At most 200 entries.'
      required:
      - prompt
    RealtimeSessionRequestRequest:
      type: object
      properties:
        agent_id:
          type:
          - integer
          - 'null'
        config:
          allOf:
          - $ref: '#/components/schemas/RealtimeInlineConfigRequest'
        overrides:
          type:
          - object
          - 'null'
          additionalProperties: {}
          description: 'Changes some of the saved agent''s settings for this session only, such as {"voice": "john"}; the agent itself is unchanged. Keys are agent setting names (see the docs for the list); values are checked as an edit of the agent would check them, and a refused one is a 400. Not with config.'
        live_transcripts:
          type: boolean
          default: false
        variables:
          type: object
          additionalProperties:
            oneOf:
            - type: string
            - type: number
            - type: boolean
        context:
          type:
          - string
          - 'null'
          description: Free-form text for this call, such as a task description or notes collected earlier, at most 20,000 characters. It is added after the prompt in a delimited block, is not rendered as a template, and counts toward the prompt length. Works with agent_id or config.
          maxLength: 20000
        phi_mode:
          allOf:
          - $ref: '#/components/schemas/PhiModeEnum'
          description: 'Treat this session''s call as containing PHI; only tightening is allowed.


            * `phi` - phi'
        language:
          type: string
          description: The language the session starts in, a supported language code such as es or es-MX. With agent_id the agent speaks it with its voice for that language (its language_voices entry, native voice switching's choice, or its own voice when that speaks it) and keeps its other languages; when none speaks it, the language's default voice and that language alone. An unsupported code is 400.
        primary_language:
          type: string
          description: Alias for language.
        telephony:
          type: boolean
          default: true
          description: 'With agent_id: whether the session carries phone audio (default true); false for browser audio.'
        outbound:
          type: boolean
          default: false
          description: 'With agent_id: the session is an outbound call, so the agent waits for the other side, can wait on hold and handles phone menus (ivr_mode).'
        ivr_mode:
          description: 'With agent_id and outbound: phone-menu handling, auto (default), on or off.


            * `auto` - auto

            * `on` - on

            * `off` - off'
          oneOf:
          - $ref: '#/components/schemas/IvrModeEnum'
          - $ref: '#/components/schemas/NullEnum'
        call_events:
          type: boolean
          default: false
          description: 'With agent_id: deliver call.* events to the client, which also gives the agent its transfer_call and send_keypad_input tools (the client carries them out).'
        placeholders:
          type: array
          items:
            type: string
            maxLength: 200
          description: 'With agent_id: up to 10 lines the agent says while a reply is still being written, in place of its own filler lines (when the agent''s filler phrases are on).'
          maxItems: 10
    AgentWordCheckByEnum:
      enum:
      - zeus
      - person
      type: string
      description: '* `zeus` - zeus

        * `person` - person'
    FunctionSpecRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        description:
          type: string
          default: ''
        parameters:
          $ref: '#/components/schemas/ToolParametersRequest'
      required:
      - name
    AgentWordCheckResultEnum:
      enum:
      - right
      - wrong
      - unsure
      type: string
      description: '* `right` - right

        * `wrong` - wrong

        * `unsure` - unsure'
    PhiModeEnum:
      enum:
      - phi
      type: string
      description: '* `phi` - phi'
    LiveTranscripts:
      type: object
      properties:
        call_id:
          type: integer
        live_transcripts:
          type: boolean
      required:
      - call_id
      - live_transcripts
    RealtimeSession:
      type: object
      properties:
        livekit_url:
          type: string
        call_id:
          type: integer
        token:
          type: string
        room_name:
          type: string
      required:
      - call_id
      - livekit_url
      - room_name
      - token
    Product235Enum:
      enum:
      - spark
      - bolt
      - storm-base
      - storm-base-with-ack
      - storm-extra
      - storm-extra-with-ack
      - full-duplex
      type: string
      description: '* `spark` - spark

        * `bolt` - bolt

        * `storm-base` - storm-base

        * `storm-base-with-ack` - storm-base-with-ack

        * `storm-extra` - storm-extra

        * `storm-extra-with-ack` - storm-extra-with-ack

        * `full-duplex` - full-duplex'
    AgentWordCheckRequest:
      type: object
      description: The last time someone listened to this entry, and what they heard.
      properties:
        voice:
          type: string
          minLength: 1
          description: The voice that was listened to.
        model:
          type:
          - string
          - 'null'
          minLength: 1
          description: The voice model as the product names it, when known. Never a vendor name.
        result:
          allOf:
          - $ref: '#/components/schemas/AgentWordCheckResultEnum'
          description: 'Whether it sounded right.


            * `right` - right

            * `wrong` - wrong

            * `unsure` - unsure'
        by:
          allOf:
          - $ref: '#/components/schemas/AgentWordCheckByEnum'
          description: 'zeus (the assistant) or person.


            * `zeus` - zeus

            * `person` - person'
        at:
          type: string
          minLength: 1
          description: When, as an ISO 8601 date or date and time.
      required:
      - at
      - by
      - result
      - voice
    TransferDestinationRequest:
      type: object
      description: 'A transfer number: a name the agent''s prompt uses and the number it stands for.


        Once transfer directories are enforced, an agent transfers only to its

        transfer numbers, chosen by name; with none, the agent can''t transfer

        calls. When to transfer is written in the prompt.'
      properties:
        name:
          type: string
          minLength: 1
          description: How the prompt refers to this number, e.g. "transfer billing questions to Billing". Unique per agent, ignoring case. When to transfer is written in the prompt.
          maxLength: 60
        number:
          type: string
          description: 'A phone number (stored in E.164; numbers without a country code are read as US), exactly one {{variable}} filled from the call''s variables when the call starts, or a sip: or sips: address (at most 255 characters, never a variable). A SIP address only works on calls to a SIP address and on numbers connected through your own SIP trunk (a manual SIP connection). Empty for a return entry; leave it out when you write one.'
          maxLength: 255
        action:
          allOf:
          - $ref: '#/components/schemas/TransferDestinationActionEnum'
          description: '"return" hands the call back to the contact center it came from: the agent says goodbye and hangs up, and headers go on the SIP BYE. A return entry has no number. It only works on calls to a SIP address and on numbers connected through your own SIP trunk (a manual SIP connection); other calls don''t offer it. Left out for a phone number or SIP address.


            * `return` - return'
        headers:
          type: object
          additionalProperties:
            type: string
            maxLength: 256
          description: 'Optional SIP headers sent with the transfer (on the SIP REFER of a cold transfer), as {name: value}. Up to 10; names start with X- (not X-TP-) or are User-to-User; values are at most 256 bytes and can use {{variables}}, filled when the call starts (a missing one is left empty). On a return entry they go on the SIP BYE instead, and only X-RouteType, X-RouteValue, X-RouteReason, X-CustomMetaData and User-to-User can be set. On a SIP address or return entry, {{handoff_summary}}, {{handoff_intent}} and {{handoff_id}} are filled at the transfer with what the agent tells the contact center (cut to 256 bytes); GET /v1/calls/handoff looks the call up by that id.'
        headers_in_uri:
          type: boolean
          description: 'SIP addresses only. true sends the headers inside the transfer''s Refer-To address (sip:queue@host?User-to-User=...&X-Call-ID=...) instead of as separate headers on the SIP REFER. Use it for contact centers that read the Refer-To, such as Twilio, Genesys Cloud and Talkdesk. The whole address is kept to 254 characters: User-to-User goes first and is cut to fit rather than left out, then the other headers in alphabetical order; one that doesn''t fit is left out whole, and the transfer still happens. Can''t be combined with a ?User-to-User= written into the address. Left out when false.'
        uui_encoding:
          description: 'SIP addresses and return entries. "hex" sends the User-to-User header hex-encoded with ;encoding=hex, the form most contact centers expect: write the value as plain text and it is encoded at the transfer, after {{variables}} are filled. Text that would make the encoded value longer than 256 bytes is cut first. Left out to send User-to-User as written.


            * `hex` - hex'
          oneOf:
          - $ref: '#/components/schemas/TransferDestinationUuiEncodingEnum'
          - $ref: '#/components/schemas/NullEnum'
        warm_only:
          type: boolean
          description: Phone numbers and variables only. true makes every transfer to this number a warm transfer, even when the agent asks for a cold one, and the agent is told so. If the person or line here doesn't take a warm transfer (no answer, busy, voicemail, declined), the agent doesn't try this number again on that call and offers the caller other next steps, such as taking a message; a warm call that fails on our side may be retried, cold. Warm transfers need a number that can place outbound calls; on a call that can't (a ThunderPhone number without outbound calling, a browser or widget call, a full-duplex agent) the transfer is cold, as is the silence final action's. Left out when false.
        answerer:
          type:
          - string
          - 'null'
          description: Phone numbers and variables only. The person who should pick up, e.g. "Matthew Ray". With the agent's Ask first style (warm_transfer_style ask_first), a warm transfer here first asks "Hi, is this Matthew Ray?" and says nothing about the caller until they confirm; then it briefs them and asks whether they can take the call. If someone else answers, the agent asks for this person and, if they aren't available, ends the side-call and tells the caller. Ignored by the other styles. Up to 60 characters, no line breaks or braces. "" or null removes it; left out when unset.
          maxLength: 60
        backup_numbers:
          type:
          - array
          - 'null'
          items:
            type: string
            minLength: 1
          description: 'Phone numbers and variables only. Up to 3 fixed phone numbers to ring next, in order, when a cold transfer here isn''t answered: "transfer to Max; if Max doesn''t pick up, transfer to Bob". The number that is busy, declines or rings for ring_seconds without an answer is hung up and the next one rings; the caller hears ringing throughout. The last number rings as long as a normal transfer, so its voicemail can take the call. A voicemail that picks up sooner counts as an answer, so keep ring_seconds shorter than the voicemail''s. Backup numbers need a number that can place outbound calls: ThunderPhone dials each leg itself (never a SIP REFER) and bills the connected time like any bridged transfer, at the rate of the number that answered. On a call that can''t (a browser or widget call, or a number without outbound calling) the transfer goes to the first number only. Warm transfers don''t use them. [] or null removes them; left out when unset.'
          maxItems: 3
        ring_seconds:
          type:
          - integer
          - 'null'
          maximum: 120
          minimum: 5
          description: With backup_numbers only. How long each number but the last rings before the next one is tried, 5 to 120 seconds. Defaults to 20 seconds when left out. Never longer than the last number's ring time (the agent's ring duration, or 45 seconds). Dropped without backup_numbers.
      required:
      - name
      - number
    AgentWordSpeakWithEnum:
      enum:
      - auto
      - ipa
      - say_as
      type: string
      description: '* `auto` - auto

        * `ipa` - ipa

        * `say_as` - say_as'
    ToolParametersRequest:
      type: object
      properties:
        type:
          type: string
          minLength: 1
          default: object
        properties:
          type: object
          additionalProperties: {}
        required:
          type: array
          items:
            type: string
            minLength: 1
    ToolDefinitionRequest:
      type: object
      properties:
        type:
          type: string
          minLength: 1
        function:
          $ref: '#/components/schemas/FunctionSpecRequest'
        endpoint:
          $ref: '#/components/schemas/ToolEndpointRequest'
        timeout: {}
        wait_mode:
          description: '"updates" (default): while the tool runs the agent says it is checking and gives short updates; timeout up to 180 seconds. "hold": the agent says one line, then the caller hears hold music until the result; timeout up to 600 seconds, and the endpoint may answer {"status": "pending", "request_id": ...} and deliver the result later with POST /v1/calls/{call_id}/tool-results.'
        mcp:
          type: object
          additionalProperties: {}
        provider:
          type: object
          additionalProperties: {}
        call_start:
          type: object
          additionalProperties: {}
          description: 'Run this tool at the start of every phone call, before the greeting: {"arguments": {...}}, one value per parameter (every required one included). Strings may use {{caller_number}}, {{caller_number_national}} and {{agent_number}}.'
        name:
          type: string
          minLength: 1
        description:
          type: string
          minLength: 1
        parameters:
          $ref: '#/components/schemas/ToolParametersRequest'
        url:
          type:
          - string
          - 'null'
          format: uri
          minLength: 1
        headers:
          type: object
          additionalProperties:
            type: string
            minLength: 1
    TransferDestinationUuiEncodingEnum:
      enum:
      - hex
      type: string
      description: '* `hex` - hex'
    IvrModeEnum:
      enum:
      - auto
      - 'on'
      - 'off'
      type: string
      description: '* `auto` - auto

        * `on` - on

        * `off` - off'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sk_live_…
      description: 'Organization API key. Send Authorization: Bearer sk_live_…; create a key in the dashboard.'
    humanToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'Human session token: Authorization: Token <session-token>. Organization API keys are rejected by key-management and account-control operations.'
x-mcp-server: https://api.thunderphone.com/v1/mcp