Add Language Model Endpoint
Add a new language model configuration at runtime.
Creates a new language model with the specified configuration and attempts to initialize it immediately. This allows adding models without restarting the server. The configuration is persisted to the configuration file.
Security Warning: API keys and credentials are stored in plain text in
the configuration file. Only use this API in protected environments. To
avoid storing secrets in plain text, use environment variable references
(e.g., "api_key": "$OPENAI_API_KEY") which will be resolved at runtime.
Supported providers:
openai-responses: OpenAI models using the Responses API (requires api_key, model)openai-chat-completions: OpenAI models using Chat Completions API (requires api_key, model)amazon-bedrock: AWS Bedrock models (requires region, model_id)
The response indicates whether the model was successfully initialized:
success: true, status: ready: Model is available for usesuccess: false, status: failed: Initialization failed (check error field)
If initialization fails, the model configuration is still stored and can be retried later using the retry endpoint when the underlying service becomes available.
Returns 422 if the provider type or configuration is invalid.
Documentation Index
Fetch the complete documentation index at: https://docs.memmachine.ai/llms.txt
Use this file to discover all available pages before exploring further.
Body
Specification for adding a new language model.
Unique name/identifier for the language model.The language model provider type (e.g., 'openai-responses', 'openai-chat-completions', 'amazon-bedrock').openai-responses, openai-chat-completions, amazon-bedrock Provider-specific configuration settings.Response
Successful Response

