The Trinity Beast – API Reference

Complete reference for the Listener Price Oracle (LPO) and Listener Report Service (LRS)

Region: us-east-2 (Ohio) LPO: https://api.cpmp-site.org LRS: https://lrs.cpmp-site.org UDP: udp.cpmp-site.org (2679/2680) Updated: May 2026 Endpoints: 50+

1. Authentication

All API requests require a Bearer token in the Authorization header.

Authorization Header Required on all requests
Authorization: Bearer YOUR_API_KEY

Your API key is provided after subscribing. Keep it secret — it identifies your account for billing and rate limiting.

⚠️ Security: Never expose your API key in client-side JavaScript or public repositories. Use environment variables or a backend proxy.

2. LPO – Listener Price Oracle

The LPO delivers real-time cryptocurrency prices with sub-2ms cached responses. Prices are sourced from 6 persistent WebSocket feeds (Coinbase, Gemini, Kraken, Gate.io, Crypto.com, OKX) — 150 prewarmed assets pushed in real-time with zero REST polling. REST fallback (GeminiCoinbaseKraken) activates only if all WebSocket feeds for an asset are stale.

2.1 GET /price

GET /price GET

Returns the current price for a cryptocurrency asset.

Query Parameters

ParameterTypeRequiredDescription
assetstringRequiredAsset symbol (e.g. btc, eth, sol). Case-insensitive.

Example Request

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.cpmp-site.org/price?asset=btc"

2.2 POST /prices NEW

POST /prices POST

Returns current prices for multiple cryptocurrency assets in a single request. Fetch up to 30 assets at once — perfect for portfolio dashboards, watchlists, and batch operations. The entire batch counts as 1 request against your rate limits and monthly quota, rewarding efficient API usage.

✅ Efficiency Incentive: A single /prices call with 30 assets counts as 1 request — not 30. Partners and developers who batch their requests are being good API citizens, and we reward that efficiency. Available on all tiers including Free.

Request Body

FieldTypeRequiredDescription
assetsstring[]RequiredArray of asset symbols (e.g. ["BTC", "ETH", "SOL"]). Case-insensitive. Maximum 30 assets per request. Duplicates are automatically deduplicated.

Example Request

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"assets": ["BTC", "ETH", "SOL", "DOGE", "XRP"]}' \
  "https://api.cpmp-site.org/prices"

Success Response (200 OK)

{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/prices] [200]",
  "status_code": 200,
  "endpoint": "/prices",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbts/v1",
  "timestamp": "2026-05-28T20:32:08Z",
  "data": {
    "prices": {
      "BTC": {
        "exchange": "coinbase-ws",
        "cached": true,
        "cache_age_seconds": 0.082,
        "timestamp": 1780000328,
        "price": "73551.36"
      },
      "ETH": {
        "exchange": "coinbase-ws",
        "cached": true,
        "cache_age_seconds": 0.081,
        "timestamp": 1780000328,
        "price": "2016.48"
      },
      "SOL": {
        "exchange": "coinbase-ws",
        "cached": true,
        "cache_age_seconds": 0.217,
        "timestamp": 1780000328,
        "price": "82.36"
      },
      "DOGE": {
        "exchange": "coinbase-ws",
        "cached": true,
        "cache_age_seconds": 4.501,
        "timestamp": 1780000324,
        "price": "0.09983"
      },
      "XRP": {
        "exchange": "coinbase-ws",
        "cached": true,
        "cache_age_seconds": 1.389,
        "timestamp": 1780000327,
        "price": "1.3207"
      }
    },
    "asset_count": 5,
    "resolved_count": 5,
    "failed": [],
    "latency_ms": 0,
    "duration_ms": 12,
    "monthly_usage": 4521,
    "monthly_limit": 100000,
    "usage_pct": 4.52,
    "usage_warning": "",
    "usage_status": "✅"
  },
  "error": ""
}

Response Fields (inside data)

FieldTypeDescription
pricesobjectMap of asset symbol → price data. Each entry contains exchange, cached, cache_age_seconds, timestamp, and price.
asset_countintNumber of unique assets requested (after deduplication)
resolved_countintNumber of assets successfully resolved
failedstring[]Array of asset symbols that could not be resolved (empty on full success)
latency_msintSum of exchange lookup latencies for cache misses (0 if all cached)
duration_msintTotal wall-clock processing time
monthly_usageintNumber of requests used this month
monthly_limitintMaximum requests allowed per month for your tier
usage_pctfloatCurrent usage as a percentage of monthly limit
usage_warningstringGraduated warning: "green" (≥85%), "yellow" (≥90%), "red" (≥95%), or ""
usage_statusstringVisual indicator: ✅, ✅🟡, ✅⚠️, or ✅🔴

Partial Success Response (some assets failed)

{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/prices] [200]",
  ...
  "data": {
    "prices": {
      "BTC": { "exchange": "coinbase-ws", "cached": true, ... },
      "ETH": { "exchange": "coinbase-ws", "cached": true, ... }
    },
    "asset_count": 3,
    "resolved_count": 2,
    "failed": ["FAKECOIN"],
    ...
  }
}
🎯 Better than the major exchanges: Most exchange batch endpoints (including Kraken) fail the entire request if a single asset is delisted, mistyped, or temporarily unavailable. Trinity Beast returns HTTP 200 with every asset that resolved in prices, and every asset that didn't in failed. One round-trip, useful data on the first call, no client-side retry logic required. Partial failures don't break your batch.

Error Response — Too Many Assets (400)

{
  "status": "🛑 [LPO] [us-east-2] [BeastMain] [/prices] [400]",
  "status_code": 400,
  "endpoint": "/prices",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbts/v1",
  "timestamp": "2026-05-28T20:32:23Z",
  "data": null,
  "error": "🛑 [LPO] [us-east-2] [BeastMain] [/prices] [400] Maximum 30 assets per request"
}
Deduplication: If you request ["BTC", "btc", "Btc"], the response will contain a single "BTC" entry. Asset symbols are normalized to uppercase and deduplicated before processing.

2.3 LPO Response Examples

Success Response (200 OK) — Cached Hit

{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/price] [200]",
  "status_code": 200,
  "endpoint": "/price",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbts/v1",
  "timestamp": "2026-04-12T14:23:01Z",
  "data": {
    "usage_status": "✅",
    "api_key_id": "key_abc123",
    "asset": "BTC",
    "price": "83421.57",
    "source": "coinbase-ws",
    "timestamp": 1744466581,
    "readable_timestamp": "2026-04-12T14:23:01Z",
    "latency_ms": 0,
    "duration_ms": 0,
    "cached": true,
    "cache_duration_seconds": 4.2,
    "monthly_usage": 42,
    "monthly_limit": 1000,
    "usage_pct": 4.2,
    "usage_warning": "",
    "ip_address": "203.0.113.42"
  },
  "error": ""
}

Success Response (200 OK) — Live Fetch

{
  "status": "✅ [LPO] [us-east-2] [BeastMirror] [/price] [200]",
  "status_code": 200,
  "endpoint": "/price",
  "cluster_node": "BeastMirror",
  "region": "us-east-2",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbts/v1",
  "timestamp": "2026-04-12T14:23:15Z",
  "data": {
    "usage_status": "✅",
    "api_key_id": "key_abc123",
    "asset": "ETH",
    "price": "3187.44",
    "source": "kraken",
    "timestamp": 1744466595,
    "readable_timestamp": "2026-04-12T14:23:15Z",
    "latency_ms": 38,
    "duration_ms": 38,
    "cached": false,
    "cache_duration_seconds": 0,
    "monthly_usage": 43,
    "monthly_limit": 1000,
    "usage_pct": 4.3,
    "usage_warning": "",
    "ip_address": "203.0.113.42"
  },
  "error": ""
}

Success Response — Graduated Usage Warnings

As monthly usage approaches the query limit, the data.usage_status field includes graduated warning indicators. Thresholds are runtime-tunable via application parameters.

🟡 Green Warning (≥85% of monthly limit)
{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/price] [200]",
  ...
  "data": {
    "usage_status": "✅🟡",
    ...
    "monthly_usage": 855,
    "monthly_limit": 1000,
    "usage_pct": 85.5,
    "usage_warning": "green",
    ...
  },
  "error": ""
}
⚠️ Yellow Warning (≥90% of monthly limit)
{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/price] [200]",
  ...
  "data": {
    "usage_status": "✅⚠️",
    ...
    "monthly_usage": 910,
    "monthly_limit": 1000,
    "usage_pct": 91.0,
    "usage_warning": "yellow",
    ...
  },
  "error": ""
}
🔴 Red Warning (≥95% of monthly limit)
{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/price] [200]",
  ...
  "data": {
    "usage_status": "✅🔴",
    ...
    "monthly_usage": 960,
    "monthly_limit": 1000,
    "usage_pct": 96.0,
    "usage_warning": "red",
    ...
  },
  "error": ""
}
⚠️ Graduated Usage Warnings: As data.monthly_usage approaches data.monthly_limit, the response includes graduated indicators at three configurable thresholds:
  • Green (85%)✅🟡 — Heads up: usage is climbing
  • Yellow (90%)✅⚠️ — Caution: approaching your limit
  • Red (95%)✅🔴 — Critical: near your monthly limit
The usage_warning field is an empty string ("") when usage is below the green threshold. The usage_pct field is always present. Both fields appear in every response — the JSON schema is always consistent. Thresholds are configurable via usage_warning_green_pct, usage_warning_yellow_pct, and usage_warning_red_pct application parameters.

Response Fields

The /price endpoint returns the standard 12-field UME envelope. Price data is nested inside the data field:

Envelope Fields (top level)
FieldTypeDescription
statusstringColor-coded bracket line: ✅ [LPO] [us-east-2] [BeastMain] [/price] [200]
status_codeintHTTP status code as integer
endpointstringThe URL path that handled the request
cluster_nodestringContainer that served the request (BeastMain, BeastMirror, BeastLRS)
regionstringAWS region — us-east-2
languagestringISO 639-1 language code for human-readable content
timestampstringRFC 3339 UTC timestamp of response generation
dataobjectPrice data payload (see below). null on error.
errorstringEmpty string on success. Full bracketed error message on failure.
Price Data Fields (inside data)
FieldTypeDescription
usage_statusstring✅ on success, ✅🟡 at green warning, ✅⚠️ at yellow warning, ✅🔴 at red warning
api_key_idstringYour API key
assetstringUppercase asset symbol
pricestringCurrent price in USD (formatted to 9 decimal places, trailing zeros trimmed)
sourcestringPrice source tag. WebSocket (real-time): coinbase-ws, gemini-ws, kraken-ws, gateio-ws, cryptocom-ws, okx-ws. REST fallback: coinbase, gemini, kraken, gateio, cryptocom, okx.
timestampint64Unix timestamp of the price
readable_timestampstringRFC3339 formatted timestamp
latency_msint64Time to fetch price from exchange (0 on cache hit)
duration_msint64Total request processing time including validation
cachedboolWhether the response was served from cache
cache_duration_secondsfloat64Age of cached value in seconds (0 if live fetch)
monthly_usageintNumber of queries used this month
monthly_limitintMaximum queries allowed per month for your tier
usage_pctfloat64Current usage as a percentage of monthly limit (always present)
usage_warningstringGraduated warning level: "green" (≥85%), "yellow" (≥90%), "red" (≥95%), or "" (empty string when below green threshold). Always present.
ip_addressstringClient IP address

3. LRS – Listener Report Service

The LRS provides access to your API usage history and aggregated statistics. Included with every subscription tier.

3.1 GET /reports/usage

GET /reports/usage GET

Returns paginated usage log entries for your API key.

Query Parameters

ParameterTypeRequiredDefaultDescription
api_key_idstringOptionalFilter by API key ID
assetstringOptionalFilter by asset symbol (e.g. BTC)
start_datestringOptional93 days agoStart date in YYYY-MM-DD format
end_datestringOptionalTodayEnd date in YYYY-MM-DD format
cachedboolOptionalFilter by cache status: true or false
pageintOptional1Page number
page_sizeintOptional100Records per page (max 1000)
formatstringOptionaljsonOutput format: json, csv, tsv, text

Example Requests

