Skip to main content

REST API Reference

All interactions with uxopian-ai go through its REST API. This page provides a complete overview of the endpoints and how to access the interactive documentation.

For practical usage examples with cURL and JavaScript, see Using the REST API.


Interactive Documentation (Swagger UI)

The service exposes a full OpenAPI 3.1.0 specification. We highly recommend using the built-in Swagger UI for exploring the API, inspecting schemas, and testing requests in real-time.

Accessing Swagger UI

Depending on your environment, the Swagger UI is available at:

  • Local / Docker: http://localhost:8080/swagger-ui.html (Default port is 8080)

Note: If a custom CONTEXT_PATH is configured in application.yml, append it to the base URL (e.g., http://localhost:8080/ai/swagger-ui.html).

Public Access

The Swagger UI is publicly accessible (no authentication required). Endpoints are organized by tags prefixed with Admin - for admin operations, making it easy to explore the full API surface.


Authentication

The API expects authentication via headers injected by your Gateway or BFF. See Security Model for the full explanation.

HeaderRequiredDescription
X-User-TenantIdYesTenant isolation key.
X-User-IdYesUnique User ID.
X-User-RolesNoComma-separated roles (e.g., admin).
X-User-TokenNoOriginal user token for downstream context.

API Endpoints

Conversations

Manage the lifecycle of chat sessions.

MethodEndpointDescription
POST/api/v1/conversationsCreate a new conversation.
GET/api/v1/conversationsList user conversations (paginated).
GET/api/v1/conversations/{id}Retrieve full details of a conversation.
DELETE/api/v1/conversations/{id}Delete a conversation.

Requests (Chat)

Send messages and interact with the LLM.

MethodEndpointDescription
POST/api/v1/requestsSend a message and get a synchronous response.
POST/api/v1/requests/streamSend a message and receive the response as an SSE stream.
POST/api/v1/requests/retryRegenerate the last answer.

Query Parameters:

  • conversation (Required) — The conversation ID.
  • provider (Optional) — Override the LLM provider for this request.
  • model (Optional) — Override the LLM model for this request.

Administration — Prompts

Endpoints restricted to users with the admin role.

MethodEndpointDescription
POST/api/v1/admin/promptsCreate a new prompt.
PUT/api/v1/admin/promptsUpdate an existing prompt.
GET/api/v1/admin/prompts/{id}Get a specific prompt by ID.
DELETE/api/v1/admin/prompts/{id}Delete a prompt.

Administration — Goals

MethodEndpointDescription
POST/api/v1/admin/goalsCreate a new goal.
PUT/api/v1/admin/goalsUpdate an existing goal.
GET/api/v1/admin/goalsGet all goals.
DELETE/api/v1/admin/goals/{id}Delete a goal.

Administration — LLM Providers

Manage LLM provider configurations at runtime. See LLM Provider Management for the full UI guide.

MethodEndpointDescription
GET/api/v1/admin/llm/providersList all registered provider types (bean names).
GET/api/v1/admin/llm/provider-confList all provider configurations for the tenant.
GET/api/v1/admin/llm/provider-conf/{id}Get a specific provider configuration by ID.
POST/api/v1/admin/llm/provider-confCreate a new provider configuration.
PUT/api/v1/admin/llm/provider-conf/{id}Update an existing provider configuration.
DELETE/api/v1/admin/llm/provider-conf/{id}Delete a provider configuration.

Administration — Statistics

All statistics endpoints accept an optional interval query parameter to control time-series granularity. Supported values: HOUR, DAY, WEEK, MONTH, YEAR. Default: DAY.

MethodEndpointDescription
GET/api/v1/admin/stats/globalAggregate counters (total requests, tokens, time saved).
GET/api/v1/admin/stats/timeseries?interval=DAYTime-series activity data (requests, tokens over time).
GET/api/v1/admin/stats/llm-distributionModel usage distribution breakdown.
GET/api/v1/admin/stats/top-prompts-time-savedTop prompts ranked by estimated time saved.
GET/api/v1/admin/stats/feature-adoptionAdvanced feature adoption rates (multi-modal, function calling).