Skip to main content

Auth & Accounts

Login, session, device flow, user, role, and API Key.

đŸ“„ī¸Get the AI configurations and benefits available to the current user

Combine the administrator's open group, Sub2API balance, balance group usage, subscription usage, and key configuration status; user status uses 10-second in-process cache by default, and grouping uses 60-second in-process cache by default. The same concurrent queries will be merged. Temporary network, timeout, throttling, or 5xx faults after cache expiration can return the last successful result within the default 5-minute stale window; forced refresh and authoritative 4xx do not downgrade. Server does not synchronize the benefits, usage, binding status, or key status to the Workflow Server database, nor does it return the Sub2API key or key ID.

đŸ“„ī¸Save the current user's AI provider preferences

Save the Sub2API group IDs opened by the administrator in order. `groups` for `GET /api/auth/sub2api/catalog` and `credentials` for `GET /api/auth/sub2api/llm-credentials` use the same order; the run directory skips the currently unavailable configuration, but does not retry across provider after the model request has already begun. New groups that are not committed are appended in the default group ID order; an empty array removes user preferences and restores the default order.

đŸ“„ī¸Obtain the AI request usage of the current user.

Read the current login user's successive model requests and time range summary from the Sub2API page. The response only retains the display fields such as model, configuration, entry, token, cost, time consumption, and billing method, and does not return Sub2API Key, user information, IP address, User-Agent, upstream request ID, or internal account ID. Reads use the default 10-second in-process cache, concurrent merge, and the default 5-minute stale-if-error window, not synchronized to the Workflow Server database.

đŸ“„ī¸Gets the directory of server AI credentials available to the current user

This function returns the configuration that has been opened, the group is valid, the user key is active, and the subscription group has active subscription. `credentials` Follow the provider usage preferences saved by the current user. Configurations that are invalid, disabled, model empty, or model read failed will be skipped, and subsequent valid items will remain in relative order. Read-only Sub2API details follow the short-term cache and bounded stale-if-error strategy; 502 is returned when there is no cache or when the pocket window has expired and the upstream is unavailable. Sub2API determines available models, and Workflow Server supplements vision, networking, inference, and tool invocation capabilities with a built-in catalog of versioned models; unknown models do not declare capabilities. The response contains the one-hour short-term proxy credentials, but does not contain the real Sub2API Key. Only account sessions with user identity, account API Key or Server runtime capability are available; Administrator Key without user identity returns 403.

đŸ“„ī¸Get a model that AI grouping support

Only groups that have been opened to users by the administrator are allowed to query. When the custom model list is enabled for the group, the list prevails. When the custom model list is not enabled, the current model list of the active account in the group is read from the Sub2API page and merged and deduplicated. Server uses the 60-second in-process cache by default and merges the same concurrent requests without synchronizing the model list to the Workflow Server database.