# JSON (default)
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://lrs.cpmp-site.org/reports/usage?asset=BTC&page=1&page_size=50"

# CSV download
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://lrs.cpmp-site.org/reports/usage?format=csv" -o usage.csv

# Tab-delimited
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://lrs.cpmp-site.org/reports/usage?format=tsv" -o usage.tsv

# Plain text
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://lrs.cpmp-site.org/reports/usage?format=text"

3.2 GET /reports/summary

GET /reports/summary GET

Returns aggregated statistics for a date range.

Query Parameters

ParameterTypeRequiredDefaultDescription
api_key_idstringOptionalFilter by API key ID
start_datestringOptional30 days agoStart date in YYYY-MM-DD format
end_datestringOptionalTodayEnd date in YYYY-MM-DD format
formatstringOptionaljsonOutput format: json, csv, tsv, text

3.3 Output Formats

✅ New: LRS endpoints now support four output formats to make it easy to import data into spreadsheets, databases, or other systems.
FormatContent-TypeUse Case
jsonapplication/jsonDefault. Best for programmatic consumption and APIs.
csvtext/csvComma-separated. Import into Excel, Google Sheets, or any CSV-compatible tool.
tsvtext/tab-separated-valuesTab-delimited. Ideal for databases, ETL pipelines, and tools that handle commas in data.
texttext/plainHuman-readable plain text. Good for quick terminal review or log files.

3.4 LRS Response Examples

Usage Report — JSON

{
  "logs": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "api_key_id": "key_abc123",
      "asset": "BTC",
      "price": 83421.57,
      "source": "coinbase",
      "cached": true,
      "latency_ms": 7,
      "duration_ms": 7,
      "ip_address": "203.0.113.42",
      "timestamp": 1744466581,
      "readable_timestamp": "2026-04-12T14:23:01Z",
      "cache_age_seconds": 4.2
    }
  ],
  "total_count": 1482,
  "page": 1,
  "page_size": 100,
  "filters": {
    "asset": "BTC"
  }
}

Usage Report — CSV

id,api_key_id,asset,price,source,cached,latency_ms,duration_ms,ip_address,timestamp,readable_timestamp,cache_age_seconds
a1b2c3d4-e5f6-7890-abcd-ef1234567890,key_abc123,BTC,83421.57000000,coinbase,true,7,7,203.0.113.42,1744466581,2026-04-12T14:23:01Z,4.200

Usage Report — Text

LRS Usage Report — Page 1 | Page Size 100 | Total Records 1482
================================================================================
[2026-04-12T14:23:01Z] a1b2c3d4... | Asset: BTC | Price: 83421.57000000 | Source: coinbase | Cached: true | Latency: 7ms | IP: 203.0.113.42

Summary Report — JSON

{
  "total_requests": 14820,
  "cache_hit_rate": 91.4,
  "avg_latency_ms": 9.3,
  "by_asset": {
    "BTC": 6210,
    "ETH": 4105,
    "SOL": 2380,
    "DOGE": 1240,
    "XRP": 885
  },
  "by_source": {
    "coinbase": 13540,
    "kraken": 1180,
    "gemini": 100
  },
  "date_range": {
    "start": "2026-03-13",
    "end": "2026-04-12"
  }
}

Summary Report — Text

LRS Summary Report — 2026-03-13 to 2026-04-12
============================================================
Total Requests  : 14820
Cache Hit Rate  : 91.40%
Avg Latency     : 9.30ms

By Asset:
  BTC        6210
  ETH        4105
  SOL        2380

By Source:
  coinbase     13540
  kraken       1180
  gemini       100

4. Supported Assets & Exchanges

The Trinity Beast LPO serves 150 prewarmed assets across 6 exchanges via persistent WebSocket connections. Each exchange maintains 25 unique assets with zero overlap — every asset is served by exactly one exchange. Prices arrive in real-time (push-based) before any request is made.

Exchange Overview

ExchangeSource TagWebSocket EndpointPair SuffixAssets
Coinbasecoinbase-wswss://advanced-trade-ws.coinbase.comUSD25
Geminigemini-wswss://ws.gemini.comUSD25
Krakenkraken-wswss://ws.kraken.com/v2USD25
Gate.iogateio-wswss://api.gateio.ws/ws/v4/USDT25
Crypto.comcryptocom-wswss://stream.crypto.com/exchange/v1/marketUSD25
OKXokx-wswss://ws.okx.com:8443/ws/v5/publicUSDT25

Assets by Exchange

Coinbase (25 assets)

BTC · ETH · SOL · DOGE · XRP · LINK · DOT · LTC · AVAX · UNI · PEPE · XLM · ETC · ICP · RENDER · BONK · BCH · JASMY · AXS · CHZ · STORJ · ZEC · DASH · CGLD · NEAR

Gemini (25 assets)

AAVE · ATOM · ARB · CRV · GRT · FIL · SHIB · BAT · LRC · MASK · ANKR · SKL · API3 · QNT · HYPE · LPT · HNT · UMA · JTO · CTX · POL · PNUT · POPCAT · DRIFT · CUBE

Kraken (25 assets)

NANO · SC · LSK · KAVA · BICO · RARI · OCEAN · CFG · CQT · ALGO · FET · FLOW · XTZ · QTUM · ICX · ASTR · ENJ · EGLD · COTI · MINA · GLMR · MOVR · KSM · TEER · CRO

Gate.io (25 assets)

BNB · TRX · APT · SEI · INJ · OP · SUI · VET · HBAR · SAND · MANA · S · CHR · FLR · THETA · CELR · REEF · DENT · HOT · POND · IOTX · ALICE · SUPER · FLUX · ONE

Crypto.com (25 assets)

TON · WLD · APE · BLUR · IMX · ENS · LDO · SNX · COMP · 1INCH · SUSHI · GALA · MAGIC · ORDI · PIXEL · RUNE · ARKM · DYM · GMX · CRO · TAO · AGLD · AR · AUDIO · POL

OKX (25 assets)

TIA · JUP · STRK · PYTH · W · ZRO · PENDLE · ONDO · WIF · FLOKI · NOT · AEVO · ENA · ETHFI · TURBO · NEIRO · DOGS · HMSTR · EIGEN · BOME · KAITO · GRASS · BANANA · ACE · TNSR

REST Fallback Sources (used only when WebSocket feeds are stale)

PrioritySourceSource TagTimeoutWeight
1Geminigemini120ms0.15
2Coinbasecoinbase100ms0.50
3Krakenkraken80ms0.35

REST fallback is rarely triggered — with 6 WebSocket feeds pushing prices in real-time, the cache hit rate is 98.5%+. REST sources are only consulted when an asset's WebSocket price is older than the cache_ttl_seconds threshold (currently 300 seconds).

ℹ️ Asset symbols are case-insensitive in requests. Responses always return uppercase. Use the GET /asset-categories endpoint for a category-grouped listing of all available assets. The GET /exchanges endpoint returns the full exchange configuration including WebSocket endpoints and asset mappings.

5. Error Codes & Response Convention

Status Indicators

IndicatorMeaningWhen It Appears
SuccessEvery successful price response (usage below green threshold)
✅🟡Success with green warningMonthly usage is at or above 85% of your limit (configurable via usage_warning_green_pct)
✅⚠️Success with yellow warningMonthly usage is at or above 90% of your limit (configurable via usage_warning_yellow_pct)
✅🔴Success with red warningMonthly usage is at or above 95% of your limit (configurable via usage_warning_red_pct)
⚠️Rate limit warningMonthly query limit reached or QPS rate limit exceeded
🛑ErrorInvalid request, authentication failure, or server error

Error Response Format

All error responses use the unified response envelope with color-coded bracket convention. The status field shows the indicator and origin metadata. The error field contains the full bracketed message.

{
  "status": "🛑 [LPO] [us-east-2] [BeastMain] [/price] [401]",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbts/v1",
  "status_code": 401,
  "endpoint": "/price",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "timestamp": "2026-04-26T16:20:03Z",
  "error": "🛑 [LPO] [us-east-2] [BeastMain] [/price] [401] Missing required API key parameter"
}

Rate Limit Warning (429)

{
  "status": "🛑 [LPO] [us-east-2] [BeastMirror] [/price] [429]",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbts/v1",
  "error": "🛑 [LPO] [us-east-2] [BeastMirror] [429] ⚠️ Monthly query limit reached. You have used 1000 of 1000 allowed queries this month. Upgrade your plan for higher limits.",
  "code": 429,
  "region": "us-east-2",
  "cluster_node": "BeastMirror"
}

HTTP Status Codes

HTTP StatusMeaningCommon Cause
400Bad RequestMissing or invalid asset parameter.
401UnauthorizedMissing, invalid, or revoked API key.
429Too Many RequestsMonthly query limit reached or QPS rate limit exceeded. Message includes your current usage and limit.
500Internal Server ErrorAll price sources (WebSocket + REST) failed or database connectivity issue.
503Service UnavailableElastiCache health check failed.

6. Rate Limits by Tier

TierRequests/MonthLRS IncludedPrice
Free1,00010 reports/month$0/mo
Pro50,00010 reports/month$30/mo
Enterprise500,00010 reports/month$100/mo
UnlimitedUnlimitedUnlimited$300/mo
LifetimeUnlimited foreverUnlimited forever$3,000 one-time
AWS PartnerUnlimited — no rate limitingUnlimited$0 — always free
ℹ️ LRS Add-on: Existing subscribers can add unlimited LRS access for $20/month.
AWS Partner Tier: The exchanges we depend on share their data with us at no cost — we pass that forward. If your AWS application needs live crypto prices, partner keys provide unlimited access with no rate limiting, no monthly caps, and no billing. Partners connect via AWS PrivateLink (TCP) or VPC Peering (UDP) directly to containers. See the Partner Onboarding Guide for setup details.

7. Endpoint Summary

ServiceProtocolEndpointPort
LPO (Price API)HTTPShttps://api.cpmp-site.org443
LRS (Reports)HTTPShttps://lrs.cpmp-site.org443
LPO (UDP)UDPudp.cpmp-site.org2679
LRS (UDP)UDPudp.cpmp-site.org2680
PrivateLink (LPO)TCPVPC Endpoint → NLB8080
PrivateLink (LRS)TCPVPC Endpoint → NLB9090
ℹ️ PrivateLink: AWS Partners connect via PrivateLink (TCP) or VPC Peering (UDP) for private VPC-to-VPC connectivity without traversing the public internet. Partner keys have zero rate limiting and zero monthly caps. See the Partner Onboarding Guide.

Public Endpoints

MethodPathDescription
GET/exchangesPublic exchange asset list for demo dropdown
GET/asset-categoriesAsset categories for demo dropdown NEW
GET/map/pinsMission impact map pins
POST/translateReal-time text translation (AWS Translate, cached in ElastiCache)
GET/searchFull-text document search (Valkey-indexed, multi-lingual) NEW
POST/support/submitSubmit support ticket
GET/support/ticketsList tickets by email
GET/support/ticket/{ticket_number}View ticket detail
GET/support/resolveOne-click ticket resolve via email link. Query: ?token=.... Single-use, 30-day TTL. NEW
POST/demo/registerDemo lead registration NEW
POST/partner/applyPartner application submission
GET/partner/statusPartner application status check
POST/newsletter/subscribeNewsletter subscribe
GET/newsletter/unsubscribeNewsletter unsubscribe
GET/newsletter/resubscribeNewsletter resubscribe
GET/admin/bootstrap-keyOne-time admin key setup
GET/checkoutPublic checkout redirect (Stripe Payment Link) NEW
GET/public/statusPublic system status — nodes, feeds, uptime (no auth)
GET/public/clusterPublic ECS cluster stats — per-node metrics, cache hit rates (no auth) NEW

Admin Endpoints

MethodPathDescription
GET/admin/configView application parameters
GET/admin/setup-demoSetup demo API key
GET/admin/invalidate-keyInvalidate API key cache
GET/admin/demo-modeToggle demo/performance mode
GET/admin/system-modeSwitch system profile
GET/admin/reload-paramsForce parameter reload
GET/admin/profilesList system profiles NEW
GET/admin/stress-statsReal-time 24-counter metrics
GET/admin/stress-resetReset metrics counters
GET/admin/cluster-statsCluster-wide aggregated metrics NEW
POST/admin/build-search-indexRebuild full-text search index from all 32 docs NEW
GET/admin/feed-statusPrice feed status (all 6 exchanges)
GET/admin/usage-analyticsUsage log analytics
GET/admin/adaptive-statsAdaptive governor stats
GET/admin/db-insightsPostgreSQL self-observability (cache hit, top queries, scan health) NEW
GET/admin/exchange-feedsList exchange configurations
POST/admin/exchange-feeds/saveCreate/update exchange
POST/admin/exchange-feeds/toggleEnable/disable exchange
DELETE/admin/exchange-feedsRemove exchange
GET/admin/exchange-assetsList asset mappings
POST/admin/exchange-assets/saveCreate/update asset mappings
POST/admin/exchange-assets/toggleFlip enabled/prewarm on single asset NEW
DELETE/admin/exchange-assetsRemove asset mappings
POST/admin/eam/syncSync EAM → application_parameters NEW
GET/admin/eam/auditStart 4-layer prewarm audit (async) NEW
GET/admin/eam/audit?poll=1Poll for audit results NEW
POST/admin/eam/discoverStart asset discovery for exchange (async) NEW
GET/admin/eam/discover?exchange=okx&poll=1Poll for discovery results NEW
GET/admin/partner-applicationsList partner applications
POST/admin/partner-applications/{id}/statusUpdate application status
POST/admin/sqlExecute SQL (read/write) NEW
POST/admin/sql-batchExecute SQL batch (DDL allowed) NEW
POST/admin/valkeyExecute ElastiCache commands NEW
GET/admin/payment-linksList payment links NEW
POST/admin/payment-links/saveCreate/update payment link NEW
POST/admin/payment-links/toggleEnable/disable payment link NEW
POST/admin/test-refund-emailSend test refund email (dummy data, any language) NEW
POST/admin/test-finalize-emailSend test translation completion email with per-language cost breakdown NEW

Newsletter Admin Endpoints

MethodPathDescription
GET/admin/newsletter/templatesList templates
GET/admin/newsletter/templates/{id}Get template
POST/admin/newsletter/templatesSave template
DELETE/admin/newsletter/templates/{id}Delete template
GET/admin/newsletter/newslettersList newsletters
GET/admin/newsletter/newsletters/{id}Get newsletter
POST/admin/newsletter/newslettersSave newsletter
POST/admin/newsletter/newsletters/{id}/statusToggle status
POST/admin/newsletter/newsletters/{id}/sendSend newsletter
GET/admin/newsletter/subscribersList subscribers

Email Admin Endpoints

MethodPathDescription
GET/admin/email/templatesList email templates
GET/admin/email/templates/{id}Get template
POST/admin/email/templatesSave template
DELETE/admin/email/templates/{id}Delete template
GET/admin/email/sendersList senders
POST/admin/email/sendersSave sender
DELETE/admin/email/senders/{id}Delete sender
GET/admin/email/draftsList drafts
GET/admin/email/drafts/{id}Get draft
POST/admin/email/draftsSave draft
DELETE/admin/email/drafts/{id}Delete draft
POST/admin/email/drafts/{id}/sendSend email

Support Admin Endpoints (X-Admin-Key)

MethodPathDescription
GET/support/admin/statsTicket statistics — counts by status (total, new, open, in_progress, awaiting_customer, resolved, closed)
GET/support/admin/ticketsList all tickets. Filters: ?status=, ?category=, ?email=. Ordered by updated_at DESC
GET/support/admin/tickets/{id}Full ticket detail by UUID — includes all replies (internal notes visible), translations, preferred_lang
POST/support/admin/tickets/{id}/updateUpdate ticket fields. Body: {"status":"...", "category":"..."} (at least one required)
POST/support/admin/tickets/{id}/replyAdd reply. Body: {"author":"...", "message":"...", "is_internal": false}. Auto-translates + emails customer
GET/support/admin/ticket/{ticket_number}Full ticket by ticket number — includes AutoOps Bedrock analysis from Valkey

Dashboard Customer Support Endpoints (Bearer Token)

MethodPathDescription
GET/dashboard/api/support/ticketsList authenticated user's tickets. Scoped to session email. Ordered by most recent.
GET/dashboard/api/support/tickets/{ticket_number}Ticket detail with reply thread. Excludes internal admin notes. Shows translated replies in customer's language.
POST/dashboard/api/support/tickets/{ticket_number}/replyPost customer reply. Body: {"message":"..."}. Max 10,000 chars. Auto-translates to English. Notifies admin.
POST/dashboard/api/support/tickets/{ticket_number}/resolveMark own ticket as resolved. Notifies admin. Closed tickets cannot be resolved.

Dashboard Admin Support Endpoints (Bearer Token + Admin Role)

MethodPathDescription
GET/dashboard/api/admin/support/ticketsList all tickets system-wide. Filters: ?status=, ?category=. Limit 200. Ordered by created_at DESC.
GET/dashboard/api/admin/support/tickets/{id}Full ticket detail by UUID — includes all replies (internal notes visible), customer IP, email.
POST/dashboard/api/admin/support/tickets/{id}/replyPost admin reply. Body: {"message":"...", "is_internal": false}. Translates + emails customer. Includes one-click resolve link.
POST/dashboard/api/admin/support/tickets/{id}/statusUpdate ticket status. Body: {"status":"open"}. Valid: new, open, in_progress, awaiting_customer, resolved, closed. Audit-logged.

Dashboard Admin Analytics Endpoints (Bearer Token + Admin Role)

MethodPathDescription
GET/dashboard/api/admin/analyticsUsage analytics from Aurora. ?mode=detail (default, paginated rows) or ?mode=summary (aggregates via a single GROUPING SETS query with p50/p95/p99 latency percentiles). Date filters: ?start_date=, ?end_date=. CSV export via ?format=csv.
GET/dashboard/api/admin/daily-rollupPer-day usage rollup served from the mv_usage_daily materialized view (fast, never scans usage_logs). ?days= (default 30, max 93). Returns totals, latency percentiles, cache-hit rate, cardinality, and a last_refreshed timestamp. NEW

8. UDP Protocol Access

Both LPO and LRS support UDP for low-latency, connectionless access. UDP is ideal for high-frequency price polling where occasional packet loss is acceptable.

LPO UDP — Price Queries UDP 2679

Send a UDP datagram to udp.cpmp-site.org:2679 with your API key and asset.

# Python UDP example
import socket, json

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
request = json.dumps({"api_key": "YOUR_API_KEY", "asset": "btc"}).encode()
sock.sendto(request, ("udp.cpmp-site.org", 2679))
data, addr = sock.recvfrom(4096)
print(json.loads(data))
LRS UDP — Report Queries UDP 2680

Send a UDP datagram to udp.cpmp-site.org:2680 for usage reports and summaries.

# Python UDP example
import socket, json

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
request = json.dumps({"api_key": "YOUR_API_KEY", "type": "summary"}).encode()
sock.sendto(request, ("udp.cpmp-site.org", 2680))
data, addr = sock.recvfrom(65535)
print(json.loads(data))

9. Network & Connectivity

Access Methods

MethodUse CaseLatency
HTTPS (ALB)Standard API access from any client~50ms
UDP (NLB)High-frequency polling, low-latency price feeds~10ms
PrivateLink (NLB)Private VPC-to-VPC access, no public internet~5ms

PrivateLink Configuration

Enterprise subscribers can connect via AWS PrivateLink. Both LPO (TCP 8080) and LRS (TCP 9090) are available through the same PrivateLink endpoint. Create a VPC endpoint in your AWS account pointing to our PrivateLink service.

Data Sync

Usage logs are written to Aurora Serverless v2 by the LPO in real-time. A nightly sync job (1 AM EST) copies usage data from Aurora to ElastiCache for fast LRS report generation. Reports reflect data up to the previous day's sync.

10. Unified Response Envelope

Every HTTP endpoint in The Trinity Beast returns a consistent JSON envelope. This makes responses self-reporting — each response tells you which endpoint handled the request, which ECS container answered, and which AWS region served it.

Success Envelope

{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/health] [200]",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbts/v1",
  "status_code": 200,
  "endpoint": "/health",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "timestamp": "2026-04-26T16:20:03Z",
  "data": { "message": "Health Check - OK" }
}

Error Envelope

{
  "status": "🛑 [LPO] [us-east-2] [BeastMain] [/price] [401]",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbts/v1",
  "status_code": 401,
  "endpoint": "/price",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "timestamp": "2026-04-26T16:20:03Z",
  "error": "🛑 [LPO] [us-east-2] [BeastMain] [/price] [401] Missing required API key parameter"
}

Color-Coded Status Indicators

Every response uses a color-coded emoji indicator followed by bracketed origin metadata. This convention matches the usage logs, application logs, and subscriber-facing error messages — consistent across all messaging.

IndicatorColorMeaningHTTP Codes
GreenSuccess200, 201
🛑RedError400, 401, 403, 404, 429, 500, 503
⚠️YellowWarning / Redirect3xx
✅🔴Green + RedSuccess with critical warning (usage ≥ 95%)200 (with usage_warning: "red")
✅⚠️Green + YellowSuccess with caution warning (usage ≥ 90%)200 (with usage_warning: "yellow")
✅🟡Green + GoldSuccess with green warning (usage ≥ 85%)200 (with usage_warning: "green")
ℹ️BlueInformationalUsed in logs
🟠AmberDebugUsed in logs
ℹ️ Plain-Text Response Format: By default, all responses use the emoji status indicators shown above (the Trinity Beast Convention format). If your system does not render emoji well, you can request plain-text responses by submitting a support ticket through our Support page. Once enabled, all status indicators will use text equivalents: OK, OK - NOTE: usage above 85%, OK - WARNING: approaching monthly query limit, OK - CRITICAL: near monthly query limit, and ERROR. This setting applies to both LPO and LRS responses for your API key.

Bracket Convention

The bracket format self-reports the origin of every message at a glance:

INDICATOR [SERVICE] [REGION] [NODE] [ENDPOINT] [CODE] message

Example: 🛑 [LPO] [us-east-2] [BeastMirror] [/admin/config] [403] Invalid admin key

This convention is used consistently across:

Envelope Fields

FieldTypeDescription
statusstringColor-coded bracket line: ✅ [LPO] [us-east-2] [BeastMain] [/health] [200]
languagestringISO 639-1 language code declaring the language of all human-readable content in this response (e.g., "en", "ja", "es"). Determined by the user's api_lang setting. Default: "en".
status_codeintHTTP status code as an integer for programmatic parsing
endpointstringThe URL path that handled the request (self-reporting)
cluster_nodestringWhich ECS container answered: BeastMain, BeastMirror, or BeastLRS
regionstringAWS region — us-east-2
timestampstringRFC 3339 UTC timestamp of when the response was generated
dataobjectThe actual response payload (omitted on errors)
errorstringFull bracketed error message with indicator (only present on errors)
⚠️ Full UME Compliance: As of May 2026, the /price endpoint uses the standard 12-field UME envelope. Price data is nested inside the data field. All endpoints — including /price — return the same envelope shape.
ℹ️ UDP Note: UDP responses use a zero-allocation binary format for performance and do not include the envelope.

Diagram 10.1 — Request Flow & Response Envelope

Diagram 10.1 — Request Flow & Response Envelope
flowchart LR
    A["Client Request"] --> B["⚖️ ALB / NLB"]
    B --> C{"ECS Container"}
    C --> D["BeastMain"]
    C --> E["BeastMirror"]
    C --> F["BeastLRS"]
    D --> G["WriteJSON / WriteError"]
    E --> G
    F --> G
    G --> H["Unified Envelope"]
    H --> I["status: ok | error"]
    H --> J["endpoint: /path"]
    H --> K["cluster_node: BeastX"]
    H --> L["region: us-east-2"]
    H --> M["timestamp: RFC3339"]
    H --> N["data / error payload"]

    style A fill:#334155,stroke:#475569,color:#cbd5e1
    style B fill:#334155,stroke:#475569,color:#cbd5e1
    style C fill:#2d4a5e,stroke:#475569,color:#cbd5e1
    style D fill:#2d4a5e,stroke:#475569,color:#cbd5e1
    style E fill:#2d4a5e,stroke:#475569,color:#cbd5e1
    style F fill:#2d4a5e,stroke:#475569,color:#cbd5e1
    style G fill:#3d3455,stroke:#475569,color:#cbd5e1
    style H fill:#FF9900,stroke:#cc7a00,color:#0f172a
    style I fill:#1e293b,stroke:#475569,color:#94a3b8
    style J fill:#1e293b,stroke:#475569,color:#94a3b8
    style K fill:#1e293b,stroke:#475569,color:#94a3b8
    style L fill:#1e293b,stroke:#475569,color:#94a3b8
    style M fill:#1e293b,stroke:#475569,color:#94a3b8
    style N fill:#1e293b,stroke:#475569,color:#94a3b8
        

