VEXU mascot iconvexu.ai

DEVELOPERS

Build on your Vexu account.

Run agents, knowledge, and actions over HTTP. Open a live chat or voice session with a short-lived ticket. Or drop the website widget on a page. One account, three ways in.

Request
curl https://api.vexu.ai/api/public/v1/agents \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"

Base URLhttps://api.vexu.ai/api/public/v1

INTEGRATE

Three ways to integrate

Customer API

01
Who calls it
Your server
What the caller holds
An API key, vexu_live_…, sent as Authorization: Bearer.

Realtime session

02
Who calls it
Your server mints it. The browser or app only receives the ticket.
What the caller holds
A short-lived websocket URL. Never the API key.

Website widget

03
Who calls it
The visitor’s browser
What the caller holds
A widget key, wgt_…, in the page. Not an API key.

Who holds what

Customer API

Your servervexu_live_…
Vexu API

Realtime session

Your servervexu_live_…
mints a ticket
Browser / Appwss://… ticket
Vexu realtime

API key never leaves your server

Website widget

Visitor’s browserwgt_…
Vexu widget

PORTAL

What you manage in the portal

Developers in the portal is the operations view. Developers → Documentation is the in-app reference.

The page shows:

  • 1 Whether Customer API access is enabled for the account.
  • 2 The price per request for that account.
  • 2 The monthly allowance and how much is left.
  • 2 The shared per-minute limit.
  • 3 USD cost accrued this month.
  • 4 Daily request volume and cost for 7 days, 30 days, or the current month.
  • 5 A request log for the account.
  • · A path to billing when the allowance or access needs to change.

From the same page a developer can create, rotate, and revoke API keys. Creating and rotating work only while Customer API access is enabled. Revoking a key still works when access is off.

console.vexu.ai/developers
VEXU Portal, Developers dashboard: Customer API status, requests this month, remaining allowance, rate limit, accrued cost, a requests and cost chart, recent requests and API keys

API keys

API key options

The full secret is shown once, at creation. After that the portal shows a prefix and the last four characters.
OptionWhat it does
NameLabels the key so each service or environment can have its own.
ScopesThe only operations the key is allowed to call.
ExpirationOptional end date. After that the key is rejected.
IP allowlistOptional list of addresses that may use the key.
Per-minute rate limitOptional cap for that key. It cannot exceed the account’s per-minute maximum.
Create API key dialog with name, the 14 scope checkboxes, optional expiration, rate limit per minute and IP allowlist

Rotate a key when it may have leaked or when the person who held it leaves. Revoke a key to stop it immediately.

invalid_api_key

A missing, expired, or revoked key returns invalid_api_key.

insufficient_scope

A request outside the key’s scopes returns insufficient_scope.

Scopes

Scopes

Agents

Flows

Knowledge

Actions

Realtime

Usage

HTTP API

HTTP API

Every path below is relative to https://api.vexu.ai/api/public/v1.

meta.request_id on every response

Every successful and failed JSON response includes meta.request_id.

Send Idempotency-Key on mutating requests

Mutating requests should send Idempotency-Key. Reuse the same key only when retrying the same operation. A new operation needs a new key.

Creating an agent starts it as a draft. Deploy activates it. Provider secrets are not accepted or returned on this API.

GET /agents agents:read
GET /agents/{agent} agents:read
POST /agents agents:write
PUTPATCH /agents/{agent} agents:write
DELETE /agents/{agent} agents:write
POST /agents/{agent}/deploy agents:deploy
POST /agents/{agent}/actions agents:write
DELETE /agents/{agent}/actions/{action} agents:write
POST /agents/{agent}/knowledge-bases agents:write
DELETE /agents/{agent}/knowledge-bases/{knowledgeBase} agents:write

WebSocket

WebSocket

Connect to the URL from the session response, for example wss://api.vexu.ai/realtime/vxu_rt_….

