Developers / Agents

Start a live session with an agent

POST https://api.echonova.ai/v1/agents/{agentId}/sessions

Starts a voice or chat session, as the portal's Test button does, and returns a room token and address. The token is sent only in this response: join the room with it from your client, and end the session with POST /v1/agents/{agentId}/sessions/{sessionId}/end. Uses workspace credits, which do not count against this key's credit limit, and the agent's own chat and call limits apply. A retried start opens a second session. Needs the agents:talk scope on the key.

Headers

Authorization string Required

Bearer, a space, then your API key, which starts with ek_. Create keys in the portal under Developers, API Keys.

Path parameters

agentId string Required

The agent id, as GET /v1/agents returned it.

Request body

application/json

channel string Optional

voice opens a room you join with the returned token; chat opens a text session. Defaults to voice.

voice or chatdefault voice

Response

200 application/json Every response uses this envelope.

data object

The result.

success boolean

true for a successful call.

statusCode integer

Repeats the HTTP status.

errorMessage string or null

null on success.

Errors

Same envelope, with success false and data null. All errors

POST /v1/agents/{agentId}/sessions

curl -X POST "https://api.echonova.ai/v1/agents/{agentId}/sessions" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

{
  "data": {
    "id": "6651a1b2c3d4e5f6a7b8c9d0",
    "agentId": "6650a1b2c3d4e5f6a7b8c9d0",
    "channel": "voice",
    "status": "active",
    "startedAt": "2026-11-07T10:00:00.000Z",
    "endedAt": null,
    "token": "eyJhbGciOi...",
    "wsUrl": "wss://rooms.echonova.ai",
    "greeting": "Hello! How can I help?"
  },
  "success": true,
  "statusCode": 200,
  "errorMessage": null
}