TinyMCE AI on-premises reference
Environment variable reference
Alphabetized. Required-ness is marked relative to a minimum working deployment.
| Variable | Required | Default | Description |
|---|---|---|---|
|
Recommended |
- |
Comma-separated list of CORS-allowed editor origins. Required for cross-origin editor deployments. See Cross-origin requests for format, wildcards, and verification. |
|
No |
- |
Read by the AWS SDK as a Bedrock API key. It takes priority over |
|
No |
- |
Path, inside the container, to a JSON configuration file. When set, the service reads its options from the file and ignores option environment variables. See Configuration file. |
|
Yes |
- |
Database name ( |
|
Yes |
- |
|
|
Yes |
- |
Database hostname or IP. |
|
Yes |
- |
Database password. |
|
No |
3306 (MySQL) / 5432 (PostgreSQL) |
Database port. |
|
PostgreSQL only |
|
PostgreSQL schema name. Pre-create or set to |
|
No |
- |
Path to CA cert for database Transport Layer Security (TLS). |
|
No |
- |
Path to client cert. |
|
No |
- |
Path to client key. |
|
Yes |
- |
Database user. |
|
No |
|
Emit JSON request logs to stdout. |
|
Yes |
- |
Management Panel login secret. Not used to sign user JSON Web Tokens (JWTs). |
|
No |
- |
In image version 1.2.0 and later, the Google auth library reads the service account key file that this variable points to, as part of the Application Default Credentials for Vertex AI. Ignored in earlier image versions. See Impersonation and host credentials. |
|
No |
- |
Alternative to the |
|
No |
- |
Alternative to the |
|
No |
- |
JSON object; per-operation guardrail configuration. Guardrails are off by default. See Guardrails. |
|
No |
- |
JSON object; hook endpoint, enabled hook events, and signing configuration. See Hooks. |
|
No |
Self-hosted Langfuse URL. |
|
|
No |
- |
Verbose Langfuse logging. |
|
If using Langfuse |
- |
Langfuse public key. |
|
If using Langfuse |
- |
Langfuse secret key. |
|
Yes |
- |
AI service license key (long string from Tiny). The same key is shared across all replicas of a deployment — no per-pod licensing is required. |
|
No |
|
Records spans for AI operations. See Observability. |
|
No |
180000 |
Per-request large language model (LLM) timeout in ms. Raise for large self-hosted models. |
|
No |
|
Lowest log level written to the container output. See Log levels. |
|
If using MCP OAuth |
- |
URL of the OAuth callback page hosted by the integrating web application. Used as the OAuth |
|
No |
- |
JSON object; Model Context Protocol (MCP) server configuration, keyed by server name. Supports static-token and OAuth 2.0 authentication per server, an environment allowlist, and connection pool limits. See MCP integration. |
|
Yes (Azure, Bedrock, Vertex, openai-compatible); recommended for all providers |
- |
JSON array defining exposed models. Required for Azure, Bedrock, Vertex, and openai-compatible providers, which have no default model list. Recommended for OpenAI, Anthropic, and Google direct, which come with a default model list that |
|
No |
- |
JSON object; content moderation configuration (turn the check on or off, and choose the moderation provider). A custom moderation endpoint requires image version 1.1.0 or later. See Content moderation. |
|
No |
- |
Verbose OpenTelemetry Protocol (OTLP) diagnostic logging. |
|
If using OTLP export |
- |
OTLP traces endpoint URL. The Langfuse export does not need it. |
|
No |
|
OTLP sampling rate (0.0 to 1.0). |
|
Yes |
- |
JSON object; LLM provider configuration. See LLM providers. |
|
No |
- |
Comma-separated |
|
No |
1 |
Redis database number. |
|
Yes |
- |
Redis hostname. |
|
No |
- |
Set to |
|
No |
- |
Redis password. |
|
No |
6379 |
Redis port. |
|
No |
- |
Path to CA cert for Redis TLS. |
|
No |
- |
Path to Redis client cert. |
|
No |
|
Enable Redis TLS. |
|
No |
- |
Path to Redis client key. |
|
No |
- |
Redis username (ACL). |
|
If using S3 |
- |
S3 access key. |
|
If using Azure Blob |
- |
Azure storage account key. |
|
If using Azure Blob |
- |
Azure storage account name. |
|
If using S3 |
- |
S3 bucket name. |
|
If using Azure Blob |
- |
Azure container name. |
|
Yes |
- |
|
|
No |
- |
Custom endpoint (S3-compatible or Azure-compatible). |
|
If using filesystem |
- |
Mount point for filesystem storage. Must be writable by the container user. |
|
If using S3 |
- |
S3 region. |
|
If using S3 |
- |
S3 secret access key. |
|
No |
|
Enable web scraping endpoint forwarding. See Web scraping. |
|
If web resources enabled |
- |
Scraper URL. |
|
No |
- |
Scraper request timeout in ms. |
|
No |
|
Enable web search forwarding. See Web search. |
|
If web search enabled |
- |
Search URL. |
|
No |
- |
Colon-CSV format ( |
|
No |
- |
Search request timeout in ms. |
Configuration file
The service can read its options from a JSON file instead of from environment variables. Set CS_CONFIG_PATH to the path of the file inside the container, and mount the file at that path:
docker run --init -d -p 8000:8000 \
--name ai-service \
-v /path/to/ai-service-config.json:/app/config.json:ro \
-e CS_CONFIG_PATH='/app/config.json' \
registry.containers.tiny.cloud/ai-service-tiny:<version>
The file holds one flat JSON object. Each key is an option name, and option names are case-insensitive, so license_key in the file and LICENSE_KEY as an environment variable name the same option. In the file, write options that take JSON, such as providers, models, and mcp_servers, as JSON values rather than as JSON strings:
{
"license_key": "<license-key>",
"environments_management_secret_key": "<management-secret>",
"database_driver": "mysql",
"database_host": "<database-host>",
"database_user": "<database-user>",
"database_password": "<database-password>",
"database_database": "ai_service",
"redis_host": "<redis-host>",
"storage_driver": "database",
"providers": {
"openai": { "type": "openai", "apiKeys": ["<openai-api-key>"] }
},
"models": [
{
"id": "gpt-4.1",
"provider": "openai",
"description": "OpenAI GPT-4.1",
"features": ["conversations", "reviews", "actions"]
}
]
}
The file and the environment variables are mutually exclusive. When CS_CONFIG_PATH is set, the service reads options only from the file and ignores option environment variables. There is no default file path. The exceptions are the telemetry variables, which start with OTEL_ or LANGFUSE_, and the variables that the provider SDKs read themselves, such as AWS_BEARER_TOKEN_BEDROCK, the AWS credential chain variables, and GOOGLE_APPLICATION_CREDENTIALS. The service and the SDKs read these from the process environment even when the rest of the configuration is in a file.
|
Two options behave differently in the file:
-
llm_telemetry_enabledis an ordinary option, so it can be set in the file, unlike theOTEL_andLANGFUSE_variables. -
websearch_headersaccepts either a JSON object, for example{"Authorization": "Bearer <token>"}, or the same colon-CSV string that theWEBSEARCH_HEADERSenvironment variable requires.
Complete docker run reference
A single command with all required environment variables for a minimal production deployment (MySQL, OpenAI, S3 storage):
docker run --init -d -p 8000:8000 \
--name ai-service \
-e LICENSE_KEY='<license-key>' \
-e ENVIRONMENTS_MANAGEMENT_SECRET_KEY='<management-secret>' \
-e DATABASE_DRIVER='mysql' \
-e DATABASE_HOST='<database-host>' \
-e DATABASE_PORT='3306' \
-e DATABASE_USER='<database-user>' \
-e DATABASE_PASSWORD='<database-password>' \
-e DATABASE_DATABASE='ai_service' \
-e REDIS_HOST='<redis-host>' \
-e REDIS_PORT='6379' \
-e PROVIDERS='{"openai":{"type":"openai","apiKeys":["<openai-api-key>"]}}' \
-e MODELS='[{"id":"gpt-4.1","provider":"openai","name":"GPT-4.1","description":"OpenAI GPT-4.1","features":["conversations","reviews","actions"]}]' \
-e STORAGE_DRIVER='s3' \
-e STORAGE_BUCKET='<s3-bucket-name>' \
-e STORAGE_REGION='<aws-region>' \
-e STORAGE_ACCESS_KEY_ID='<s3-access-key>' \
-e STORAGE_SECRET_ACCESS_KEY='<s3-secret-key>' \
-e ALLOWED_ORIGINS='https://<your-app-domain>' \
-e ENABLE_METRIC_LOGS='true' \
registry.containers.tiny.cloud/ai-service-tiny:<version>
For PostgreSQL, change DATABASE_DRIVER to 'postgres' and add -e DATABASE_SCHEMA='cs-on-premises' (or 'public'). For Redis authentication, add -e REDIS_PASSWORD='<redis-password>'. For Redis TLS, add -e REDIS_TLS_ENABLE='true'.
API endpoint reference
| Method | Path | Auth | Description |
|---|---|---|---|
GET |
|
None |
Liveness probe. Returns |
GET |
|
None |
Redirects (HTTP 301) to |
GET |
|
None |
ReDoc-rendered API documentation. |
GET |
|
None |
OpenAPI 3 JSON spec. |
GET |
|
Management secret (login form) |
Management Panel UI. Sign in with |
GET |
|
JWT |
List available models for the current token. The compatibility version literal |
POST |
|
JWT |
Create a conversation. Body must include client-supplied |
GET |
|
JWT |
List conversations for the current |
GET |
|
JWT |
Read one conversation. |
POST |
|
JWT |
Send a message. Returns Server-Sent Events (SSE) stream. |
POST |
|
JWT |
Fetch a web page through the configured scrape endpoint. Body: |
GET |
|
JWT |
List the web resources fetched for a conversation. |
DELETE |
|
JWT |
Remove a web resource from a conversation. |
POST |
|
JWT |
Upload a file to a conversation as |
DELETE |
|
JWT |
Remove a file from a conversation. |
POST |
|
JWT |
Add a document to a conversation. |
GET |
|
JWT |
Read one conversation document. |
DELETE |
|
JWT |
Delete a conversation. |
POST |
|
JWT |
Run a built-in quick action, for example |
POST |
|
JWT |
Run a built-in review, for example |
POST |
|
JWT |
Run a custom action with a prompt and a model. Returns an SSE stream. |
POST |
|
JWT |
Run a custom review with a prompt and a model. Returns an SSE stream. |
GET |
|
JWT |
Connection status for all OAuth-enabled MCP servers. See OAuth REST endpoints. |
POST |
|
JWT |
Start the OAuth authorization flow. |
POST |
|
JWT |
Complete the OAuth flow with the authorization code. |
DELETE |
|
JWT |
Revoke the OAuth connection for the calling user. |
GET, POST, PUT, DELETE |
|
JWT with |
List, register, read, update, and remove the MCP servers of the environment in the token. Image version 1.2.0 and later. See MCP server admin API, and for each operation, see MCP Server Admin in the API reference. |
The OAuth endpoints are available only when at least one MCP server has an oauth block configured. The interactive API documentation at /v1/api/docs may not include these endpoints; they are documented in the MCP OAuth section.
|
Environment management (create, read, update, delete) is handled through the Management Panel UI at /panel/.
|
Server-Sent Events reference
The message endpoint returns Content-Type: text/event-stream. Events use named types. The following table lists the main events. For every event and its payload, see the API reference.
| Event | Payload shape | Meaning |
|---|---|---|
|
|
Sent once at the start of each message. |
|
|
Incremental text fragment. The editor concatenates these. |
|
|
Emitted when an MCP tool call completes. |
|
|
Provider error. HTTP status remains 200; the error is in-stream. |
There is no end-of-stream event. The stream ends when the service closes the response.
Healthy stream example:
event: message-metadata
data: {"messageId":"abc123"}
event: text-delta
data: {"textDelta":"Hello "}
event: text-delta
data: {"textDelta":"there!"}
Error stream example:
event: message-metadata
data: {"messageId":"abc123"}
event: error
data: {"message":"Incorrect API key provided","cause":{"providerStatusCode":401}}
Browser client parsing notes:
-
Each event is two lines:
event: <name>anddata: <json>, separated from the next event by a blank line. -
datais always valid JSON. -
Unknown
eventtypes carry informational payloads and can be ignored for forward compatibility. -
text-deltacarries the visible reply text, andmodification-deltacarries the text of a proposed document modification.
Error code reference
Error codes returned in HTTP 4xx responses and inside SSE event: error payloads.
Every error response carries a traceId. See Tracing a failed request.
| Code | Origin | Likely cause | Fix |
|---|---|---|---|
|
JWT verifier |
Wrong API Secret, or used |
Re-sign with HS256 using the correct API Secret |
|
JWT verifier |
|
Re-copy env ID from |
|
JWT verifier |
Token >60 s past |
Issue tokens with shorter lifetime and refresh sooner |
|
AI runtime |
Same as |
Recreate env through Panel UI |
|
Permission checker |
|
Add the missing permission string |
|
Input validator |
Field validation failed (most commonly the 100,000 char prompt cap) |
Fix the request body. See error message |
|
AI runtime |
Same as |
Recreate through Panel UI |
|
Conversation runtime |
Stream-abort left stale state |
Start a new conversation |
|
Conversation runtime |
Follow-up to |
Start a new conversation |
|
Bedrock / Vertex adapter |
No credentials that the service can use |
See AWS Bedrock or Google Vertex AI |
|
Bedrock |
Missing model access or IAM permissions |
Enable Bedrock model access; attach the IAM policy from LLM providers |
|
Bedrock |
Anthropic on Bedrock without Marketplace subscription |
Subscribe through AWS Marketplace |
|
Bedrock |
Wrong model ID format (regional instead of cross-region) |
Use the inference profile ID for recent Claude models |
|
Azure |
|
Set |
|
Vertex |
Mangled |
Build |
|
Vertex |
|
|
|
Vertex |
Account-bound API key blocked by org policy |
Grant policy exception |
|
OpenAI / Anthropic / Google |
Bad API key |
Update |
|
AI service startup |
Truncated or whitespace-padded license key |
Re-paste as a single line |
License error with a reason |
License check |
In image version 1.2.0 and later, a license error in an API response states its reason |
Act on the stated reason, or contact Tiny support with it |
|
Guardrails |
A guardrail classified the content as an attack, such as prompt injection, or the content matched a blocklist phrase |
Review the content, or adjust the guardrail configuration. See Guardrails |
|
Content moderation |
The moderation provider flagged the prompt, an image uploaded to a conversation, or a file uploaded to the context library. |
Change the content, or adjust the moderation configuration. See Content moderation |
|
Hooks |
The configured hook endpoint did not complete successfully |
Check the hook endpoint logs using the |
|
Hooks |
The configured hook endpoint did not respond in time |
Check the hook endpoint availability and the hook timeout settings. See Hooks |
Known limits
| Limit | Value | Notes |
|---|---|---|
Maximum prompt length |
100,000 characters |
Hard limit enforced by the service. Requests exceeding this return |
Conversation create |
Client-supplied |
The plugin auto-generates |
Stream-abort recovery |
Stop button leaves stale state |
The next message returns |
Built-in rate limiting |
None |
Front the service with nginx |
File support (OpenAI-compatible providers) |
Images only ( |
PDFs, text, and Office files are not forwarded to OpenAI-compatible providers. Use a non-OpenAI-compatible provider for non-image file attachments. |
MCP tool availability |
Conversations, and Document Processing in image version 1.1.0 and later |
MCP tools are not available in reviews or quick actions. Document Processing skips OAuth-enabled servers. |
MCP authentication |
Static token or OAuth 2.0, configured independently for each server |
Static tokens use the |
PostgreSQL default schema |
|
Pre-create with |
|
Only accepts |
Values such as |
Environment creation through raw API |
Not supported |
Always create environments through the Management Panel UI. |
Bedrock credentials |
Inline only, in image versions earlier than 1.2.0 |
|
Vertex credentials |
Inline only, in image versions earlier than 1.2.0 |
|
Azure |
Must equal deployment name |
There is no separate |
OpenAI-compatible |
Must include |
Omitting it produces a "Not Found" SSE error. |