Skip to content
Back to skills

Ai Sdk Essentials

ASecurity

Build AI features with the first-party Laravel AI SDK (Laravel 13+); agents, embeddings, images, audio, and tool calling with provider-agnostic APIs

  • 147 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 6, 2026
ai-agentstestingapi

Works with

  • api

Security analysis

A100/100

Scanned September 6, 2026

npx -y skills add jpcaparas/superpowers-laravel --skill ai-sdk-essentials --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ai Sdk Essentials?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ai Sdk Essentials
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jpcaparas-ai-sdk-essentials/badge)](https://www.skillsdirectory.com/skills/jpcaparas-ai-sdk-essentials)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: laravel:ai-sdk
description: Build AI features with the first-party Laravel AI SDK (Laravel 13+); agents, embeddings, images, audio, and tool calling with provider-agnostic APIs
---

# 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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.