> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Plan Suggestions

# AI Plan Suggestions

Returns AI-generated suggestions for which membership plans are most suitable based on a natural language prompt.

The response includes an explanation and a list of preferred plan IDs that you can use to filter or preselect plans in the UI.

Terminology

* We refer to locations (backend term: businesses) as locations in this documentation.
* We refer to customers (backend term: coworkers) as customers in this documentation.

## Authentication

Requires an authenticated customer session.

## Query Parameters

<ParamField query="prompt" type="string" required>
  The user's natural language question or preference description. Example: "Which plan is best if I work 3 days a week and need meeting room access?"
</ParamField>

## Response

<ResponseField name="Response" type="object">
  AI result wrapper.
</ResponseField>

<ResponseField name="Response.Answer" type="string">
  Human-readable explanation answering the prompt.
</ResponseField>

<ResponseField name="Response.PreferredPlanIds" type="array[number]">
  List of plan IDs recommended by the assistant.
</ResponseField>

## Example Response

```json theme={null}
{
  "Response": {
    "Answer": "Based on your requirements, our Part-Time plan with meeting room add-ons is a great fit.",
    "PreferredPlanIds": [123, 456]
  }
}
```

## Usage in Portal

* Checkout – Plan selection step
  * `src/views/checkout/steps/TariffSignupStep.tsx` (filters visible plans by AI)
  * `src/views/checkout/steps/components/TariffAiPrompt.tsx`

## Related Endpoints

* `GET /api/public/ai/products` – Product suggestions by prompt
* `GET /api/public/ai/bookings` – Booking intent parsing and suggestions
* `GET /api/public/ai/chats/{sessionId}` – General-purpose assistant chat

## Error Responses

<ResponseField name="401 Unauthorized" type="error">
  The user is not authenticated.
</ResponseField>

<ResponseField name="400 Bad Request" type="error">
  Missing or invalid prompt.
</ResponseField>
