# A real-time voice session your platform configures with no agent

`POST /voice/platform/sessions` · Rivier · voice

A real-time voice session your platform configures with no agent: converse on your own instruction, interpret between two languages, or only transcribe; a live route, a catalogue voice, tools answered in the browser or posted signed to your server, your own metadata. Answers a single-use token bound to that configuration and one page origin, valid one minute; the same idempotency key answers the same session until it starts.

- Scope: voice:write
- Graphql: Mutation.voicePlatformSessionStart
- Sdk: voice.platformSession.start
- Cli: voice platform session start
- Events: voice.session.usage, voice.session.ended

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "converse",
        "translate",
        "transcribe"
      ]
    },
    "route": {
      "type": "string",
      "default": "live",
      "description": "A live route: live or live-thinking"
    },
    "instruction": {
      "type": "string",
      "maxLength": 8000,
      "default": "",
      "description": "What the voice is and does (converse); added guidance (translate, transcribe)"
    },
    "voice": {
      "type": "string",
      "default": "Kore",
      "description": "A voice id from GET /voice/catalogue"
    },
    "language": {
      "type": "string",
      "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$",
      "description": "The language spoken (converse, transcribe)"
    },
    "languages": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "items": [
        {
          "type": "string",
          "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"
        },
        {
          "type": "string",
          "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$"
        }
      ],
      "description": "The two languages an interpreter goes between (translate)"
    },
    "words": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 80
      },
      "maxItems": 200,
      "default": [],
      "description": "Names and terms to say and write as given"
    },
    "textOut": {
      "type": "boolean",
      "default": true,
      "description": "Send the words heard and said to the browser as text"
    },
    "keepWords": {
      "type": "boolean",
      "default": false,
      "description": "Keep the words after the session (never the sound); erasable by session or metadata"
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[a-zA-Z_][a-zA-Z0-9_]{0,63}$"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "parameters": {
            "type": "object",
            "additionalProperties": {},
            "default": {
              "type": "object",
              "properties": {}
            }
          },
          "answeredBy": {
            "type": "string",
            "enum": [
              "browser",
              "server"
            ],
            "description": "browser: the page answers inside the session; server: Rivier posts it, signed, to url"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 500
          },
          "timeoutMs": {
            "type": "integer",
            "minimum": 500,
            "maximum": 10000,
            "default": 5000
          }
        },
        "required": [
          "name",
          "description",
          "answeredBy"
        ],
        "additionalProperties": false
      },
      "maxItems": 20,
      "default": []
    },
    "maxMinutes": {
      "type": "integer",
      "minimum": 1,
      "maximum": 60,
      "default": 15
    },
    "origin": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "The page's origin the browser connects from"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 200
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          }
        ]
      },
      "default": {}
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    }
  },
  "required": [
    "kind",
    "origin",
    "idempotencyKey"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/voice/platform/sessions' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "kind": "converse",
  "origin": "string",
  "idempotencyKey": "string"
}'
```
