Skip to content

AI 0.25.0: Endpoints by name and a daily call cap per user

AI 0.25.0 lets an app call an AI endpoint by its name instead of a uuid, adds a daily cap on how many AI calls one user may make, and makes the admin pages use PhoenixKit’s shared components.

Endpoints by name

PhoenixKitAI.get_endpoint_by_name/1 and resolve_endpoint_by_name/1 find an endpoint by its name, ignoring case and surrounding spaces. An app can ask for “Label reader” instead of carrying a uuid. Disabled endpoints are found too, but calling one is still refused. When several endpoints share the name, one spelled exactly that way comes first, then the oldest.

A call cap per user

The new ai_daily_calls_per_user setting caps how many successful calls one user makes in the last 24 hours, whatever each call costs. A money cap means little against a cheap model; a count says directly how much one person may use. Cached answers count, failed calls do not, and 0 means no cap. A user over the cap gets “You have made as many AI requests as allowed for the last 24 hours”, and code gets {:error, {:budget_exceeded, :user_calls}}. The budget warning event reports call counts for this cap too.

For developers

source_prefix: on list_requests/1 and get_usage_stats/1 totals one app’s calls across its many source: strings. images_as: on extract_text/3 says how several images relate: :pages (the default), :separate, or a sentence of your own. The per-call temperature:, max_tokens:, top_p: and seed: options are now documented.

In the admin

The AI admin pages now use PhoenixKit’s own modal, accordion, status badge, toggle, select and button components. Some labels are shorter (New endpoint instead of New AI Endpoint), and the labels of a request’s details are translated.

Upgrading

No migration. Update the dependency. The per-user call cap is off until you set ai_daily_calls_per_user. It counts calls by the user_uuid: your code passes, so a value that is not a PhoenixKit user is never capped.

Full release notes: AI 0.25.0

0.25.0 · 1 October 2026

Added

  • Endpoints by name (PR #33). PhoenixKitAI.get_endpoint_by_name/1 and resolve_endpoint_by_name/1 find an endpoint by its name, ignoring case and surrounding spaces, so an app can say “Label reader” instead of carrying a uuid. Disabled endpoints are returned (calling one is still refused). With no exact match the oldest endpoint wins.
  • Per-user call cap. ai_daily_calls_per_user (Budget scope :user_calls) caps how many successful calls one user makes in 24 hours, whatever each cost. Hitting it returns {:error, {:budget_exceeded, :user_calls}}. The [:phoenix_kit_ai, :budget, :warning] event reports call counts for this scope.
  • source_prefix: on list_requests/1 and get_usage_stats/1 totals one app’s calls across its many source: strings. LIKE wildcards in the prefix are matched literally.
  • images_as: on extract_text/3 says how several images relate: :pages (default), :separate, or a sentence of the caller’s own. Per-call temperature:, max_tokens:, top_p: and seed: are documented.

Changed

  • The AI admin pages use core components (modal, accordion, status badge, checkbox toggle, select, button) and gettext the request-details labels.

Fixed

  • The endpoints and prompts pages relied on a table toolbar slot (:toolbar_primary) and an untitled form_section that exist only in unreleased core, so on released core the New Endpoint and New Prompt buttons were missing and the app compiled with warnings. They use :toolbar_actions and a plain card again.

AI 0.25.0. Install or update: {:phoenix_kit_ai, "~> 0.25"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.