Endpoint management, prompt templates, completions and usage tracking for three OpenAI-compatible providers: OpenRouter, Mistral and DeepSeek. API keys come from PhoenixKit Integrations, and every call is logged with tokens, cost in US dollars, latency and caller context. Other modules declare AI tasks against it and call it for chat, embeddings, speech and image work.
Use it when
- Your app calls an LLM and you want endpoints, prompts and costs managed from the admin
- You need spend caps and a log of every AI request per user or endpoint
What it gives you
- Endpoints combining provider credentials, model and generation parameters (OpenRouter, Mistral, DeepSeek)
- Prompt templates with {{Variable}} substitution and live preview
- ask/3, complete/3 and embed/3; speak/3 and transcribe/3 for speech
- Usage log with tokens, cost, latency and status; spend caps and a request cache
- Admin pages: Endpoints, Prompts, Playground, Usage, Tasks under /admin/ai
- Reasoning output from reasoning models stored in request metadata
Example
{:ok, response} = PhoenixKitAI.ask(endpoint.uuid, "What is 2+2?")
{:ok, text} = PhoenixKitAI.extract_content(response)
AI news
Nothing posted about AI yet. Read its changelog or see all PhoenixKit news.
Install
1
Add to mix.exs
{:phoenix_kit_ai, "~> 0.28"}
2 Fetch it and run its migrations
$ mix deps.get && mix phoenix_kit.update
3
Switch it on in /admin/modules
- Package
- phoenix_kit_ai
- Releases
-
- 0.28.0
- 0.27.0
- 0.26.1
- Admin
-
/admin/ai - Used by
- AI Agent Catalogue Projects Publishing Warehouse
- Links
- HexDocs ↗ GitHub ↗ Changelog ↗
Related modules
What it needs, what builds on it, and its neighbours in AI.
AI Agent
Per-user AI chats that call tools from the PhoenixKit API registry
Needs AI
Catalogue
Product catalogues with manufacturers, suppliers, categories, items and pricing
Needs AI, Entities
Projects
Projects built from a reusable task library, with dependencies and schedules
Needs AI, Staff, Comments, Entities
Publishing
Database-backed CMS for blogs and docs, multi-language and versioned
Needs AI
Warehouse
Stock per item and location, with receipts, issues, transfers and stocktakes
Needs Billing, AI, Catalogue, Comments, Locations