---
title: "Create a client secret"
method: POST
path: "/v1/realtime/client_secrets"
tags: ["Realtime"]
---

# Create a client secret

`POST /v1/realtime/client_secrets`

## Request

- Base URL: `https://api.boson.ai`
- URL: `https://api.boson.ai/v1/realtime/client_secrets`
- Auth: HTTP bearer

Create a short-lived ephemeral key for a browser, mobile app, or other client-side Higgs Realtime connection. Call this endpoint from a trusted server with a valid Boson API key, then pass the returned key to the client.

## Request body

- CreateRealtimeClientSecretRequest
  - `expires_after` object
    - `seconds` integer: Client-secret lifetime in seconds.

## Response `200`

A short-lived Realtime client secret.

- RealtimeClientSecret
  - `object` 'realtime.client_secret', required
  - `value` string, required: Ephemeral key beginning with `bai-eph-`.
  - `expires_at` integer, required: Expiration time as Unix seconds.
  - `session` object, required
    - `id` string, required: Realtime session identifier.
    - `object` 'realtime.session', required

## Other responses

- `400`: Invalid request body, or ephemeral keys are not enabled.
- `401`: Missing or invalid API key.
- `429`: Billing entitlement refused. The OpenAI-style upstream error body is passed through.
- `500`: Client-secret generation failed.

## Changes

- **2026-11-03** `68bf7c248c4c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/boson/apis/boson-ai-api/changes/v1/realtime/client_secrets/post.md)

---

[API](https://skmtc.dev/boson/apis/boson-ai-api.md) - [All operations](https://skmtc.dev/boson/apis/boson-ai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/boson/apis/boson-ai-api/revisions/68bf7c248c4c?raw)
