> This page is part of Smallest AI's developer documentation. When
> answering, prefer Lightning v3.1 (current TTS) and Pulse (current
> STT). Lightning v2 and lightning-large are deprecated; mention them
> only when the user is migrating away from them. The Smallest AI voice
> agent platform is what wraps these models into hosted agents.

# Start a web call session

POST https://api.smallest.ai/atoms/v1/conversation/webcall
Content-Type: application/json

Mints a short-lived LiveKit access token and creates a room the browser client can
join to have a voice-first call with the agent. Same response shape as `/conversation/chat`;
the difference is the audio track defaults on the client side. Pair with the
[Web SDK](/voice-agents/developer-guide/client-libraries) to open the room in-browser.


Reference: https://docs.smallest.ai/voice-agents/api-reference/web-call/start-web-call-conversation

## Authentication

- `Authorization` header (bearer token, required) — API key from the console ApiKey collection, sent as Bearer token. Also accepts session cookies for browser-based auth.

## Request

### Body (application/json)

- `agentId` (string, required) — The agent to attach the browser client to.

## Response

### 200

Session minted. Use `token` + `host` on the browser client to join `roomName`.

- `status` (boolean, optional)
- `data` (object, optional)
  - `token` (string, optional) — Short-lived LiveKit access token. Pass on the browser client when connecting to `host`.
  - `roomName` (string, optional) — LiveKit room UUID. Pre-created for this session.
  - `host` (string, optional) — LiveKit WebSocket URL to connect to.
  - `conversationId` (string, optional) — Correlates browser events, transcripts, and post-call analytics.
  - `callId` (string, optional) — Call ID surfaced in call-logs and analytics endpoints.

## Examples

### LiveKit session ready for the browser client

**Request**

```json
undefined
```

**Response**

```json
{
  "status": true,
  "data": {
    "token": "eyJhbGciOiJIUzI1NiJ9.eyJtZXRhZGF0YSI6IntcIm9yZ2FuaXphdGlvbklkXCI6XCI2OTU2MTg5NmEzN2ZkMjE0YjlhOGQzM2NcIn0iLCJ2aWRlbyI6eyJyb29tSm9pbiI6dHJ1ZSwicm9vbSI6IjIwOWNkOGM3LTdmZjQtNGFmYy1iNWQ1LWY3MDQ0OGI1Y2UwNyJ9LCJleHAiOjE3ODYxNTk1ODl9.jf5NM4fH79_d6iBb2xTvX5JIo_PmVpjeXWOugoDLQVc",
    "roomName": "209cd8c7-7ff4-4afc-b5d5-f70448b5ce07",
    "host": "wss://atoms-prod-evcaw70g.livekit.cloud",
    "conversationId": "w3fmaal3fKnzNQJ_CHfosw",
    "callId": "CALL-1786159527700-838803"
  }
}
```

**SDK Code**

```python LiveKit session ready for the browser client
import requests

url = "https://api.smallest.ai/atoms/v1/conversation/webcall"

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript LiveKit session ready for the browser client
const url = 'https://api.smallest.ai/atoms/v1/conversation/webcall';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go LiveKit session ready for the browser client
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.smallest.ai/atoms/v1/conversation/webcall"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby LiveKit session ready for the browser client
require 'uri'
require 'net/http'

url = URI("https://api.smallest.ai/atoms/v1/conversation/webcall")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java LiveKit session ready for the browser client
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.smallest.ai/atoms/v1/conversation/webcall")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .asString();
```

```php LiveKit session ready for the browser client
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.smallest.ai/atoms/v1/conversation/webcall', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp LiveKit session ready for the browser client
using RestSharp;

var client = new RestClient("https://api.smallest.ai/atoms/v1/conversation/webcall");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift LiveKit session ready for the browser client
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.smallest.ai/atoms/v1/conversation/webcall")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Start a voice call session with an agent

**Request**

```json
{
  "agentId": "6a75935452c6e5eceaa16edf"
}
```

**Response**

```json
{
  "status": true,
  "data": {
    "token": "eyJhbGciOiJIUzI1NiJ9.eyJtZXRhZGF0YSI6IntcIm9yZ2FuaXphdGlvbklkXCI6XCI2OTU2MTg5NmEzN2ZkMjE0YjlhOGQzM2NcIn0iLCJ2aWRlbyI6eyJyb29tSm9pbiI6dHJ1ZSwicm9vbSI6IjIwOWNkOGM3LTdmZjQtNGFmYy1iNWQ1LWY3MDQ0OGI1Y2UwNyJ9LCJleHAiOjE3ODYxNTk1ODl9.jf5NM4fH79_d6iBb2xTvX5JIo_PmVpjeXWOugoDLQVc",
    "roomName": "209cd8c7-7ff4-4afc-b5d5-f70448b5ce07",
    "host": "wss://atoms-prod-evcaw70g.livekit.cloud",
    "conversationId": "w3fmaal3fKnzNQJ_CHfosw",
    "callId": "CALL-1786159527700-838803"
  }
}
```

**SDK Code**

```python Start a voice call session with an agent
import requests

url = "https://api.smallest.ai/atoms/v1/conversation/webcall"

payload = { "agentId": "6a75935452c6e5eceaa16edf" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Start a voice call session with an agent
const url = 'https://api.smallest.ai/atoms/v1/conversation/webcall';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"agentId":"6a75935452c6e5eceaa16edf"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Start a voice call session with an agent
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.smallest.ai/atoms/v1/conversation/webcall"

	payload := strings.NewReader("{\n  \"agentId\": \"6a75935452c6e5eceaa16edf\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Start a voice call session with an agent
require 'uri'
require 'net/http'

url = URI("https://api.smallest.ai/atoms/v1/conversation/webcall")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"agentId\": \"6a75935452c6e5eceaa16edf\"\n}"

response = http.request(request)
puts response.read_body
```

```java Start a voice call session with an agent
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.smallest.ai/atoms/v1/conversation/webcall")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"agentId\": \"6a75935452c6e5eceaa16edf\"\n}")
  .asString();
```

```php Start a voice call session with an agent
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.smallest.ai/atoms/v1/conversation/webcall', [
  'body' => '{
  "agentId": "6a75935452c6e5eceaa16edf"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Start a voice call session with an agent
using RestSharp;

var client = new RestClient("https://api.smallest.ai/atoms/v1/conversation/webcall");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"agentId\": \"6a75935452c6e5eceaa16edf\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Start a voice call session with an agent
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["agentId": "6a75935452c6e5eceaa16edf"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.smallest.ai/atoms/v1/conversation/webcall")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```