Skip to content
中文

Create Session Dictation Stream (Extension)

Call Create session first and replace the example session ID with its returned ID.

POST/agent/v1/sessions/{session_id}/dictations● Supported

Request parameters

  • session_idstringrequired

    path: Session id from session creation or listing.

  • hotwordsarrayoptional

    Words the recogniser should favour, at most 50.

Returns

201

Own-face extension. The body is optional: hotwords (at most 50 words the recogniser should favour). Returns 201 { id, push_url, expires_at }: id is the stream id (mst_...), push_url a wss address, expires_at when the address stops accepting a new connection. The speech-to-text model is the agent's dictation_model, or the platform default when it names none. Once connected to push_url, send one text frame {"type":"start","format":"pcm_s16le","sample_rate":16000,"channels":1}, then binary PCM frames of at most 64 KiB, then {"type":"stop"}; the text frames you receive are partial, final, done (with audio_seconds and cost_usd) and error. Each final carries end_ms, where that sentence ends in the audio you sent: if the connection drops, send what comes after the last end_ms to a new dictation. You may connect ahead of time: the stream waits up to 5 minutes for start; after start it closes after 30 s without a frame, and it carries at most 10 minutes of audio. push_url carries a short-lived capability: treat it as a secret and do not store or log it. A session that is missing or not yours returns 404; a model that cannot transcribe a live stream returns 409 DICTATION_UNCONFIGURED; dictation not available in this environment returns 503 DICTATION_UNAVAILABLE; more than 50 hotwords or an unsupported field returns 400.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Request

curl
# Call Create session first and replace the example session ID with its returned ID.
curl https://api.deepraxis.com/agent/v1/sessions/sesn_123/dictations \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hotwords":["Praxis","Ticket"]}'
Python
# Call Create session first and replace the example session ID with its returned ID.
import requests

opts = dict(
    base_url="https://api.deepraxis.com/agent",
    api_key="$PRAXIS_API_KEY",
)

# /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
resp = requests.post(
    f"{opts['base_url']}/v1/sessions/sesn_123/dictations",
    headers={"Authorization": f"Bearer {opts['api_key']}"},
    json={"hotwords":["Praxis","Ticket"]},
)
print(resp.status_code, resp.json())
TypeScript
// Call Create session first and replace the example session ID with its returned ID.
const opts = {
  baseURL: "https://api.deepraxis.com/agent",
  apiKey: "$PRAXIS_API_KEY",
};

// /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
const resp = await fetch(`${opts.baseURL}/v1/sessions/sesn_123/dictations`, {
  method: "POST",
  headers: { Authorization: `Bearer ${opts.apiKey}`, "Content-Type": "application/json" },
  body: JSON.stringify({"hotwords":["Praxis","Ticket"]}),
});
console.log(resp.status, await resp.json());

Response 201

{
  "id": "mst_6u2fbhmkh5uwpwfx7bptw73rl6",
  "push_url": "wss://realtime.deepraxis.com/v1/media-streams/mst_6u2fbhmkh5uwpwfx7bptw73rl6/push?token=REDACTED_PUSH_CAPABILITY",
  "expires_at": "2026-11-27T18:06:45.747Z"
}

Response

HTTP 201

The dictation stream and the address to push audio to

application/json

Name Type Description
id string The stream's id (mst_...).
push_url string The WebSocket address to push audio to (wss://...). It carries a short-lived capability: treat it as a secret, never store or log it, and open it once.
expires_at string When the address stops accepting a new connection, RFC 3339.