Artisan commands
| Command | Description |
|---|---|
ai:make-task | Generate a task class |
ai:request | Ad-hoc sync or queued request |
ai:runs | List recent ai_runs |
ai:retry | Re-dispatch failed and stuck runs |
ai:budget | Tenant’s spend vs limit |
ai:models | Models available from a provider’s API |
ai:make-task
Section titled “ai:make-task”php artisan ai:make-task SummarizeTaskphp artisan ai:make-task Orders/AnalyzeTask --queuedCreates the class in App\Ai\Tasks (subdirectories via /), with SerializesModelsAi.
| Option | Description |
|---|---|
--queued | Implement ShouldQueueAi |
--force | Overwrite an existing file |
ai:request
Section titled “ai:request”php artisan ai:request "Summarize the plot of Hamlet"php artisan ai:request "..." --driver=anthropic --rawphp artisan ai:request "..." --queue| Option | Description |
|---|---|
--driver= | Driver name |
--modality=text | text or embed |
--temperature= | Sent only when given (some models reject it) |
--tenant= | Tenant ID |
--queue | Dispatch to the queue, print the run id |
--json | Print the content only |
--raw | Also print usage: tokens, cost |
ai:runs
Section titled “ai:runs”php artisan ai:runs --task=summarize --status=dead --limit=50| Option | Description |
|---|---|
--tenant= | Filter by tenant |
--task= | Filter by task name |
--status= | Filter by status |
--limit=20 | Rows |
ai:retry
Section titled “ai:retry”Re-dispatches runs with status error or dead: rebuilds the task from task_class/task_args in ai_runs.request and re-queues it into the same row (status goes back to queued).
php artisan ai:retry # failures from the last 24hphp artisan ai:retry --since=1h --limit=10php artisan ai:retry --stuck # also stuck queued/running runsphp artisan ai:retry --dry-run # list only, change nothing| Option | Description |
|---|---|
--since=24h | Period in hours |
--limit=50 | Max runs |
--stuck | Include stuck runs |
--dry-run | Only list what would be retried |
Task constructor arguments are stored only with AI_STORE_REQUEST=true — runs recorded without them are listed as skipped. Tasks whose constructor has no required parameters can always be retried.
A failed attempt of a sync call whose fallback driver then answered is not retried — the call already has its result (response.superseded_by points to the row that answered).
ai:budget
Section titled “ai:budget”php artisan ai:budget tenant-abcphp artisan ai:budget tenant-abc --month=2026-09php artisan ai:budget tenant-abc --from=2026-09-01 --to=2026-09-15| Argument / option | Description |
|---|---|
tenant | Tenant ID, default default |
--month= | Month YYYY-MM |
--from=, --to= | Date range YYYY-MM-DD; --to defaults to today |
ai:models
Section titled “ai:models”php artisan ai:models # all configured driversphp artisan ai:models gemini # one driverphp artisan ai:models openai --filter=gpt-5 # filter by substringphp artisan ai:models anthropic --detail # token limits, release date, capabilitiesThe currently configured model is marked with ✓. Groq, Mistral, DeepSeek, xAI, Ollama and OpenRouter are queried via the OpenAI-compatible /v1/models endpoint at each provider’s default URL; set ai.providers.{driver}.url only to override it (e.g. a self-hosted Ollama).
From code — AI::models().