11. Complete Endpoint Inventory

Comprehensive inventory of every registered route across The Trinity Beast services.

50+
Total Endpoints
14
Public
35+
Admin
TCP, UDP
Protocols
LPO, LRS
Services
MethodPathAuthServiceCategoryDescription
🏥 Health & Status
GET/healthNoneLPOHealthHealth check
GET/healthNoneLRSHealthHealth check
Price
GET/priceBearerLPOPriceFetch real-time crypto price
Reports
GET/reports/usageBearerLRSReportsUsage detail report
GET/reports/summaryBearerLRSReportsUsage summary report
GET/reports/report-usageBearerLRSReportsReport access detail
GET/reports/report-summaryBearerLRSReportsReport access summary
Public
GET/exchangesNoneLPOExchange MgmtExchange asset list
GET/asset-categoriesNoneLPOExchange MgmtAsset categories for demo dropdown
GET/map/pinsNoneLPOSystemMission impact map pins
POST/translateNoneLPOTranslationReal-time text translation via AWS Translate (ElastiCache cached)
GET/searchNoneLPOSearchFull-text document search — query + lang params, returns ranked results with snippets
POST/support/submitNoneLPOSupportSubmit support ticket
GET/support/ticketsNoneLPOSupportList tickets by email
GET/support/ticket/{ticket_number}NoneLPOSupportView ticket detail
POST/demo/registerNoneLPOSystemDemo lead registration
POST/partner/applyNoneLPOPartnersPartner application
GET/partner/statusNoneLPOPartnersPartner application status
POST/newsletter/subscribeNoneLPONewsletterNewsletter subscribe
GET/newsletter/unsubscribeNoneLPONewsletterNewsletter unsubscribe
GET/newsletter/resubscribeNoneLPONewsletterNewsletter resubscribe
GET/admin/bootstrap-keyNoneLPOSystemOne-time admin key setup
Admin — System
GET/admin/configAdmin KeyLPOSystemView application parameters
GET/admin/setup-demoAdmin KeyLPOSystemSetup demo API key
GET/admin/invalidate-keyAdmin KeyBothSystemInvalidate API key cache
GET/admin/demo-modeAdmin KeyLPOSystemToggle demo/performance mode
GET/admin/system-modeAdmin KeyLPOSystemSwitch system profile
GET/admin/reload-paramsAdmin KeyLPOSystemForce parameter reload
GET/admin/profilesAdmin KeyLPOSystemList system profiles
MethodPathAuthServiceCategoryDescription
📈 Admin — Metrics & Monitoring
GET/admin/stress-statsAdmin KeyLPOMetricsReal-time 24-counter metrics
GET/admin/stress-resetAdmin KeyLPOMetricsReset metrics counters
GET/admin/cluster-statsAdmin KeyLPOMetricsCluster-wide aggregated metrics
GET/admin/feed-statusAdmin KeyLPOMetricsPrice feed status (all 6 exchanges)
GET/admin/usage-analyticsAdmin KeyLPOMetricsUsage log analytics
GET/admin/adaptive-statsAdmin KeyLPOMetricsAdaptive governor stats
GET/admin/db-insightsAdmin KeyLPOMetricsPostgreSQL self-observability — cache hit ratio, top queries, scan health
POST/admin/db-insights/resetAdmin KeyLPOMetricsReset pg_stat_statements baseline for a clean measurement window
MethodPathAuthServiceCategoryDescription
🔄 Admin — Exchange Management
GET/admin/exchange-feedsAdmin KeyLPOExchange MgmtList exchange configurations
POST/admin/exchange-feeds/saveAdmin KeyLPOExchange MgmtCreate/update exchange
POST/admin/exchange-feeds/toggleAdmin KeyLPOExchange MgmtEnable/disable exchange
DELETE/admin/exchange-feedsAdmin KeyLPOExchange MgmtRemove exchange
GET/admin/exchange-assetsAdmin KeyLPOExchange MgmtList asset mappings
POST/admin/exchange-assets/saveAdmin KeyLPOExchange MgmtCreate/update asset mappings
DELETE/admin/exchange-assetsAdmin KeyLPOExchange MgmtRemove asset mappings
MethodPathAuthServiceCategoryDescription
🎫 Admin — Support
GET/support/admin/statsAdmin KeyLPOSupportTicket statistics
GET/support/admin/ticketsAdmin KeyLPOSupportList all tickets
GET/support/admin/tickets/{id}Admin KeyLPOSupportView ticket detail
POST/support/admin/tickets/{id}Admin KeyLPOSupportUpdate ticket
POST/support/admin/tickets/{id}/replyAdmin KeyLPOSupportAdd reply
🤝 Admin — Partners
GET/admin/partner-applicationsAdmin KeyLPOPartnersList applications
POST/admin/partner-applications/{id}/statusAdmin KeyLPOPartnersUpdate status
📰 Admin — Newsletter
GET/admin/newsletter/templatesAdmin KeyLPONewsletterList templates
GET/admin/newsletter/templates/{id}Admin KeyLPONewsletterGet template
POST/admin/newsletter/templatesAdmin KeyLPONewsletterSave template
DELETE/admin/newsletter/templates/{id}Admin KeyLPONewsletterDelete template
GET/admin/newsletter/newslettersAdmin KeyLPONewsletterList newsletters
GET/admin/newsletter/newsletters/{id}Admin KeyLPONewsletterGet newsletter
POST/admin/newsletter/newslettersAdmin KeyLPONewsletterSave newsletter
POST/admin/newsletter/newsletters/{id}/statusAdmin KeyLPONewsletterToggle status
POST/admin/newsletter/newsletters/{id}/sendAdmin KeyLPONewsletterSend newsletter
GET/admin/newsletter/subscribersAdmin KeyLPONewsletterList subscribers
✉️ Admin — Email
GET/admin/email/templatesAdmin KeyLPOEmailList email templates
GET/admin/email/templates/{id}Admin KeyLPOEmailGet template
POST/admin/email/templatesAdmin KeyLPOEmailSave template
DELETE/admin/email/templates/{id}Admin KeyLPOEmailDelete template
GET/admin/email/sendersAdmin KeyLPOEmailList senders
POST/admin/email/sendersAdmin KeyLPOEmailSave sender
DELETE/admin/email/senders/{id}Admin KeyLPOEmailDelete sender
GET/admin/email/draftsAdmin KeyLPOEmailList drafts
GET/admin/email/drafts/{id}Admin KeyLPOEmailGet draft
POST/admin/email/draftsAdmin KeyLPOEmailSave draft
DELETE/admin/email/drafts/{id}Admin KeyLPOEmailDelete draft
POST/admin/email/drafts/{id}/sendAdmin KeyLPOEmailSend email
💳 Checkout & Payments
GET/checkoutNoneLPOCheckoutRedirect to Stripe Payment Link
GET/admin/payment-linksAdmin KeyLPOCheckoutList payment links
POST/admin/payment-links/saveAdmin KeyLPOCheckoutCreate/update payment link
POST/admin/payment-links/toggleAdmin KeyLPOCheckoutEnable/disable payment link
🗄️ Admin — Database & Cache
POST/admin/sqlAdmin KeyLPODatabaseExecute SQL (read/write)
POST/admin/sql-batchAdmin KeyLPODatabaseExecute SQL batch (DDL allowed)
POST/admin/valkeyAdmin KeyLPOCacheExecute ElastiCache commands
UDP Protocol
UDP:2679Bearer (in JSON body)LPOPricePrice queries
UDP:2680Bearer (in JSON body)LRSReportsReport queries

12. Public Infrastructure Endpoints

These endpoints expose operational metrics for the public Infrastructure Live page. No authentication required. Safe for public consumption — sensitive internals (DB pools, internal IPs, config) are stripped.

GET /public/status GET

Returns a curated system status snapshot — node health, feed connections, uptime, and cache hit rate. Designed for the public dashboard. Reads from ElastiCache for sub-millisecond response.

Cache: public, max-age=3

Response Fields

FieldTypeDescription
statusstring"operational" when all systems healthy
system.nodesintTotal expected nodes (4)
system.nodes_healthyintNodes currently reporting
system.node_names[]stringNames of healthy nodes (BeastMain, BeastMirror, BeastLRS, BeastWebhook)
system.uptimestringHuman-readable uptime (e.g., "4d 12h")
system.cache_hit_pctfloatCluster-wide cache hit percentage
feeds[]arrayPer-exchange WebSocket feed status
feeds[].exchangestringExchange name (e.g., "Coinbase")
feeds[].connectedboolWebSocket connection active
feeds[].assetsintNumber of assets cached from this feed

Example

curl https://api.cpmp-site.org/public/status
GET /public/cluster GET NEW

Returns per-node ECS cluster metrics — the same operational data as /admin/cluster-stats but stripped of sensitive internals. Reads from ElastiCache (each container publishes its stats every 3 seconds).

Cache: public, max-age=5

Response Fields

FieldTypeDescription
statusstring"ok"
nodes_foundintNodes currently reporting
nodes_expectedintExpected node count (4)
regionstringAWS region (us-east-2)
nodes[]arrayPer-node metrics
nodes[].namestringNode name (BeastMain, BeastMirror, BeastLRS, BeastWebhook)
nodes[].rolestring"LPO + LRS" or "Push Delivery"
nodes[].uptime_secondsfloatSeconds since container start
nodes[].tcp_requestsintTotal TCP requests served
nodes[].udp_requestsintTotal UDP requests served
nodes[].lrs_requestsintTotal LRS report requests
nodes[].syncmap_hit_pctfloatLocal sync.Map cache hit rate (%)
nodes[].cache_hit_pctfloatCombined cache hit rate (sync.Map + ElastiCache) (%)
nodes[].errors_5xxintServer errors since start
nodes[].errors_4xxintClient errors since start
nodes[].rate_limit_hitsintRate limit rejections since start
aggregatedobjectCluster-wide totals (same fields summed across all nodes)

Example

curl https://api.cpmp-site.org/public/cluster
{
  "status": "ok",
  "nodes_found": 4,
  "nodes_expected": 4,
  "region": "us-east-2",
  "nodes": [
    {
      "name": "BeastMain",
      "role": "LPO + LRS",
      "uptime_seconds": 86412.3,
      "tcp_requests": 1247,
      "udp_requests": 0,
      "lrs_requests": 83,
      "syncmap_hit_pct": 99.2,
      "cache_hit_pct": 99.8,
      "errors_5xx": 0,
      "errors_4xx": 12,
      "rate_limit_hits": 0
    }
  ],
  "aggregated": {
    "tcp_requests": 3891,
    "udp_requests": 0,
    "lrs_requests": 249,
    "syncmap_hit_pct": 99.1,
    "cache_hit_pct": 99.7,
    "rate_limit_hits": 0,
    "errors_5xx": 0,
    "errors_4xx": 34,
    "bg_work_dropped": 0
  }
}
GET /public/infrastructure GET

Returns infrastructure-wide operational metrics aggregated from CloudWatch, Valkey, AWS ECS, and other AWS service APIs. Powers the Infrastructure Live page. The aggregated payload is cached in Valkey for 60 seconds; the standard response envelope is rebuilt on every request, so cache hits and misses are identical in shape.

Cache: public, max-age=60 (Valkey payload: 60s)

Envelope: Like every TBI response, this endpoint returns the standard 12-field Unified Messaging Envelope (UME). The fields documented below are the contents of the data object. Because this is a public, no-auth endpoint, api_key_id is "" (empty string, always present — never omitted).

Response Fields (data object)

FieldTypeDescription
cloudfront.requests_24hintCloudFront requests in last 24h
cloudfront.bytes_24hintBytes downloaded in last 24h
cloudfront.bytes_humanstringHuman-readable bytes (e.g., "1.4 GB")
waf.alb_blocked_24hintALB WAF blocked requests (24h)
waf.alb_allowed_24hintALB WAF allowed requests (24h)
waf.cf_blocked_24hintCloudFront WAF blocked requests (24h)
sqs.visibleintMessages visible in usage log queue
sqs.in_flightintMessages currently being processed
lambda.receiptobjectReceipt Lambda stats (invocations_24h, errors_24h)
lambda.writerobjectQueued Writer Lambda stats
sync.last_runstringLast nightly sync timestamp
sync.statusstring"success" or "failed"
sync.durationstringSync execution time
sync.search_indexobjectSearch index stats (languages, sections)
guardduty.active_findingsintActive GuardDuty findings
alarms.totalintTotal CloudWatch alarms configured
alarms.alarmintAlarms currently in ALARM state
honeypot.total_hitsintTotal honeypot trap hits
honeypot.auto_blockedintIPs auto-blocked by honeypot
cache.enginestring"valkey"
cache.versionstringValkey version (e.g., "7.2.4")
cache.itemsintTotal keys in Valkey (DBSIZE)
cache.hit_ratefloatAll-time cache hit rate (%)
cache.memory_usedstringHuman-readable memory usage (e.g., "3.03G")
autoops.lambdasobjectPer-function invocation counts (24h)
autoops.step_functionsobjectStep Function execution counts (24h)
autoops.self_heal_countintSelf-heal actions this month
autoops.last_threatstringCurrent threat level (NONE, LOW, MEDIUM, HIGH, CRITICAL)
services.clusterstringECS cluster name
services.total_desiredintTotal desired task count across all 4 services
services.total_runningintTotal running task count across all 4 services
services.total_pendingintTotal pending task count (non-zero during deployments)
services.all_healthybooltrue when all services are ACTIVE with running == desired and pending == 0
services.services[]arrayPer-service breakdown — name, status, desired, running, pending, healthy, task_family

Example Request

curl https://api.cpmp-site.org/public/infrastructure

Example Response

{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/public/infrastructure] [200]",
  "status_code": 200,
  "endpoint": "/public/infrastructure",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "language": "en",
  "api_key_id": "",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbi/v1",
  "timestamp": "2026-05-30T17:00:00Z",
  "data": {
    "cloudfront": { "requests_24h": 1095, "bytes_24h": 17114513, "bytes_human": "16 MB" },
    "waf": { "alb_blocked_24h": 1186, "alb_allowed_24h": 3302, "cf_blocked_24h": 0 },
    "sqs": { "visible": 0, "in_flight": 0 },
    "lambda": {
      "receipt": { "state": "Active", "last_deployed": "", "invocations_24h": 0, "errors_24h": 0 },
      "writer": { "state": "Active", "last_deployed": "", "invocations_24h": 141, "errors_24h": 0 }
    },
    "sync": {
      "last_run": "May 30 01:00AM",
      "status": "success",
      "duration": "783.351423ms",
      "new_logs": "154 new logs loaded",
      "search_index": { "languages": 12, "sections": 3150 }
    },
    "guardduty": { "active_findings": 0, "status": "active" },
    "alarms": { "total": 17, "ok": 16, "alarm": 1, "insufficient_data": 0 },
    "honeypot": { "active": true, "endpoints": 12, "total_hits": 22, "auto_blocked": 77, "pending_queue": 0 },
    "autoops": {
      "active": true,
      "lambdas": {
        "notify_invocations_24h": 14,
        "self_heal_invocations_24h": 61,
        "waf_action_invocations_24h": 3,
        "honeypot_processor_invocations_24h": 288,
        "bedrock_analyze_invocations_24h": 288,
        "raima_support_invocations_24h": 11,
        "digest_invocations_24h": 1,
        "total_invocations_24h": 666,
        "total_errors_24h": 0
      },
      "step_functions": { "executions_24h": 62, "succeeded_24h": 62, "failed_24h": 0 },
      "eventbridge": {
        "rules": [
          { "name": "tbi-ops-alarm-trigger", "schedule": "", "pattern": "CloudWatch alarm → ALARM", "target": "Step Function: health-check-heal" },
          { "name": "tbi-ops-honeypot-queue-processor", "schedule": "rate(5 minutes)", "pattern": "", "target": "Lambda: honeypot-processor" }
        ],
        "total": 6
      },
      "waf_blocked_by_ops": 0,
      "self_heal_count": 0,
      "last_threat": "LOW"
    },
    "cache": {
      "engine": "valkey",
      "version": "7.2.6",
      "items": 38675,
      "hit_rate": 65.7,
      "memory_used": "1.42G",
      "memory_percent": 0.0,
      "cpu_percent": 3.0
    },
    "services": {
      "cluster": "trinity-beast-fargate-cluster",
      "total_desired": 4,
      "total_running": 4,
      "total_pending": 0,
      "all_healthy": true,
      "services": [
        { "name": "trinity-beast-main-service", "status": "ACTIVE", "desired": 1, "running": 1, "pending": 0, "healthy": true, "task_family": "trinity-beast-main-task" }
      ]
    },
    "translation": {
      "active": true,
      "daily_spend_usd": 0,
      "daily_limit_usd": 600,
      "active_jobs": 0,
      "queue_depth": 0,
      "cost_per_pair_usd": 1.65,
      "daily_input_tokens": 0,
      "daily_output_tokens": 0,
      "daily_token_limit": 50000000
    }
  },
  "error": ""
}

The services.services[] array contains one object per Fargate service (4 total — abbreviated to one above). Each eventbridge.rules[] entry always carries both schedule and pattern; the field that does not apply to a given rule is an empty string, never omitted — consistent with the UME "no omitempty" rule.

13. Admin Endpoints — Full Reference

All admin endpoints require the X-Admin-Key header. The admin key is established via the one-time /admin/bootstrap-key endpoint on first deployment.

Admin Authentication Required on all admin requests
X-Admin-Key: YOUR_ADMIN_KEY

System Management

Endpoints for managing application configuration, demo mode, system profiles, and parameter reloading.

MethodPathDescription
GET/admin/configView all application parameters and their current values
GET/admin/setup-demoCreate or reset the demo API key for the live demo page
GET/admin/invalidate-keyInvalidate a cached API key in ElastiCache (forces re-fetch from Aurora)
GET/admin/demo-modeToggle between demo mode (synthetic prices) and performance mode (live feeds)
GET/admin/system-modeSwitch the active system profile (e.g., production, maintenance, demo)
GET/admin/reload-paramsForce an immediate reload of application parameters from the database
GET/admin/profilesList all available system profiles and their configurations

Metrics & Monitoring

Real-time observability into The Trinity Beast runtime performance, price feed health, and adaptive governor behavior.

MethodPathDescription
GET/admin/stress-stats24-counter real-time metrics: requests, errors, cache hits, latency percentiles, goroutines, memory
GET/admin/stress-resetReset all runtime metrics counters to zero
GET/admin/cluster-statsAggregated metrics across all ECS containers in the cluster
GET/admin/feed-statusWebSocket and REST feed status for all 6 exchanges (Coinbase, Gemini, Kraken, Gate.io, Crypto.com, OKX)
GET/admin/usage-analyticsAggregated usage log analytics with breakdowns by asset, source, and time period
GET/admin/adaptive-statsAdaptive governor statistics — current thresholds, adjustment history, and feed health scores
GET/admin/db-insightsPostgreSQL self-observability — buffer-cache hit ratio, top queries by total time and call count (from pg_stat_statements), and per-table sequential-vs-index scan health
POST/admin/db-insights/resetReset the pg_stat_statements baseline so a clean measurement window can begin (e.g., before/after an optimization A/B)

Exchange Management

Full CRUD for exchange feed configurations and asset symbol mappings. Changes take effect immediately — no restart required.

MethodPathDescription
GET/admin/exchange-feedsList all exchange configurations with connection status
POST/admin/exchange-feeds/saveCreate or update an exchange configuration
POST/admin/exchange-feeds/toggleEnable or disable an exchange without removing its configuration
DELETE/admin/exchange-feedsPermanently remove an exchange configuration
GET/admin/exchange-assetsList all asset symbol mappings across exchanges. Returns id, asset, exchange_name, exchange_symbol, enabled, prewarm, category. Optional ?exchange=coinbase filter.
POST/admin/exchange-assets/saveCreate or update asset symbol mappings for an exchange. Accepts enabled, prewarm, and category per asset.
POST/admin/exchange-assets/toggleFlip enabled and/or prewarm on a single asset row. Only the fields provided are updated. Body: {"exchange_name":"okx","asset":"BANANA","prewarm":false}
DELETE/admin/exchange-assetsRemove asset symbol mappings. ?exchange=gemini&asset=APE removes one; ?exchange=gemini removes all for that exchange.
POST/admin/eam/syncSync EAM → application_parameters. Writes per-exchange CSV params and master prewarm_assets_list from all enabled=true, prewarm=true rows. Follow with /admin/force-deploy-params to activate.
GET/admin/eam/auditStart a 4-layer prewarm audit in the background (async). Returns 202 immediately. Layers: live exchange API prices, EAM ↔ param drift, master list parity, LPO smoke test. Results cached in Valkey 24h.
GET/admin/eam/audit?poll=1Poll for audit results. Returns {"ready":false} while running, {"ready":true,"result":{...}} when complete.
POST/admin/eam/discoverStart async discovery of uncovered assets for an exchange, ranked by 24h volume. Body: {"exchange":"okx","limit":18}. Returns 202 immediately. Results cached in Valkey 10 min.
GET/admin/eam/discover?exchange=okx&poll=1Poll for discovery results. Returns top N uncovered assets with price, 24h volume, and exchange symbol — filtered against the full EAM collection across all exchanges.

Database & Cache

Direct database and cache access for administrative operations. These endpoints execute commands against Aurora Serverless v2 and ElastiCache.

MethodPathDescription
POST/admin/sqlExecute a single SQL statement (SELECT, INSERT, UPDATE, DELETE)
POST/admin/sql-batchExecute multiple SQL statements in sequence (DDL allowed — CREATE TABLE, ALTER, etc.)
POST/admin/valkeyExecute ElastiCache (Valkey) commands — GET, SET, DEL, KEYS, HGETALL, etc.
⚠️ Caution: The /admin/sql, /admin/sql-batch, and /admin/valkey endpoints execute commands directly against production databases. Use with care.
Parameterized queries on /admin/sql: The endpoint accepts an optional args array for safe parameter binding. When present, the query uses PostgreSQL placeholders ($1, $2, …) bound to the array values instead of string interpolation. The parameter is backward-compatible — omitting args preserves the exact prior behavior.
{
  "query": "SELECT COUNT(*) AS count FROM usage_logs WHERE asset = $1",
  "args": ["BTC"],
  "mode": "read"
}

Support Ticket Administration

MethodPathDescription
GET/support/admin/statsTicket statistics — open, closed, average response time
GET/support/admin/ticketsList all support tickets with filtering and pagination
GET/support/admin/tickets/{id}View full ticket detail including all replies
POST/support/admin/tickets/{id}Update ticket status, priority, or assignment
POST/support/admin/tickets/{id}/replyAdd an admin reply to a ticket (triggers email notification via SES)

Partner Administration

MethodPathDescription
GET/admin/partner-applicationsList all partner applications with status filtering
POST/admin/partner-applications/{id}/statusApprove, reject, or request more info on a partner application

Newsletter Administration

Full newsletter lifecycle management — templates, composition, subscriber management, and sending via SES.

MethodPathDescription
GET/admin/newsletter/templatesList all newsletter templates
GET/admin/newsletter/templates/{id}Get a specific template by ID
POST/admin/newsletter/templatesCreate or update a newsletter template
DELETE/admin/newsletter/templates/{id}Delete a newsletter template
GET/admin/newsletter/newslettersList all newsletters with status
GET/admin/newsletter/newsletters/{id}Get a specific newsletter by ID
POST/admin/newsletter/newslettersCreate or update a newsletter
POST/admin/newsletter/newsletters/{id}/statusToggle newsletter active/inactive status
POST/admin/newsletter/newsletters/{id}/sendSend newsletter to all active subscribers via SES
GET/admin/newsletter/subscribersList all newsletter subscribers with status

