Developers / Agents
Start a live session with an agent
https://api.echonova.ai/v1/agents/{agentId}/sessionsStarts 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
Bearer, a space, then your API key, which starts with ek_. Create keys in the portal under Developers, API Keys.
Path parameters
The agent id, as GET /v1/agents returned it.
Request body
application/json
voice opens a room you join with the returned token; chat opens a text session. Defaults to voice.
Response
200 application/json Every response uses this envelope.
The result.
The session id; also the conversation id once it ends.
The agent id.
voice for a room you speak in, chat for a text session.
active while it is open; ended after you end it or it finishes; failed or out_of_credits when it stopped early.
When it started, as an ISO 8601 date-time.
When it ended; null while it is open.
The room token. It is sent once, here, and never again: keep it secret and hand it only to the client that joins.
The room address the client connects to with the token.
A chat session's first agent message, to show before the agent speaks; null for voice.
true for a successful call.
Repeats the HTTP status.
null on success.
Errors
Same envelope, with success false and data null. All errors
When. agentId or sessionId is not a 24-character hexadecimal id.
Fix. Use the id exactly as GET /v1/agents returned it.
When. channel is sent and is neither voice nor chat.
Fix. Send voice or chat, or leave channel out for voice.
When. The body or query carries a field the endpoint does not define.
Fix. Remove the field.
When. The Authorization header is missing or is not Bearer ek_..., no key matches the token, or the key is deleted, disabled or its account is closed.
Fix. Send Authorization: Bearer ek_... with an enabled key from this environment.
When. The workspace has no credits left to start a voice session; nothing was charged.
Fix. Add credits to the workspace.
When. The workspace has no credits left to start a chat session; nothing was charged.
Fix. Add credits to the workspace.
When. The workspace is on a trial and its AI allowance is used up; nothing ran and nothing was charged.
Fix. Upgrade the plan.
When. The workspace that owns the key has no subscription.
Fix. Check the workspace's plan in the portal.
When. The subscription is in a state other than active or trial.
Fix. Renew the subscription.
When. The key does not have the agents:talk scope.
Fix. Edit the key and give it the agents:talk scope, or use another key.
When. The member who created the key has left the workspace, or no longer has both the View agents and Manage developer API permissions. It is checked on every call.
Fix. Give that member both permissions again, or create a key as a member who has them.
When. The workspace is closed; nothing ran and nothing was charged.
Fix. Contact support to reopen the workspace.
When. The subscription has expired and no bought credits are left; nothing ran and nothing was charged.
Fix. Renew the subscription or buy credits.
When. The agent id is unknown, or the agent belongs to another workspace.
Fix. Use an id from GET /v1/agents with a key of the agent's workspace.
When. The agent is archived.
Fix. Restore it with POST /v1/agents/{agentId}/restore, then start the session.
When. A voice start found the agent already has as many calls open as it allows, the workspace's plan already has as many calls open at once as it allows, or the agent has had as many calls today as it allows.
Fix. Try again later.
When. The agent already has as many chats open as it allows, the workspace's plan already has as many chats open at once as it allows, or the agent has had as many chats today as it allows.
Fix. Try again later.
When. The JSON body is over 100 KB; the request is rejected before the API key is checked, so it has no Activity row.
Fix. Send a smaller body; long text belongs in several calls.
When. The request has a body whose Content-Type is not application/json.
Fix. Send Content-Type: application/json.
When. The key made more than 10 requests to this endpoint in 60 seconds; a Retry-After header carries the seconds to wait.
Fix. Wait Retry-After seconds, then retry.
When. An error the API did not classify.
Fix. Check the request, then retry after a short wait; contact support if it persists.
When. The agent runtime did not accept the session; no session is left open.
Fix. Try again later.
When. A transient outage inside the API.
Fix. Retry after a short wait.
When. A transient timeout inside the API.
Fix. Retry after a short wait.
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
}