laravel:ai-sdk

laravel:ai-sdk is a skill for Claude Code from jpcaparas/superpowers-laravel. It costs 39 tokens per session (428 once invoked), scanned A, original, MIT.

A guide to Laravel’s official AI SDK, a PHP library for adding AI features to Laravel applications. It covers text generation, agents, embeddings, image generation, audio generation, and tool calling across several AI providers.

In plain words
What is it for?
Use it to add AI agents, text responses, vector embeddings for search, generated images, generated audio, and tools to a Laravel 13 or newer application.
Why use it?
It gives developers one application interface for AI features instead of tying their code to one provider’s API. It also explains patterns such as keeping credentials out of source code and validating structured results.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the superpowers-laravel plugin — 12 skills, 44 commands, 1 agent, 1 hook shipped together

Good fit Use it to add AI agents, text responses, vector embeddings for search, generated images, generated audio, and tools to a Laravel 13 or newer application.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jpcaparas/superpowers-laravel/ai-sdk-essentials
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add jpcaparas/superpowers-laravel --skill ai-sdk-essentials
Clone the repo
git clone --depth 1 https://github.com/jpcaparas/superpowers-laravel

Made for: Claude Code.

Or install superpowers-laravel, the plugin that ships this one along with the rest of its 12 skills, 44 commands, 1 agent, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for laravel:ai-sdk

README.md
[![agentmods](https://agentmods.dev/badge/skills/jpcaparas/superpowers-laravel/ai-sdk-essentials/github.svg)](https://agentmods.dev/skills/jpcaparas/superpowers-laravel/ai-sdk-essentials)
Your own site
<a href="https://agentmods.dev/skills/jpcaparas/superpowers-laravel/ai-sdk-essentials"><img src="https://agentmods.dev/badge/skills/jpcaparas/superpowers-laravel/ai-sdk-essentials/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for laravel:ai-sdk

Your own site · 80×15
<a href="https://agentmods.dev/skills/jpcaparas/superpowers-laravel/ai-sdk-essentials"><img src="https://agentmods.dev/badge/skills/jpcaparas/superpowers-laravel/ai-sdk-essentials.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 428 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.00428
Opus 5 $0.00019 $0.00214
Sonnet 5 $0.00008 $0.00086
Haiku 4.5 $0.00004 $0.00043

Measured 10d ago against content hash 470363cfff14, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

laravel:ai-sdk scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ai-sdk-essentials/SKILL.md · 50 lines

What it actually says

Laravel AI SDK Essentials (Laravel 13+)

Use the first-party AI SDK for provider-agnostic text generation, agents, embeddings, images, and audio. Keep provider details in config; keep app code portable across OpenAI, Anthropic, Gemini, Bedrock, Ollama, and others.

Commands

# Install the SDK
sail composer require laravel/ai        # or: composer require laravel/ai

# Basic agent prompt
use App\Ai\Agents\SalesCoach;

$response = SalesCoach::make()->prompt('Analyze this sales transcript...');
return (string) $response;

# Image generation
use Laravel\Ai\Image;
$image = Image::of('A donut sitting on the kitchen counter')->generate();

# Audio synthesis
use Laravel\Ai\Audio;
$audio = Audio::of('I love coding with Laravel.')->generate();

# Embeddings (also see laravel:vector-search)
use Illuminate\Support\Str;
$embeddings = Str::of('Napa Valley has great wine.')->toEmbeddings();

Patterns

  • Keep API keys in .env; never hardcode provider credentials
  • Define agents as dedicated classes with focused instructions; one responsibility per agent
  • Use structured output with validation when the response feeds business logic
  • Give agents the fewest tools needed; treat tool calling like any other authorization surface
  • Configure provider/model failover for production resilience
  • Queue long-running generations (images, audio, batch embeddings) instead of blocking requests
  • Cache embeddings for stable inputs; regenerating them costs money and time

Testing

  • Fake AI responses in tests; never call real providers from the test suite
  • Assert on prompts/inputs sent to the SDK, not just outputs
  • Feature test the surrounding flow (queueing, persistence, authorization) with the AI layer faked
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 50 lines · 39 tokens per session scan A 470363cfff14

Subscribe to this mod's changes

laravel:ai-sdk is a skill published in the GitHub repository jpcaparas/superpowers-laravel (153 stars, last pushed 2mo ago), licensed MIT. It adds 39 tokens to every session and 428 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

gemini-api-dev

Use this skill when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, video generation, streaming responses, background research tasks, function calling, structured output, or migrating from the old generateContent API. Covers SDK usage and best…

google-gemini/gemini-skills · 73 tokens

cloudflare-workers-ai

Cloudflare Workers AI for serverless GPU inference. Use for LLMs, text/image generation, embeddings, or encountering AIERROR, rate limits, token exceeded errors.

secondsky/claude-skills · 39 tokens

anthropic-claude-development

Expert guidance for Anthropic Claude API development including Messages API, tool use, prompt engineering, and building production applications with Claude models.

Mindrally/skills · 33 tokens

openrouter-ai-models-guide

Guide to OpenRouter — the unified API for 200+ AI models from OpenAI, Anthropic, Google, Meta, Mistral, and more. Covers model selection, pricing, routing strategies, fallback chains, and integration with SperaxOS for optimal model usage per task.

nirholas/three.ws · 64 tokens

LLM

Implement large language model (LLM) chat completions using the z-ai-web-dev-sdk. Use this skill when the user needs to build conversational AI applications, chatbots, AI assistants, or any text generation features. Supports multi-turn conversations, system prompts, and context management.

jjyaoao/HelloAgents · 59 tokens

pywayne-llm-chat-bot

LLM chat interface using OpenAI-compatible APIs with streaming support and session management. Use when working with pywayne.llm.chatbot module for creating LLM chat instances with custom configuration, managing multi-turn conversations with history, handling streaming responses, or managing multiple chat sessions…

wangyendt/wayne-skills · 65 tokens