Model management
Frontend route:- Add or update model providers.
- Enable model entries for agents.
- Sync pricing from the model catalog.
- Disable models that should not be used.
Model create / edit dialog
Add and Edit share one<ModelDialog /> component (mode: "create" | "edit").
- Standard fields: Provider, Model ID (catalog autocomplete), API Key (BYOK), Display Name, Base URL, Description (create only).
- Advanced Settings (collapsed by default): input/output cost per 1M tokens, context window, max output tokens, and capability switches (Vision, Function Calling, Streaming, Active).
- Provider and Model ID stay editable in both modes.
Test a model connection
Use Test Connection before saving to verify that the selected provider, model ID, API key, and base URL can complete a lightweight model request.1
Configure the model
Select a provider and model ID, then select an API key and enter a base URL
when the provider requires one.
2
Run the connection test
Select Test Connection. The button is available after you enter a model
ID.
3
Review the result
Continue saving after a successful test. If the test fails, correct the
credentials, model ID, provider, or base URL shown in the error and test
again.
A successful connection test confirms that the current configuration can reach
the provider. It does not save or enable the model.
Provider API key management
Provider credentials are managed from the Models page. Each API key is a parent record: one key can serve many models, and models are assigned to a key from the model side. Admin key endpoints:- Credentials are encrypted at rest and shown masked after creation.
- Deleting a key does not delete its models; they fall back to the platform default credential.
- Keys marked as BYOK (bring your own key) belong to a specific application or user context.
These provider keys are different from personal platform API keys, which authenticate users calling the Pinter API. See Platform API keys.
Quota management
Frontend route:Default quota on user creation
When a new user is created (via self-registration, SSO JIT provisioning, or admin creation), a default monthly quota is automatically assigned:
Additional approved top-up requests increase the monthly budget.
6-hour sliding budget rate limiter
To prevent rapid budget consumption, each AI request is checked against a sliding 6-hour window:- Budget consumed in the last 6 hours is computed from
token_usage. - Limit = 10% of total monthly budget (
max_cost_per_month + approved_amount). - If the 6-hour spend reaches the limit, the request is blocked with HTTP 429 and message:
"Batas penggunaan 6 jam terlampaui (Maksimal 10% dari total kuota bulanan)."
- 6h Budget (10%) progress bar.
- Near Limit orange badge when >80% consumed.
- Remaining budget until the next sliding window.
Anomaly detection
After each AI request is logged, a background task checks for cost anomalies:- Calculates the user’s average hourly cost over the last 7 days (total cost ÷ 168 hours).
- Compares with actual spend in the last 1 hour.
- If 1-hour spend > 3× average hourly cost, a
quota_alertsrow is inserted withalert_type: "anomaly"andthreshold_percent: 300.
Cost tracking — user × model breakdown
The/api/v2/quotas/usage/detailed endpoint now returns an additional by_user_model array, showing cost and request count grouped by each user-model combination. This is displayed in the Admin Usage page under the User×Model tab.
Usage/me — 6-hour budget fields
The/api/v2/quotas/usage/me response includes additional fields: