allmodels.ioDocs
API ReferenceRealtime

Create a Realtime client secret

Creates credentials for an untrusted client, such as a browser or mobile app, to connect directly to AllModels without receiving your API key.

POST/v1/realtime/client-secrets

Creates credentials for an untrusted client, such as a browser or mobile app, to connect directly to AllModels without receiving your API key.

Authorization

BearerAuth
AuthorizationBearer <token>

Tenant key supplied as the Authorization Bearer token.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

Client
Language
import { writeFile } from "node:fs/promises";const response = await fetch("https://api.allmodels.io/v1/realtime/client-secrets", {  method: "POST",  headers: { ...{ Authorization: `Bearer ${process.env.ALLMODELS_API_KEY}` }, "Content-Type": "application/json" },  body: JSON.stringify({  "profile_id": "$REALTIME_PROFILE_ID",  "expires_in_seconds": 300})});if (!response.ok) throw new Error(`AllModels request failed: ${response.status}`);console.log(await response.json());
{  "session_id": "string",  "profile_id": "string",  "client_secret": {    "value": "string",    "expires_at": 0  },  "url": "string",  "property1": null,  "property2": null}
{  "error": "missing_api_key"}
{  "detail": {    "message": "this organization has insufficient prepaid balance",    "status": "insufficient_balance"  }}

{  "error": "tenant_disabled"}

{  "error": {    "type": "string",    "code": "string",    "message": "string",    "property1": null,    "property2": null  }}
{  "error": {    "type": "string",    "code": "string",    "message": "string",    "property1": null,    "property2": null  }}