connect11
DocsAPI · SDK · Console

Build on connect11.

The SDK, the REST API, and the console — everything you need to ship real-time voice, video, and AI agents on the 1‑TO‑ALL network.

Quickstart

Four steps to your first live call.

01

Install the SDK

One package for web. Native packages for iOS, Android, and React Native ship the same surface.

shell
# your project
npm install @connect11/client
02

Mint a token

Tokens are signed server-side with your key, then handed to the client. Your secret never leaves your backend.

server.ts
import { mintToken } from "@connect11/server";

const token = await mintToken({ room: "sales-7", identity: "agent-01" });
03

Join a room

Connect, subscribe to participants, and publish your mic. Voice and video share the same session.

app.ts
const room = await connect11.join("sales-7", { token });
room.on("participant", (p) => p.audio.subscribe());
await room.publishMic();
04

Put AI on the line

Attach a voice bot, chatbot, or live translator to any room — the agent joins like any other participant.

app.ts
await room.addAgent({
  type: "translator",
  from: "th", to: "en",
});

API keys & authentication

Create keys in the console, keep them server-side, and mint a short-lived token for every join. Your secret never touches the browser.

base URL
https://api.connect11.ai/api/v1
c11_live_xxxxxxxx_…

API key format: environment (live or test), an 8-character prefix you'll see in the console, and a secret shown once at creation. Store it in your secret manager.

Authorization: Bearer

Send the full key on every realtime API call. Keys carry the realtime:token and usage:read scopes.

Rotate

Rotating issues a new key immediately; the old key keeps working for 24 hours so you can roll deployments without downtime.

Revoke

Revoking stops a key immediately. Create, rotate, and revoke keys in the console under API keys — verification (KYC) is required once before your first key.

every realtime request
curl https://api.connect11.ai/api/v1/realtime/usage/summary \
  -H "Authorization: Bearer c11_live_xxxxxxxx_…"

REST API

One base URL, JSON in, JSON out. The realtime API uses your API key; the console API uses your email sign-in session.

Realtime API — API-key auth

POST/realtime/tokens

Mint a short-lived room token for one participant.

GET/realtime/usage/summary

Sessions, minutes, and spend for your account.

GET/realtime/usage/records

Per-session usage records with ledger references.

POST /realtime/tokens — request
{
  "room": "sales-7",          // 1–96 chars, A-Z a-z 0-9 _ -
  "identity": "user-42",      // same constraints
  "name": "Nok",              // optional display name
  "ttl_seconds": 600,         // optional, clamped 60–900
  "agents": [                 // optional AI agent dispatch
    { "type": "translator", "from": "th", "to": "en" }
  ]
}
in-person two-way — one device, two languages
// Two people share one phone. Pass the language PAIR and the
// agent auto-detects who's speaking, then speaks the other language.
{
  "room": "counter-1",
  "identity": "shared-phone",
  "agents": [
    { "type": "translator", "pair": ["th", "en"] }
  ]
}
response 200
{
  "token": "eyJhbGciOiJIUzI1NiIs…",
  "url": "wss://…",            // pass both straight to connect11.join()
  "expires_at": 1782561600,
  "agent_dispatch": "created"  // when agents were requested
}

Console API — email sign-in session

Everything the console does is an API you could call yourself after signing in with a one-time email code.

POST/console/auth/otp/request

Email a one-time sign-in code.

POST/console/auth/otp/verify

Exchange the code for an access + refresh token.

GET/console/me

Your account, verification status, and wallet balance.

POST/console/api-keys

Create an API key (shown once).

GET/console/api-keys

List keys by prefix, status, and last use.

POST/console/api-keys/{id}/rotate

New key now; old key keeps working for 24 h.

DELETE/console/api-keys/{id}

Revoke a key immediately.

GET/console/usage/summary

Same usage view the dashboard shows.

GET/console/wallet/ledger

Every credit and deduction, in order.

POST/console/topup

Start an online top-up — returns a secure checkout URL.

GET/console/topup/history

Past top-ups and their status.

SDK reference

Two packages. @connect11/client runs in the browser. @connect11/server runs next to your secrets.

@connect11/client

connect11.configure({ url })

Set the realtime endpoint once so join() can omit it. The token API response includes the right url.

