> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rumik.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# start a web call

> start a voice-agent call and return the credentials a browser joins it with over webrtc. media flows browser ↔ agent directly. two ways in: `agentId` with an api key that has the `agent` scope starts the call in one hop — the call id is minted inside this request, so the agent's before-call tools receive it as `{call_id}` before you see it in the response. `accessToken` from `/v1/register-call` starts the call under the `call_id` that response already gave you, needs no api key, and is what to use when a before-call tool has to recognise the id, or when the page starts the call itself. either way the agent must be deployed and the returned `callId` identifies the call in conversations and usage.



## OpenAPI

````yaml /openapi.json post /v1/webcall
openapi: 3.1.0
info:
  title: silk api
  version: 1.0.0
  description: >-
    rumik ai's speech api. synthesize speech with the expressive `muga` model,
    the faster `mulberry` model or the multilingual `mulberry-1.6` model over
    http or a streaming websocket session, run conversational voice agents over
    webrtc, a realtime pcm socket or the phone, and manage everything the agents
    playground does — agents, voices, variables, tools, phone numbers, sip
    trunks and outbound calls — with the same api key.
  contact:
    name: rumik ai
    url: https://rumik.ai
servers:
  - url: https://silk-api.rumik.ai
    description: production
security:
  - bearerAuth: []
tags:
  - name: speech
    description: text-to-speech over HTTP and WebSocket.
  - name: voice agents
    description: start calls with a deployed agent from your own app.
  - name: agents
    description: build, configure, deploy and inspect your agents.
  - name: calls
    description: place outbound phone calls and read call history.
  - name: voices
    description: the voices, languages and styles an agent may use.
  - name: variables
    description: account-wide `{name}` prompt variables and their defaults.
  - name: tools
    description: HTTP tools agents call before or during a call.
  - name: phone numbers
    description: 'numbers rented through rumik: search, rent, connect, release.'
  - name: sip trunks
    description: bring your own numbers over SIP.
paths:
  /v1/webcall:
    post:
      tags:
        - voice agents
      summary: start a web call
      description: >-
        start a voice-agent call and return the credentials a browser joins it
        with over webrtc. media flows browser ↔ agent directly. two ways in:
        `agentId` with an api key that has the `agent` scope starts the call in
        one hop — the call id is minted inside this request, so the agent's
        before-call tools receive it as `{call_id}` before you see it in the
        response. `accessToken` from `/v1/register-call` starts the call under
        the `call_id` that response already gave you, needs no api key, and is
        what to use when a before-call tool has to recognise the id, or when the
        page starts the call itself. either way the agent must be deployed and
        the returned `callId` identifies the call in conversations and usage.
      operationId: startWebCall
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebCallRequest'
            examples:
              default:
                summary: one hop, with your api key
                value:
                  agentId: ua_fe3277d8
              registered:
                summary: a registered call, no api key
                value:
                  accessToken: wct_9f8c2b1e4d5a4e6fa7b8c9d0e1f2a3b4
      responses:
        '200':
          description: the call started; join with these credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebCallResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/AgentNotFound'
        '409':
          $ref: '#/components/responses/AgentNotDeployed'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/CapacityOrRateLimited'
        '502':
          $ref: '#/components/responses/AgentStartFailed'
        '503':
          $ref: '#/components/responses/Unavailable'
      security:
        - bearerAuth: []
        - {}
components:
  schemas:
    WebCallRequest:
      type: object
      description: exactly one of `agentId` or `accessToken`.
      oneOf:
        - required:
            - agentId
        - required:
            - accessToken
      properties:
        agentId:
          type: string
          example: ua_fe3277d8
          description: >-
            the agent to run — its uuid or its `ua_…` handle. `agent_id` is
            accepted too. needs your api key in `Authorization`.
        accessToken:
          type: string
          example: wct_9f8c2b1e4d5a4e6fa7b8c9d0e1f2a3b4
          description: >-
            the single-use `wct_` token from `/v1/register-call`. it is the
            credential on its own — no api key — and the call starts under that
            response's `call_id`. `access_token` is accepted too.
    WebCallResponse:
      type: object
      properties:
        token:
          type: string
          description: short-lived livekit access token for the browser to join with.
        host:
          type: string
          example: wss://livekit.rumik.ai
          description: livekit websocket url to connect to.
        roomName:
          type: string
          example: call-891e23fe503944c28dbf5e5a2a105190
          description: the room created for this call.
        callId:
          type: string
          format: uuid
          description: >-
            the call id, as shown in conversations and usage, and what your
            tools receive as `{call_id}`. for a registered call it is the
            `call_id` register-call already gave you.
    Error:
      type: object
      properties:
        error:
          type: string
          description: human-readable error message.
        code:
          type: string
          description: machine-readable error code.
    ConcurrencyLimitExceeded:
      type: object
      required:
        - error
        - code
        - active_requests
        - limit
      properties:
        error:
          type: string
          example: >-
            silk is already processing 2 requests for this account. try again
            when one finishes, or increase your plan capacity.
        code:
          type: string
          const: concurrency_limit_exceeded
        active_requests:
          type: integer
          minimum: 0
          example: 2
        limit:
          type: integer
          minimum: 1
          example: 2
  responses:
    Unauthorized:
      description: bearer token missing, invalid, or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentRequired:
      description: >-
        the account cannot fund the call (`insufficient_balance`), or is paused
        after a failed payment (`access_blocked`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: key revoked or account disabled.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    AgentNotFound:
      description: no such agent on this account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    AgentNotDeployed:
      description: >-
        the agent exists but has never been deployed, so no version is live to
        run.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: validation failed. check the error field.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    CapacityOrRateLimited:
      description: >-
        either a per-key rate limit or account-wide concurrent-request capacity
        was reached.
      headers:
        Retry-After:
          description: >-
            present for a rate-limit response; capacity failures do not include
            it.
          schema:
            type: integer
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/Error'
              - $ref: '#/components/schemas/ConcurrencyLimitExceeded'
    AgentStartFailed:
      description: the agent could not be started. safe to retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: upstream temporarily unavailable. retry shortly.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        your rumik api key, e.g. `rk_live_...`. create one in the rumik
        dashboard.

````