API Reference

AVSPro API

Resell realtime AI face-swap and voice-changer streaming sessions under your own product. One API key, a prepaid USD balance, and two endpoints — the underlying provider is never exposed, so it can change without breaking your integration.

Base URL
https://avspro.tech
Rate limit

60 requests / minute / key

Billing

Prepaid USD, charged on success

Authentication

Every request needs your API key as a bearer token. Keys look like avsp_live_... and are issued when your AVSPro API account is created — see the client portal to check your balance and usage, or contact us to get a key.

http
Authorization: Bearer avsp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Rate limits

Each API key is limited to 60 requests per minute, shared across every endpoint. A request over the limit gets a 429 with X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and Retry-After headers telling you exactly when to retry. Need a higher ceiling? Get in touch.

Endpoints

POST/api/v1/realtime/face-swap$2.8000 / minute

Realtime Face/Body Swap Session

Mints a realtime face/body-swap streaming session. You get back a stream URL and session token to connect to directly over WebSocket/LiveKit — your integration never talks to the underlying model provider.

Request body

FieldTypeRequiredNotes
durationMinutesnumberYesLength of the session, in minutes. Max 60.
idempotencyKeystringNoOptional — pass the same value on a retry to avoid double-charging.

Response

FieldTypeNotes
sessionIdstringUnique ID for this session.
streamUrlstringWebSocket/LiveKit URL to connect to.
sessionTokenstringToken to authenticate the stream connection.
maxDurationSecnumberHard cutoff for the session, in seconds.
priceUsdnumberWhat this call was charged.
balanceUsdnumberYour account balance after this charge.
curl
curl -X POST https://avspro.tech/api/v1/realtime/face-swap \
  -H "Authorization: Bearer avsp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "durationMinutes": 5,
    "idempotencyKey": "order-12345"
  }'
javascript
const res = await fetch("https://avspro.tech/api/v1/realtime/face-swap", {
  method: "POST",
  headers: {
    Authorization: "Bearer avsp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ durationMinutes: 5, idempotencyKey: "order-12345" }),
});

const session = await res.json();
// session.streamUrl, session.sessionToken
POST/api/v1/realtime/voice-swap$2.0000 / minute

Realtime Voice Changer Session

Mints a realtime speech-to-speech voice-changer session, same shape and transport as the face-swap endpoint above. Cold starts can take up to 1-2 minutes on the first call after idle time — that's upstream warm-up, not a broken request.

Request body

FieldTypeRequiredNotes
durationMinutesnumberYesLength of the session, in minutes. Max 60.
idempotencyKeystringNoOptional — pass the same value on a retry to avoid double-charging.

Response

FieldTypeNotes
sessionIdstringUnique ID for this session.
streamUrlstringWebSocket/LiveKit URL to connect to.
sessionTokenstringToken to authenticate the stream connection.
maxDurationSecnumberHard cutoff for the session, in seconds.
priceUsdnumberWhat this call was charged.
balanceUsdnumberYour account balance after this charge.
curl
curl -X POST https://avspro.tech/api/v1/realtime/voice-swap \
  -H "Authorization: Bearer avsp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "durationMinutes": 5
  }'
javascript
const res = await fetch("https://avspro.tech/api/v1/realtime/voice-swap", {
  method: "POST",
  headers: {
    Authorization: "Bearer avsp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ durationMinutes: 5 }),
});

const session = await res.json();

Errors

Errors are returned as { "error": "message" } with a matching HTTP status code.

StatusMeaning
400Bad request — missing/invalid field (e.g. durationMinutes out of range).
401Missing, malformed, or invalid API key.
402Insufficient balance for this call's cost.
429Rate limit exceeded — see Rate limits below.
502The upstream session provider failed to start the session.
503This endpoint is temporarily disabled by AVSPro.

Track your balance, usage, and top up your account in the client portal.

Go to portal