LLMs API
LLMs API documentation for Java SDK
All URIs are relative to *http://localhost:8080*
| Method | HTTP request | Description |
|---|---|---|
| createLLM | POST /v1/llms | Create a new LLM |
| deleteLLM | DELETE /v1/llms/{id} | Delete an LLM |
| getLLM | GET /v1/llms/{id} | Get an LLM by ID |
| listLLMs | GET /v1/llms | List LLMs |
| updateLLM | PUT /v1/llms/{id} | Update an LLM |
createLLM
CreateLLMResponse createLLM(llMCreationRequest)
Create a new LLM
Creates a new LLM configuration for text generation services. LLMs represent connections to different language model API services (like OpenAI, vLLM, etc.) and include all the necessary configuration to use them for text generation. DUPLICATE DETECTION: Returns ALREADY_EXISTS if another LLM exists with identical {endpoint_url, api_path, model_identifier} after URL canonicalization. The api_path field defaults to '/v1/chat/completions' if omitted. Requires CREATE_LLM_OWN permission (or CREATE_LLM_ANY for admin users).
Example
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.auth.*;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.LlmsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("[http://localhost:8080](http://localhost:8080)");
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
LlmsApi apiInstance = new LlmsApi(defaultClient);
LLMCreationRequest llMCreationRequest = new LLMCreationRequest(); // LLMCreationRequest | LLM configuration details
try {
CreateLLMResponse result = apiInstance.createLLM(llMCreationRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LlmsApi#createLLM");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| llMCreationRequest | LLMCreationRequest | LLM configuration details |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 201 | Successfully created LLM with status information | * Location - URL of the created LLM resource |
| 400 | Invalid request - missing required fields or invalid format | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to create LLMs | - |
| 409 | Conflict - LLM already exists with identical owner_id, provider_type, endpoint_url, api_path, model_identifier, and credentials_fingerprint | - |
deleteLLM
deleteLLM(id)
Delete an LLM
Permanently deletes an LLM configuration. This operation cannot be undone and removes the LLM record and securely deletes stored credentials. IMPORTANT: This does NOT invalidate or delete any previously generated content using this LLM - existing generations remain accessible. Requires DELETE_LLM_OWN permission for LLMs you own (or DELETE_LLM_ANY for admin users).
Example
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.auth.*;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.LlmsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("[http://localhost:8080](http://localhost:8080)");
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
LlmsApi apiInstance = new LlmsApi(defaultClient);
String id = "550e8400-e29b-41d4-a716-446655440000"; // String | The unique identifier of the LLM to delete
try {
apiInstance.deleteLLM(id);
} catch (ApiException e) {
System.err.println("Exception when calling LlmsApi#deleteLLM");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | The unique identifier of the LLM to delete |
Return type
null (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | LLM successfully deleted | - |
| 400 | Invalid request - LLM ID in invalid format | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to delete this LLM | - |
| 404 | Not found - LLM with the specified ID does not exist | - |
getLLM
LLMResponse getLLM(id)
Get an LLM by ID
Retrieves the details of a specific LLM configuration by its unique identifier. Requires READ_LLM_OWN permission for LLMs you own (or READ_LLM_ANY for admin users to view any user's LLMs). This is a read-only operation with no side effects.
Example
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.auth.*;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.LlmsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("[http://localhost:8080](http://localhost:8080)");
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
LlmsApi apiInstance = new LlmsApi(defaultClient);
String id = "550e8400-e29b-41d4-a716-446655440000"; // String | The unique identifier of the LLM to retrieve
try {
LLMResponse result = apiInstance.getLLM(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LlmsApi#getLLM");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | The unique identifier of the LLM to retrieve |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved LLM | - |
| 400 | Invalid request - LLM ID in invalid format | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to view this LLM | - |
| 404 | Not found - LLM with the specified ID does not exist | - |
listLLMs
ListLLMsResponse listLLMs(ownerId, providerType, labelStar)
List LLMs
Retrieves a list of LLM configurations accessible to the caller, with optional filtering. PERMISSION-BASED FILTERING: With LIST_LLM_OWN permission, you can only see your own LLMs (owner_id filter is ignored if set to another user). With LIST_LLM_ANY permission, you can see all LLMs or filter by any owner_id. This is a read-only operation with no side effects.
Example
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.auth.*;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.LlmsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("[http://localhost:8080](http://localhost:8080)");
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
LlmsApi apiInstance = new LlmsApi(defaultClient);
String ownerId = "550e8400-e29b-41d4-a716-446655440000"; // String | Filter LLMs by owner ID. With LIST_LLM_ANY permission, omitting this shows all accessible LLMs; providing it filters by that owner. With LIST_LLM_OWN permission, only your own LLMs are shown regardless of this parameter.
String providerType = "OPENAI"; // String | Filter LLMs by provider type (e.g., OPENAI, VLLM, OLLAMA, etc.)
String labelStar = "?label.environment=production&label.team=ai"; // String | Filter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=ai)
try {
ListLLMsResponse result = apiInstance.listLLMs(ownerId, providerType, labelStar);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LlmsApi#listLLMs");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ownerId | String | Filter LLMs by owner ID. With LIST_LLM_ANY permission, omitting this shows all accessible LLMs; providing it filters by that owner. With LIST_LLM_OWN permission, only your own LLMs are shown regardless of this parameter. | [optional] |
| providerType | String | Filter LLMs by provider type (e.g., OPENAI, VLLM, OLLAMA, etc.) | [optional] |
| labelStar | String | Filter by label value. Multiple label filters can be specified (e.g., ?label.environment=production&label.team=ai) | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved LLMs | - |
| 400 | Invalid request - invalid filter parameters or pagination token | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to list LLMs | - |
updateLLM
LLMResponse updateLLM(id, llMUpdateRequest)
Update an LLM
Updates an existing LLM configuration including display information, endpoint configuration, model parameters, credentials, and labels. All fields are optional - only specified fields will be updated. IMPORTANT: provider_type is IMMUTABLE after creation and cannot be changed. Requires UPDATE_LLM_OWN permission for LLMs you own (or UPDATE_LLM_ANY for admin users).
Example
// Import classes:
import ai.pairsys.goodmem.client.ApiClient;
import ai.pairsys.goodmem.client.ApiException;
import ai.pairsys.goodmem.client.Configuration;
import ai.pairsys.goodmem.client.auth.*;
import ai.pairsys.goodmem.client.models.*;
import ai.pairsys.goodmem.client.api.LlmsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("[http://localhost:8080](http://localhost:8080)");
// Configure API key authorization: ApiKeyAuth
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.setApiKeyPrefix("Token");
LlmsApi apiInstance = new LlmsApi(defaultClient);
String id = "550e8400-e29b-41d4-a716-446655440000"; // String | The unique identifier of the LLM to update
LLMUpdateRequest llMUpdateRequest = new LLMUpdateRequest(); // LLMUpdateRequest | LLM update details
try {
LLMResponse result = apiInstance.updateLLM(id, llMUpdateRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LlmsApi#updateLLM");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String | The unique identifier of the LLM to update | |
| llMUpdateRequest | LLMUpdateRequest | LLM update details |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully updated LLM | - |
| 400 | Invalid request - ID format or update parameters invalid | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to update this LLM | - |
| 404 | Not found - LLM with the specified ID does not exist | - |