Email Administration

Direct email composition and sending — templates, verified senders, draft management, and delivery via SES.

MethodPathDescription
GET/admin/email/templatesList all email templates
GET/admin/email/templates/{id}Get a specific email template
POST/admin/email/templatesCreate or update an email template
DELETE/admin/email/templates/{id}Delete an email template
GET/admin/email/sendersList verified sender identities
POST/admin/email/sendersAdd or update a sender identity
DELETE/admin/email/senders/{id}Remove a sender identity
GET/admin/email/draftsList all email drafts
GET/admin/email/drafts/{id}Get a specific draft
POST/admin/email/draftsCreate or update an email draft
DELETE/admin/email/drafts/{id}Delete an email draft
POST/admin/email/drafts/{id}/sendSend an email draft via SES

Email Testing

Diagnostic endpoints for verifying email rendering without triggering real payment processing or translation jobs.

MethodPathDescription
POST/admin/test-refund-emailSend a test refund confirmation email with dummy data. Supports type: translation or subscription. Supports lang: en, es, pt, fr, de, ru, hi, ur, ar, ja, zh, it.
POST/admin/test-finalize-emailSend a test translation completion notification email with mock data. Verifies the per-language cost breakdown table (sqsLangDetails) renders correctly. Three scenarios: succeeded, partial, failed. No Bedrock calls, no translation jobs — SES only.

POST /admin/test-refund-email

Request Body
{
  "email": "recipient@example.com",
  "lang": "ur",
  "type": "translation"
}
Response
{
  "status": "sent",
  "email": "recipient@example.com",
  "lang": "ur",
  "type": "translation",
  "subject": "رقم کی واپسی کی تصدیق — Trinity-Beast-API-Reference.html"
}

POST /admin/test-finalize-email

Sends a mock translation completion email with realistic dummy data. The email includes the full stats bar (documents, languages, succeeded/failed counts, duration, cost/fee/total, state badge) and the Cost by Language table showing per-language Bedrock token usage and cost. Subject line is prefixed with [TEST] and a purple banner at the top makes it immediately clear this is not a real alert.

Request Body
{
  "email": "recipient@example.com",
  "scenario": "succeeded"
}

// scenario values:
// "succeeded" — 2 docs × 11 langs, all 22 pairs succeeded, full cost breakdown table
// "partial"   — 2 docs × 11 langs, 16/22 pairs succeeded, 3 failed pairs listed, partial cost table
// "failed"    — 1 doc × 3 langs, all failed, no cost table, CRITICAL badge
Response
{
  "status": "sent",
  "email": "recipient@example.com",
  "scenario": "partial",
  "subject": "[TEST] Translation Complete: 2 docs × 11 langs — 16/22 pairs PARTIAL"
}

13b. Translation Engine Admin Endpoints

Internal admin endpoints for the document translation pipeline. All require the X-Admin-Key header. Full documentation: AutoOps Translation Engine.

Job Submission

MethodPathDescription
POST/admin/translateSubmit a translation job. Accepts docs (array, max 6), langs ("all" or array), model, options (force, delta, skip_search_rebuild, skip_validation), protected_terms. Enforces $600/day dollar cap and 50M token/day cap. Returns job_id.

Monitoring

MethodPathDescription
GET/admin/translate/status/{job_id}Full job state — Valkey primary (live progress), Aurora fallback (completed jobs)
GET/admin/translate/queueAll active and queued jobs
GET/admin/translate/historyLast 50 completed jobs from Aurora
GET/admin/translate/healthSystem health — queue depth, active jobs, daily spend, daily token counts (input/output/limit), last completed job

Control

MethodPathDescription
POST/admin/translate/cancel/{job_id}Stop a running job — halts Step Function, leaves already-deployed translations live
POST/admin/translate/retry-failed/{job_id}Re-submit only the failed pairs from a previous job

Cost Protection — 429 Responses

The submit handler enforces two independent daily caps. Either can trigger a 429:

CapValkey KeyLimitReset
Dollar capautoops:bedrock:spend:daily$600/day24h TTL auto-reset
Token capautoops:bedrock:tokens:input:daily + autoops:bedrock:tokens:output:daily50M combined tokens/day24h TTL auto-reset

Emergency kill switch: SET autoops:bedrock:kill 1 in Valkey — halts all translation operations immediately.

14. Dashboard Support Endpoints — Full Reference

The dashboard exposes 8 support endpoints split into two groups: Customer (authenticated via Bearer token, scoped to the user's own tickets) and Admin (Bearer token + admin role, system-wide access). All responses use the standard 12-field UME envelope.

Customer Endpoints (Bearer Token)

These endpoints are scoped to the authenticated user's email. Customers can only see and interact with their own tickets. Internal admin notes are never exposed.

GET /dashboard/api/support/tickets

List the authenticated user's support tickets, ordered by most recent. Limited to 50.

Authentication: Bearer token (session cookie)

{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/dashboard/api/support/tickets] [200]",
  "status_code": 200,
  "endpoint": "/dashboard/api/support/tickets",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbi-dashboard/v1",
  "timestamp": "2026-05-17T19:00:00Z",
  "data": {
    "tickets": [
      {
        "ticket_number": "TKT-20260517-A3F2",
        "subject": "API key not working after renewal",
        "status": "open",
        "created_at": "2026-05-17T14:30:00Z"
      }
    ]
  },
  "error": ""
}

GET /dashboard/api/support/tickets/{ticket_number}

Full ticket detail with reply thread. Excludes internal admin notes. Shows translated replies in the customer's language.

Authentication: Bearer token (session cookie). Must own the ticket.

{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/dashboard/api/support/tickets/TKT-20260517-A3F2] [200]",
  "status_code": 200,
  "endpoint": "/dashboard/api/support/tickets/TKT-20260517-A3F2",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbi-dashboard/v1",
  "timestamp": "2026-05-17T19:00:00Z",
  "data": {
    "ticket": {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "ticket_number": "TKT-20260517-A3F2",
      "name": "Jane Developer",
      "category": "technical",
      "subject": "API key not working after renewal",
      "message": "I renewed my subscription yesterday but my API key returns 403...",
      "status": "open",
      "preferred_lang": "en",
      "created_at": "2026-05-17T14:30:00Z",
      "updated_at": "2026-05-17T15:45:00Z"
    },
    "replies": [
      {
        "id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
        "author_type": "admin",
        "message": "I've checked your key — it looks like the cache hadn't refreshed yet. Should be working now.",
        "created_at": "2026-05-17T15:45:00Z"
      }
    ]
  },
  "error": ""
}

POST /dashboard/api/support/tickets/{ticket_number}/reply

Post a customer reply. Max 10,000 characters. Auto-translates to English for admin readability. Notifies admin via email. Re-opens tickets in awaiting_customer or resolved state.

Authentication: Bearer token (session cookie). Must own the ticket.

Request body:

{
  "message": "Thanks, it's working now! One more question — can I add more assets to my plan?"
}

Response:

{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/dashboard/api/support/tickets/TKT-20260517-A3F2/reply] [200]",
  "status_code": 200,
  "endpoint": "/dashboard/api/support/tickets/TKT-20260517-A3F2/reply",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbi-dashboard/v1",
  "timestamp": "2026-05-17T19:10:00Z",
  "data": {
    "reply_id": "c4d5e6f7-a8b9-0123-4567-890abcdef123",
    "message": "Reply posted"
  },
  "error": ""
}

Errors: 400 if message is empty or exceeds 10,000 chars. 400 if ticket is closed. 404 if ticket not found or not owned by user.

POST /dashboard/api/support/tickets/{ticket_number}/resolve

Mark own ticket as resolved. Notifies admin. Closed tickets cannot be resolved (already terminal). Idempotent — resolving an already-resolved ticket returns success.

Authentication: Bearer token (session cookie). Must own the ticket.

Request body: Empty {}

Response:

{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/dashboard/api/support/tickets/TKT-20260517-A3F2/resolve] [200]",
  "status_code": 200,
  "endpoint": "/dashboard/api/support/tickets/TKT-20260517-A3F2/resolve",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbi-dashboard/v1",
  "timestamp": "2026-05-17T19:15:00Z",
  "data": {
    "message": "Ticket marked resolved",
    "status": "resolved"
  },
  "error": ""
}

Admin Endpoints (Bearer Token + Admin Role)

System-wide ticket management. Admin can see all tickets, all replies (including internal notes), customer IPs, and full audit trail. Requires admin role on the session.

GET /dashboard/api/admin/support/tickets

List all tickets system-wide. Supports filtering by status and category. Limited to 200 results, ordered by created_at DESC.

Authentication: Bearer token + admin role

Query parameters:

ParamTypeDescription
statusstringFilter by status: new, open, in_progress, awaiting_customer, resolved, closed
categorystringFilter by category: billing, technical, api-access, rate-limit, feature-request, bug-report, account, general
{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/dashboard/api/admin/support/tickets] [200]",
  "status_code": 200,
  "endpoint": "/dashboard/api/admin/support/tickets",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbi-dashboard/v1",
  "timestamp": "2026-05-17T19:00:00Z",
  "data": {
    "tickets": [
      {
        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "ticket_number": "TKT-20260517-A3F2",
        "name": "Jane Developer",
        "email": "jane@example.com",
        "category": "technical",
        "subject": "API key not working after renewal",
        "status": "open",
        "created_at": "2026-05-17T14:30:00Z",
        "updated_at": "2026-05-17T15:45:00Z"
      }
    ]
  },
  "error": ""
}

GET /dashboard/api/admin/support/tickets/{id}

Full ticket detail by UUID. Includes all replies (internal notes visible), customer IP, email, preferred language, and English translation of the original message.

Authentication: Bearer token + admin role

{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/dashboard/api/admin/support/tickets/a1b2c3d4-e5f6-7890-abcd-ef1234567890] [200]",
  "status_code": 200,
  "endpoint": "/dashboard/api/admin/support/tickets/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbi-dashboard/v1",
  "timestamp": "2026-05-17T19:00:00Z",
  "data": {
    "ticket": {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "ticket_number": "TKT-20260517-A3F2",
      "name": "Jane Developer",
      "email": "jane@example.com",
      "category": "technical",
      "subject": "API key not working after renewal",
      "message": "I renewed my subscription yesterday but my API key returns 403...",
      "message_en": "I renewed my subscription yesterday but my API key returns 403...",
      "preferred_lang": "en",
      "status": "open",
      "client_ip": "203.0.113.50",
      "created_at": "2026-05-17T14:30:00Z",
      "updated_at": "2026-05-17T15:45:00Z"
    },
    "replies": [
      {
        "id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
        "author": "CoryDeanKalani@CPMP-Site.org",
        "author_type": "admin",
        "message": "I've checked your key — it looks like the cache hadn't refreshed yet. Should be working now.",
        "is_internal": false,
        "created_at": "2026-05-17T15:45:00Z"
      },
      {
        "id": "d5e6f7a8-b9c0-1234-5678-90abcdef1234",
        "author": "CoryDeanKalani@CPMP-Site.org",
        "author_type": "admin",
        "message": "Note: key cache was stale due to recent deploy. Forced invalidation.",
        "is_internal": true,
        "created_at": "2026-05-17T15:44:00Z"
      }
    ]
  },
  "error": ""
}

POST /dashboard/api/admin/support/tickets/{id}/reply

Post an admin reply. Auto-translates to customer's language and emails them. Includes a one-click resolve link in the email (single-use, 30-day TTL). Internal notes (is_internal: true) are never shown to the customer or emailed. First reply auto-advances status from new to open.

Authentication: Bearer token + admin role

Request body:

{
  "message": "I've checked your key — it looks like the cache hadn't refreshed yet. Should be working now.",
  "is_internal": false
}

Response:

{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/dashboard/api/admin/support/tickets/a1b2c3d4/reply] [200]",
  "status_code": 200,
  "endpoint": "/dashboard/api/admin/support/tickets/a1b2c3d4/reply",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbi-dashboard/v1",
  "timestamp": "2026-05-17T19:10:00Z",
  "data": {
    "reply_id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
    "message": "Reply posted"
  },
  "error": ""
}

Errors: 400 if message is empty. 404 if ticket not found.

POST /dashboard/api/admin/support/tickets/{id}/status

Update a ticket's status. Audit-logged with the admin's email. Valid statuses: new, open, in_progress, awaiting_customer, resolved, closed.

Authentication: Bearer token + admin role

Request body:

{
  "status": "in_progress"
}

Response:

{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/dashboard/api/admin/support/tickets/a1b2c3d4/status] [200]",
  "status_code": 200,
  "endpoint": "/dashboard/api/admin/support/tickets/a1b2c3d4/status",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbi-dashboard/v1",
  "timestamp": "2026-05-17T19:12:00Z",
  "data": {
    "message": "Status updated",
    "status": "in_progress"
  },
  "error": ""
}

Errors: 400 if status is invalid. 404 if ticket not found.

Ticket Status Flow

Tickets follow a lifecycle with automatic transitions:

TransitionTrigger
newopenFirst admin reply
awaiting_customeropenCustomer replies
resolvedopenCustomer replies (re-opens)
Any → resolvedCustomer clicks resolve (dashboard or email link)
Any → any valid statusAdmin sets status manually

Note: Closed tickets cannot be replied to by customers. They must open a new ticket.

GET /dashboard/api/admin/daily-rollup

Returns per-day usage aggregates served from the mv_usage_daily materialized view in Aurora. Because the data is precomputed, this endpoint is fast and never scans the full usage_logs table. The view is refreshed every 5 minutes by the pg_cron job tbi-mv-usage-daily-refresh running natively inside Aurora; the last_refreshed field tells consumers how current the data is.

Authentication: Bearer token + admin role

ParameterTypeDescription
daysintNumber of days to return. Default 30, maximum 93 (matches the usage-log retention window).

Response:

{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/dashboard/api/admin/daily-rollup] [200]",
  "status_code": 200,
  "endpoint": "/dashboard/api/admin/daily-rollup",
  "cluster_node": "BeastMain",
  "region": "us-east-2",
  "language": "en",
  "api_key_id": "ak_demo123",
  "ip_address": "203.0.113.42",
  "agent_profile_arn": "arn:tbi:us-east-2:211998422884:agent-profile/tbi-dashboard/v1",
  "timestamp": "2026-05-30T23:30:00Z",
  "data": {
    "days": [
      {
        "day": "2026-05-30",
        "total_requests": 4821,
        "avg_latency_ms": 12.4,
        "p50_latency_ms": 9,
        "p95_latency_ms": 38,
        "p99_latency_ms": 71,
        "cached_requests": 4603,
        "cache_hit_rate_pct": 95.48,
        "distinct_assets": 142,
        "distinct_api_keys": 6,
        "distinct_sources": 6,
        "distinct_nodes": 3
      }
    ],
    "count": 1,
    "last_refreshed": "2026-05-30T23:26:00Z"
  },
  "error": ""
}

Notes: days is always an array (empty [] when no data, never null). last_refreshed reflects the most recent materialized-view refresh, not the request time.

15. Translation Service API

AI-powered document translation with sentinel preprocessing and multi-layer validation. Translates technical documentation while preserving code blocks, Mermaid diagrams, brand terms, and all technical identifiers. Choose from three AI agents based on your needs.

Authentication: All translation endpoints require a valid API key via X-API-Key header, Authorization: Bearer, or ?api_key= query parameter. Only paid tiers (pro, enterprise, unlimited, lifetime) can access the translation service. Translation-specific API keys (service_type: translation) are required — price-only keys are rejected with 403.

15.1 GET /translate/models

Returns the available AI agents with token-based pricing information. Public — no authentication required.

Response

{
  "status_code": 200,
  "data": {
    "models": [
      {
        "id": "claude-haiku-3.5",
        "name": "Claude Haiku 3.5",
        "tier": "Good",
        "input_rate_per_1m": 1.0,
        "output_rate_per_1m": 5.0,
        "estimated_cost_per_pair": 0.03,
        "speed": "fast",
        "quality": "good",
        "description": "Fast and affordable. Best for Latin-script languages and straightforward documents."
      },
      {
        "id": "claude-sonnet-4.6",
        "name": "Claude Sonnet 4.6",
        "tier": "Better",
        "input_rate_per_1m": 3.0,
        "output_rate_per_1m": 15.0,
        "estimated_cost_per_pair": 0.08,
        "speed": "moderate",
        "quality": "excellent",
        "description": "Balanced speed and quality. Handles complex scripts and technical documents well. Default choice."
      },
      {
        "id": "claude-opus-4",
        "name": "Claude Opus 4",
        "tier": "Best",
        "input_rate_per_1m": 5.0,
        "output_rate_per_1m": 25.0,
        "estimated_cost_per_pair": 0.05,
        "speed": "slow",
        "quality": "exceptional",
        "description": "Highest quality translations. Best for critical documents and complex grammar."
      }
    ],
    "default": "claude-sonnet-4.6",
    "pricing_note": "Rates are per 1M tokens. estimated_cost_per_pair is for a typical 50KB document (one language). Actual cost depends on document size and content density."
  }
}
FieldTypeDescription
input_rate_per_1mfloatCost per 1 million input tokens (USD)
output_rate_per_1mfloatCost per 1 million output tokens (USD)
estimated_cost_per_pairfloatEstimated Bedrock cost for one language pair on a typical 50KB document

15.2 POST /translate/quote

Submit a document URL and target languages to receive an instant price quote. The engine fetches and analyzes your document (size, chunks, code blocks, diagrams) and returns a detailed cost breakdown.

Request Body

{
  "doc_url": "https://your-site.com/docs/api-reference.html",
  "langs": ["es", "fr", "de", "ja", "zh"],
  "model": "claude-sonnet-4.6"
}
FieldTypeRequiredDescription
doc_urlstringYesURL to the source document (must be publicly accessible). Max 500 KB.
langsstring[]YesArray of target language codes (e.g., ["es","ja","ar"]). Maximum 12 languages per quote. 35 validated languages with production-tested sentinel configurations; any of Claude's 300+ supported languages can be requested by ISO 639-1 code.
modelstringNoAI agent to use. One of: claude-haiku-3.5, claude-sonnet-4.6 (default), claude-opus-4.

Response (200 OK)

{
  "status_code": 200,
  "data": {
    "quote_id": "qt-a1b2c3d4e5f6",
    "doc_name": "api-reference.html",
    "languages": ["es", "fr", "de", "ja", "zh"],
    "model": "claude-sonnet-4.6",
    "analysis": {
      "size_bytes": 63488,
      "estimated_chunks": 4,
      "difficulty": "moderate",
      "code_blocks": 12,
      "diagrams": 2
    },
    "pricing": {
      "estimated_input_tokens": 21700,
      "estimated_output_tokens": 16492,
      "input_rate_per_1m": 3.0,
      "output_rate_per_1m": 15.0,
      "cost_per_pair": 0.31,
      "pairs": 5,
      "subtotal": 1.57,
      "markup_pct": 30,
      "total_price": 2.04,
      "per_language": [
        {
          "lang": "es",
          "model": "claude-haiku-3.5",
          "estimated_input_tokens": 21700,
          "estimated_output_tokens": 16492,
          "bedrock_cost": 0.05,
          "infra_cost": 0.14,
          "pair_subtotal": 0.19,
          "pair_with_markup": 0.24
        },
        {
          "lang": "ja",
          "model": "claude-sonnet-4.6",
          "estimated_input_tokens": 21700,
          "estimated_output_tokens": 16492,
          "bedrock_cost": 0.31,
          "infra_cost": 0.14,
          "pair_subtotal": 0.45,
          "pair_with_markup": 0.59
        }
      ]
    },
    "expires_at": "2026-05-23T15:00:00Z",
    "accept_url": "/translate/accept/qt-a1b2c3d4e5f6"
  }
}

Per-language breakdown: When the engine auto-routes languages to different agents (e.g., Haiku for Latin-script languages, Sonnet for CJK/RTL), the per_language array shows the exact cost per target language. If you specify a model explicitly, all languages use that model and the per-language costs are uniform.

Quote expiry: Quotes are valid for 24 hours. After expiry, submit a new quote request. Pricing may change if Bedrock costs are updated.

15.3 GET /translate/quote/{quote_id}

Retrieve the details of an existing quote, including its current state (pending, accepted, expired).

Response (200 OK)

{
  "status_code": 200,
  "data": {
    "quote_id": "qt-a1b2c3d4e5f6",
    "doc_url": "https://your-site.com/docs/api-reference.html",
    "doc_name": "api-reference.html",
    "languages": ["es", "fr", "de", "ja", "zh"],
    "model": "claude-sonnet-4.6",
    "analysis": {
      "size_bytes": 63488,
      "estimated_chunks": 4,
      "difficulty": "moderate",
      "code_blocks": 12,
      "diagrams": 2
    },
    "pricing": {
      "estimated_input_tokens": 21700,
      "estimated_output_tokens": 16492,
      "input_rate_per_1m": 3.0,
      "output_rate_per_1m": 15.0,
      "cost_per_pair": 0.31,
      "pairs": 5,
      "subtotal": 1.57,
      "markup_pct": 30,
      "total_price": 2.04
    },
    "state": "pending",
    "expires_at": "2026-05-23T15:00:00Z",
    "accepted_at": "",
    "job_id": ""
  }
}

15.4 GET /translate/quotes

List all quotes for the authenticated API key, ordered by most recent. Limited to 30.

Response (200 OK)

{
  "status_code": 200,
  "data": {
    "quotes": [
      {
        "quote_id": "qt-a1b2c3d4e5f6",
        "doc_name": "api-reference.html",
        "lang_count": 5,
        "total_price": 11.05,
        "model": "claude-sonnet-4.6",
        "state": "accepted",
        "expires_at": "2026-05-23T15:00:00Z",
        "job_id": "019e4b8a37bc-abc123"
      },
      {
        "quote_id": "qt-f6e5d4c3b2a1",
        "doc_name": "architecture-guide.html",
        "lang_count": 3,
        "total_price": 6.45,
        "model": "claude-haiku-3.5",
        "state": "pending",
        "expires_at": "2026-05-23T18:00:00Z",
        "job_id": ""
      }
    ],
    "count": 2
  }
}

15.5 POST /translate/accept/{quote_id}

Accept a pending quote and begin translation. Your payment method on file is charged the quoted amount. Translation starts immediately upon acceptance.

Response (200 OK)

{
  "status_code": 200,
  "data": {
    "job_id": "019e4b8a37bc-abc123",
    "state": "queued",
    "quote_id": "qt-a1b2c3d4e5f6",
    "model": "claude-sonnet-4.6",
    "total_price": 11.05,
    "pairs": 5,
    "message": "Translation job started. You will receive an email when complete."
  }
}

Error Responses

StatusCondition
400Quote has already been accepted
400Quote has expired (24h TTL)
402Payment failed — no valid payment method on file
404Quote not found or does not belong to this API key

Job tracking: After acceptance, use the job_id to check progress via your Account Dashboard or the GET /dashboard/api/translate/status/{job_id} endpoint. You'll also receive an email notification when the job completes.

15.6 POST /translate/accept-batch

Accept multiple pending quotes in a single transaction. A single Stripe PaymentIntent is created for the batch total. Each quote becomes a separate translation job. Maximum 6 quotes per batch.

Request Body

{
  "quote_ids": [
    "qt-a1b2c3d4e5f6",
    "qt-b2c3d4e5f6a7",
    "qt-c3d4e5f6a7b8"
  ]
}

Parameters

FieldTypeRequiredDescription
quote_idsarrayYesArray of quote IDs to accept. Minimum 1, maximum 6.

Response (200 OK)

{
  "status_code": 200,
  "data": {
    "batch_total": 33.15,
    "jobs": [
      {
        "job_id": "019e4b8a37bc-abc123",
        "quote_id": "qt-a1b2c3d4e5f6",
        "state": "queued",
        "pairs": 5,
        "price": 11.05
      },
      {
        "job_id": "019e4b8a37bc-def456",
        "quote_id": "qt-b2c3d4e5f6a7",
        "state": "queued",
        "pairs": 3,
        "price": 8.40
      },
      {
        "job_id": "019e4b8a37bc-ghi789",
        "quote_id": "qt-c3d4e5f6a7b8",
        "state": "queued",
        "pairs": 6,
        "price": 13.70
      }
    ],
    "payment_intent_id": "pi_3abc123def456",
    "message": "3 translation jobs started. You will receive an email when each completes."
  }
}

