---
title: "Single-shot Azure AI Foundry agent that generates a therapy recommendation from session metadata + wav2vec output. NO…"
method: POST
path: "/api/therapy-planning-agent"
tags: ["AI Agents"]
---

# Single-shot Azure AI Foundry agent that generates a therapy recommendation from session metadata + wav2vec output. NO…

`POST /api/therapy-planning-agent`

## Request

- Base URL: `https://platform.vocametrix.com`
- URL: `https://platform.vocametrix.com/api/therapy-planning-agent`
- Auth: API key in header `X-API-Key`

## Request body

- object
  - `session_metadata` object, required: REQUIRED. Object — must include `patient_id` (string). May also include `session_id`, `timestamp`, `audio_file`.
  - `wav2vec_output` object, required: REQUIRED. Object — must include `summary_statistics` (typically `{disfluency_types_detected, overall_fluency_rate, total_segments, ...}`).
  - `patient_anamnesis` string: Optional. Patient context — `demographics: {age}`, `clinical_history: {diagnosis, severity}`, `therapy_information: {current_treatment_approach, total_sessions_completed}`, etc.
  - `email` string: Optional. Used by the credit-validation flow.

## Response `200`

Successful response

- object
  - `success` boolean: Boolean.
  - `threadId` string: Azure AI Foundry thread ID (always a new thread for this endpoint).
  - `runId` string: Run ID.
  - `agentName` string: Agent identifier.
  - `status` string: Run status string.
  - `timestamp` string, date-time: ISO 8601 timestamp.
  - `recommendation` object: Object — preferred shape contains `primary_recommendation` and related structured fields when the agent's JSON parses successfully. Fallback shape on parse failure: { raw_response, structured_content: bool, analysis_summary }.
  - `allMessages` object[]: Array — full thread message history.
  - `remaining_credits` number: Number.
  - `metadata` object: Object: { patient_id, session_id, processing_time_seconds, disfluency_types, fluency_rate, total_segments_analyzed, response_metadata: {responseLength, containsStructuredData, parseSuccess} }.

## Other responses

- `400`: Bad request — missing or invalid parameter
- `401`: Unauthorized — missing or invalid API key
- `429`: Rate limit exceeded
- `500`: Server error

---

[API](https://skmtc.dev/vocametrix/apis/vocametrix-api.md) · [All operations](https://skmtc.dev/vocametrix/apis/vocametrix-api/llms.txt) · [OpenAPI document](https://skmtc.dev/vocametrix/apis/vocametrix-api/revisions/8a54d01bcc81?raw)