Frames use version 1 and a request_id. Reuse a request_id only when retrying the same command.

Client → VexuVexu → Client
ClientVexu
connect
session.connected
chat.send
ack
chat.delta
chat.delta
chat.delta
chat.completed
Voice · LiveKit room
call.start
ack
call.ready
call.end
call.ended

Commands the client sends

CommandPurpose
session.resumeRestore session and call state after a reconnect, before the ticket expires.
chat.sendSend one text turn through the selected flow. Requires chat:write.
chat.cancelDrop a chat request the client no longer needs.
call.startAsk for a LiveKit room. Requires voice:write.
call.endEnd the call on the control plane. The client must also disconnect the media room.
pingApplication-level heartbeat. The socket also uses native ping/pong.
session.endRevoke the ticket and close the socket.

Events the server sends

EventPurpose
session.connectedTicket accepted. Includes capabilities, expiry, and current call state.
ackThe command was accepted.
chat.deltaOne ordered fragment of the reply. Append until chat.completed.
chat.completedThe full reply and the flow run id.
call.readyLiveKit url, token, room, and expires_in. Do not store the token.
call.endedThe control-plane call is over.
errorA stable error code. Scope and validation errors need a changed request. Transient errors can be retried with the same request_id.

Voice

Voice

Vexu issues the LiveKit token. The client joins the room with the LiveKit SDK. The client does not receive LiveKit server credentials.

The client is responsible for:

  • Asking for the microphone from a user gesture.
  • Mute and end controls.
  • Disconnecting the room when the call ends or the token expires.
  • Requesting a new token after expiry.

Website widget

Website widget

This is separate from the customer API key. A saved widget in the portal produces an embed snippet.

index.html
<script src="https://api.vexu.ai/widget/vexu-widget.js"></script>
<vexu-chat-widget widget-key="wgt_…"></vexu-chat-widget>
VEXU website widget: Talk to vexu header with a Call button, a greeting, suggested questions and a message field

The widget can:

  • Open a chat, a voice call, or both, according to the widget configuration.
  • Show a “Talk to VEXU” launcher, a header, suggestions, and an optional full-screen layout on small screens.
  • Auto-open when that behavior is turned on.
  • Accept optional client-context in HTML, or setClientContext() after the visitor logs in.
Client context is personalization only. It is not trusted for billing, package limits, or authorization. The widget key is not an API key. Do not put a vexu_live_ key in the page.
Portal Embed Code dialog: the embed snippet, a note that client context is untrusted, and examples of passing visitor context in HTML or with setClientContext() after login

Limits

Limits

ConditionResult
Customer API access is offCUSTOMER_API_DISABLED
Monthly request allowance is used upCUSTOMER_API_MONTHLY_LIMIT_EXCEEDED
Per-minute limit is hitRATE_LIMIT_EXCEEDED or rate_limit_exceeded, with Retry-After
Remaining minute budgetResponse header X-RateLimit-Remaining

Capped exponential backoff with jitter

waitjitter
1234567

Retry

429500502503504

Don’t retry unchanged

400401403404409422

Retry 429 and transient 500, 502, 503, and 504 with capped exponential backoff and jitter. Do not retry 400, 401, 403, 404, 409, or 422 unchanged.

A validation failure returns validation_error and field details. Fix the body before sending it again.

Production checklist

Production checklist

  • Keep API keys in a secret store. One key per service and environment.
  • Grant the smallest scope list the integration needs.
  • Set an expiration and an IP allowlist when the caller has a stable address.
  • Never put the API key in a browser bundle, a mobile app, a URL, or a log line.
  • Redact Authorization headers in error reporting.
  • Rotate after a suspected leak or a staff change.

Start from the portal.

Create a key, pick the scopes, and call the API. The in-app reference is under Developers → Documentation.

Open the portal

The portal login, the mobile app billing API, and the admin API are different products. A developer integration uses /api/public/v1, the realtime ticket, or the website widget.