Error Responses

StatusCondition
400No quote_ids provided or array is empty
400More than 6 quotes in a single batch
400One or more quotes already accepted or expired
402Payment failed — no valid payment method on file
404One or more quotes not found or do not belong to this API key

Batch behavior: All quotes must belong to the same API key and be in pending state. If any quote in the batch fails validation, the entire batch is rejected (no partial acceptance). Each accepted quote spawns an independent translation job. A single HTML receipt email is sent summarizing all jobs in the batch.

15.7 Supported Languages

35 validated languages with production-tested sentinel configurations. Any additional language Claude supports can be requested.

CodeLanguageCodeLanguageCodeLanguage
esSpanishhiHindikoKorean
ptPortugueseurUrdutrTurkish
frFrencharArabicplPolish
deGermanjaJapanesenlDutch
ruRussianzhChinesesvSwedish
itItalianbnBengalithThai
viVietnameseidIndonesianroRomanian

15.8 POST /admin/translate/refund/{quote_id}

Issues a full or partial refund for a completed translation purchase. Admin-only — requires X-Admin-Key header. Refunds are processed via Stripe and the customer receives a confirmation email automatically.

Path Parameters

ParameterTypeDescription
quote_idstringThe quote ID from the original translation purchase (e.g., qt-a1b2c3d4e5f6)

Request Body (Optional)

POST /admin/translate/refund/qt-a1b2c3d4e5f6
X-Admin-Key: your-admin-key
Content-Type: application/json

{
  "amount": 5.00,
  "reason": "Customer unsatisfied with Japanese translation quality"
}
FieldTypeRequiredDescription
amountnumberNoPartial refund amount in USD. If omitted or equal to the original charge, a full refund is issued.
reasonstringNoReason for the refund. Included in the customer's refund confirmation email and stored as metadata on the Stripe refund.

Response (200 OK)

{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/admin/translate/refund/qt-a1b2c3d4e5f6] [200]",
  "status_code": 200,
  "data": {
    "status": "refunded",
    "quote_id": "qt-a1b2c3d4e5f6",
    "refund_id": "re_1234567890",
    "refund_amount": 10.75,
    "original_amount": 10.75,
    "partial": false,
    "stripe_status": "succeeded"
  },
  "error": ""
}

Validation rules:

  • Quote must be in accepted state (already paid)
  • Cannot refund a quote that is pending, expired, or already refunded
  • Partial refund amount must be less than the original charge
  • Refund is processed via Stripe SDK — appears on customer's statement within 5-10 business days

15.8 Brand Terms Protection

Customers can configure up to 150 brand terms that are automatically protected during every translation job. These terms are never translated or transliterated — they appear exactly as written in every target language. Terms are managed via the dashboard API and apply to all future translation jobs for the account.

GET /dashboard/api/protected-terms

Returns the customer's current list of protected brand terms. Requires dashboard Bearer token authentication.

Response (200 OK)

{
  "status_code": 200,
  "data": {
    "terms": ["Acme Corp", "DataForge", "CloudSync API", "John Smith"],
    "count": 4,
    "limit": 150
  },
  "error": ""
}

PUT /dashboard/api/protected-terms

Replaces the customer's entire brand terms list. Requires dashboard Bearer token authentication.

Request Body

PUT /dashboard/api/protected-terms
Authorization: Bearer your-session-token
Content-Type: application/json

{
  "terms": ["Acme Corp", "DataForge", "CloudSync API", "John Smith", "SyncEngine"]
}
FieldTypeRequiredDescription
termsarray of stringsYesThe complete list of brand terms to protect. Replaces any existing terms.

Response (200 OK)

{
  "status_code": 200,
  "data": {
    "message": "Saved 5 brand terms",
    "terms": ["Acme Corp", "DataForge", "CloudSync API", "John Smith", "SyncEngine"],
    "count": 5,
    "limit": 150
  },
  "error": ""
}

Limits & validation:

  • Maximum 150 terms per account
  • Maximum 100 characters per term
  • Duplicates are automatically removed
  • Empty strings are ignored
  • Terms apply to all future translation jobs — no per-request overrides
  • Terms are merged with the engine's internal protected terms (code blocks, Mermaid diagrams, technical identifiers are always protected regardless of this list)

15.9 Dashboard Translation Endpoints

Authenticated dashboard endpoints for translation spend tracking, refund history, and job completion notifications. All require Bearer token authentication via the dashboard session.

GET /dashboard/api/translate/spend

Returns translation spend aggregated by month and model for the last 6 months. Customers see only their own spend; admins see all accounts.

Response (200 OK)

{
  "status_code": 200,
  "data": {
    "summary": {
      "total_revenue_usd": 247.50,
      "total_bedrock_cost_usd": 89.30,
      "total_jobs": 18,
      "total_pairs": 142
    },
    "months": [
      {
        "month": "2026-05",
        "revenue_usd": 132.00,
        "bedrock_cost_usd": 48.20,
        "jobs": 10,
        "pairs": 78,
        "by_model": {
          "claude-haiku-3.5": {"jobs": 3, "pairs": 24, "cost_usd": 9.60},
          "claude-sonnet-4.6": {"jobs": 6, "pairs": 48, "cost_usd": 79.20},
          "claude-opus-4": {"jobs": 1, "pairs": 6, "cost_usd": 43.20}
        }
      }
    ]
  },
  "error": ""
}

GET /dashboard/api/translate/refunds

Returns refund history for translation purchases. Admin-only — non-admin accounts receive 403.

Response (200 OK)

{
  "status_code": 200,
  "data": {
    "refunds": [
      {
        "refunded_at": "2026-05-22T14:30:00Z",
        "quote_id": "qt-a1b2c3d4e5f6",
        "doc_name": "api-reference.html",
        "customer_email": "user@example.com",
        "original_amount": 11.05,
        "refund_amount": 11.05,
        "state": "refunded"
      }
    ],
    "count": 1
  },
  "error": ""
}

GET /dashboard/api/translate/notifications

Returns unread notification count and recent completed job summaries for the authenticated user's translation API key.

Response (200 OK)

{
  "status_code": 200,
  "data": {
    "unread_count": 2,
    "notifications": [
      {
        "job_id": "019e5bdc36a5-c87d32a56bc39bee",
        "completed_at": "2026-05-24T21:25:00Z",
        "state": "succeeded",
        "docs": ["Trinity-Beast-Translation-Service.html"],
        "langs": 11,
        "succeeded_pairs": 11,
        "failed_pairs": 0
      }
    ]
  },
  "error": ""
}

POST /dashboard/api/translate/notifications/seen

Marks all notifications as seen. Resets the badge count to 0. No request body required.

Response (200 OK)

{
  "status_code": 200,
  "data": {
    "message": "Notifications marked as seen"
  },
  "error": ""
}

Polling behavior: The dashboard SPA polls /dashboard/api/translate/notifications every 60 seconds. The seen state is stored in Valkey at dashboard:notifications:seen:{api_key_id} with a 30-day TTL. Only translation job completions generate notifications — quotes, cancellations, and in-progress updates do not.

16. i18n Key Translation API

Automated multi-lingual JSON key translation for the website's internationalization system. Detects missing keys across all 11 target languages and fills them via Amazon Bedrock (Claude) or manual injection. The website serves language JSON from Valkey via GET /public/lang/{code} — this endpoint keeps all languages in sync with English.

16.1 Translate i18n Keys

Detects missing keys and translates them. Bedrock mode is async (fire-and-forget) — returns a job ID immediately and processes in the background. Manual mode and dry-run are synchronous.

PropertyValue
EndpointPOST /admin/translate-i18n-keys
AuthX-Admin-Key header
Content-Typeapplication/json

Request Body

FieldTypeDefaultDescription
modestring"bedrock""bedrock" (async, AI-powered) or "manual" (sync, pre-translated values)
namespacestring"*"Target namespace prefix (e.g., "translate", "docLibrary", "*" for all)
target_langsstring[]["all"]["all"] or specific codes like ["es","pt","fr"]
dry_runboolfalseIf true, report missing keys without writing
keysobjectnullManual mode only — pre-translated key/value pairs per language
sync_s3boolfalseReserved — sync updated JSON to S3 after translation

Example — Bedrock Mode (Async)

POST /admin/translate-i18n-keys
X-Admin-Key: {admin_key}
Content-Type: application/json

{
  "namespace": "translate",
  "target_langs": ["all"]
}

Response (202 Accepted)

{
  "status": "✅ [LPO] [us-east-2] [BeastMain] [/admin/translate-i18n-keys] [202]",
  "status_code": 202,
  "data": {
    "status": "accepted",
    "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "mode": "bedrock",
    "namespace": "translate",
    "source_keys": 62,
    "target_langs": ["es","pt","fr","de","ru","hi","ur","it","ar","ja","zh"],
    "message": "Translation job started. Poll /admin/translate-i18n-keys/status/{job_id} for progress."
  }
}

Example — Dry Run (Sync)

POST /admin/translate-i18n-keys
X-Admin-Key: {admin_key}
Content-Type: application/json

{
  "namespace": "*",
  "dry_run": true,
  "target_langs": ["es","ja"]
}

Response (200 OK)

{
  "data": {
    "status": "dry_run",
    "namespace": "*",
    "source_keys": 1583,
    "languages": [
      {"lang": "es", "missing_keys": ["dailyReports.loadError", "..."], "status": "dry_run"},
      {"lang": "ja", "missing_keys": ["dailyReports.loadError", "..."], "status": "dry_run"}
    ]
  }
}

Example — Manual Mode (Sync)

POST /admin/translate-i18n-keys
X-Admin-Key: {admin_key}
Content-Type: application/json

{
  "mode": "manual",
  "namespace": "translate",
  "target_langs": ["all"],
  "keys": {
    "translate.hero.title": {
      "es": "Motor de Traducción",
      "pt": "Motor de Tradução",
      "fr": "Moteur de Traduction",
      "de": "Übersetzungsmaschine",
      "ru": "Движок перевода",
      "hi": "अनुवाद इंजन",
      "ur": "ترجمہ انجن",
      "it": "Motore di Traduzione",
      "ar": "محرك الترجمة",
      "ja": "翻訳エンジン",
      "zh": "翻译引擎"
    }
  }
}

16.2 Check Translation Job Status

Poll the status of an async Bedrock translation job. Jobs are stored in Valkey with a 24-hour TTL.

PropertyValue
EndpointGET /admin/translate-i18n-keys/status/{job_id}
AuthX-Admin-Key header

Response (200 OK)

{
  "data": {
    "job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "status": "completed",
    "mode": "bedrock",
    "namespace": "translate",
    "source_keys": 62,
    "target_langs": ["es","pt","fr","de","ru","hi","ur","it","ar","ja","zh"],
    "started_at": "2026-05-22T19:10:00Z",
    "completed_at": "2026-05-22T19:12:34Z",
    "total_translated": 682,
    "languages": [
      {"lang": "es", "translated": 62, "status": "ok"},
      {"lang": "pt", "translated": 62, "status": "ok"},
      {"lang": "fr", "translated": 62, "status": "ok"}
    ]
  }
}

16.3 Supported Languages

CodeLanguageCodeLanguage
esSpanisharArabic
ptPortuguesejaJapanese
frFrenchzhChinese (Simplified)
deGermanitItalian
ruRussianhiHindi
urUrdu

16.4 How It Works

  1. Reads lang:en from Valkey (source of truth for all i18n keys)
  2. Flattens nested JSON into dot-notation keys (e.g., translate.hero.title)
  3. For each target language, reads lang:{code} and identifies missing keys
  4. Bedrock mode: translates in batches of 15 keys per API call (reliable JSON output)
  5. Validates every key survives the round-trip (falls back to English if Bedrock drops one)
  6. Merges translations into the existing language JSON (preserves all other keys)
  7. Writes updated JSON back to Valkey — immediately available via GET /public/lang/{code}

16.5 Notes