connect11.join(room, opts)

Join with { token, url?, autoSubscribe? }. Returns a Room. The token is authoritative — it was minted for one room and identity.

room.publishMic() / publishCamera()

Start sending local audio or video. unpublishMic() stops the mic.

room.addAgent({ type, from?, to? })

Attach an AI agent — "translator", "voicebot", or "chatbot". Translator takes from/to language codes. You can also request agents at token mint.

room.on("participant" | "message" | "disconnected", cb)

Room events: a participant becomes available, a data message arrives { from?, text }, or the session ends. Chainable.

room.dial(number)

Telephony is enabled per project — this throws pstn_not_enabled until it's switched on for your account, rather than failing silently.

room.disconnect()

Leave and release camera and microphone.

participant.identity / name / isAgent

Who's in the room. p.audio.subscribe() and p.video.subscribe() control what you receive when autoSubscribe is off.

Connect11Error

Every SDK failure carries a stable code: no_url, pstn_not_enabled, or not_connected.

@connect11/server

mintToken(opts)

One call: { room, identity, name?, ttlSeconds?, canPublish?, canSubscribe?, canPublishData? } → signed JWT. Reads CONNECT11_API_KEY / CONNECT11_API_SECRET from the environment unless passed explicitly.

new AccessToken(key, secret, opts?)

Class form for finer control — .grantRoom(room, perms?) then .toJwt().

Usage & billing

Prepaid wallet, per-minute metering, every deduction a ledger entry you can audit in the console.

Prepaid wallet (THB)

Top up in the console — online checkout or bank transfer with your reference code. Funds appear as TOPUP ledger entries.

Per-minute metering

Participant minutes and AI-agent minutes are metered separately as sessions end. Rates are shown in your console; every deduction is a USAGE_DEDUCTION ledger entry.

Balance gate

When your balance reaches zero, new token mints return 402 until you top up. Sessions already running finish normally; sessions cap at 4 hours.

Audit trail

GET /realtime/usage/records ties every billed minute to a room, an identity, and a ledger entry.

Errors & limits

Stable error codes, honest failures, and the limits that keep the network healthy.

400

Validation — invalid_room, invalid_identity, invalid_agent_type, invalid_lang. Room and identity must match [A-Za-z0-9_-], 1–96 chars.

401

Invalid or expired API key — check the full key and its status in the console.

402

insufficient_balance or no_billable_wallet — top up in the console, then retry.

403

Key is missing a scope, or verification isn't complete yet.

429

rate_limited — token minting allows 60 per minute per key. Back off and retry; don't mint a token per render.

503

realtime_not_configured — the realtime endpoint isn't provisioned for this environment yet.

Token TTL

60–900 seconds, default 900. Mint a fresh token per join — don't cache them client-side.

For AI agents

Building with an AI copilot — or letting an agent integrate for you? Point it at our machine-readable docs. Exact signatures, the full auth flow, and a pre-flight checklist, with no guesswork.

Any agent can fetch these directly — no sign-in needed. The full guide covers install, token minting, joining, agents, error handling, and the mistakes to avoid.

Help & FAQ

What developers ask first — and a team you can actually reach.

Where do I get an API key?

Sign in to the console with your email, complete verification, and create a key under API keys. Keys start with c11_live_ or c11_test_ and are shown once — store them in your secret manager.

Can I use the SDK from the browser without a backend?

You need one small server piece: token minting. Your API key must never ship to the browser — mint a short-lived token server-side (REST or @connect11/server) and hand only the token to the client.

What happens when my balance runs out?

New token mints return 402 and joins pause until you top up. Sessions already running finish normally. Top up in the console — online payment or bank transfer.

How is usage billed?

Per participant-minute, with AI agent minutes metered separately. Rates are shown in your console, and every deduction appears in your wallet ledger.

Can I dial phone numbers?

Telephony is enabled per project on the 1‑TO‑ALL network. room.dial() throws a clear error until it's switched on for your account — talk to our team to enable it.

What's the difference between test and live keys?

Both speak the same API. Use c11_test_ keys while you build and c11_live_ keys in production, so you can rotate or revoke them independently.

Talk to the team that runs the network.

Contact 1650 · contact@1toall.co.th

Talk to our team