pydantic-ai-agent-creation

pydantic-ai-agent-creation is a skill for Claude Code from existential-birds/beagle. It costs 47 tokens per session (1,150 once invoked), scanned A, original, Apache-2.0.

A guide for creating PydanticAI agents, which are programs that use language models to produce responses, with checked inputs and outputs.

In plain words
What is it for?
Use it to build AI agents or chat systems, connect supported model providers, configure models, and return structured data such as validated city information.
Why use it?
It helps prevent incorrectly shaped results by validating them against defined Python data models and keeps agent settings organized.

Skill for Claude Code

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

Part of the beagle-ai plugin — 13 skills shipped together

Good fit Use it to build AI agents or chat systems, connect supported model providers, configure models, and return structured data such as validated city information.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/existential-birds/beagle/pydantic-ai-agent-creation
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 existential-birds/beagle --skill pydantic-ai-agent-creation
Clone the repo
git clone --depth 1 https://github.com/existential-birds/beagle

Made for: Claude Code.

Or install beagle-ai, the plugin that ships this one along with the rest of its 13 skills.

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 pydantic-ai-agent-creation

README.md
[![agentmods](https://agentmods.dev/badge/skills/existential-birds/beagle/pydantic-ai-agent-creation/github.svg)](https://agentmods.dev/skills/existential-birds/beagle/pydantic-ai-agent-creation)
Your own site
<a href="https://agentmods.dev/skills/existential-birds/beagle/pydantic-ai-agent-creation"><img src="https://agentmods.dev/badge/skills/existential-birds/beagle/pydantic-ai-agent-creation/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 pydantic-ai-agent-creation

Your own site · 80×15
<a href="https://agentmods.dev/skills/existential-birds/beagle/pydantic-ai-agent-creation"><img src="https://agentmods.dev/badge/skills/existential-birds/beagle/pydantic-ai-agent-creation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,150 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.00047 $0.01150
Opus 5 $0.00023 $0.00575
Sonnet 5 $0.00009 $0.00230
Haiku 4.5 $0.00005 $0.00115

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

Security

Grade A, and why

pydantic-ai-agent-creation 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.

plugins/beagle-ai/skills/pydantic-ai-agent-creation/SKILL.md · 166 lines

How it starts

The opening of the file, as written. The whole thing — 166 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Creating PydanticAI Agents

Quick Start

from pydantic_ai import Agent

# Minimal agent (text output)
agent = Agent('openai:gpt-4o')
result = agent.run_sync('Hello!')
print(result.output)  # str

Model Selection

Model strings follow provider:model-name format:

# OpenAI
agent = Agent('openai:gpt-4o')
agent = Agent('openai:gpt-4o-mini')

# Anthropic
agent = Agent('anthropic:claude-sonnet-4-5')
agent = Agent('anthropic:claude-haiku-4-5')

# Google
agent = Agent('google-gla:gemini-2.0-flash')
agent = Agent('google-vertex:gemini-2.0-flash')

# Others: groq:, mistral:, cohere:, bedrock:, etc.

Structured Outputs

Use Pydantic models for validated, typed responses:

from pydantic import BaseModel
from pydantic_ai import Agent

class CityInfo(BaseModel):
    city: str
    country: str
    population: int

agent = Agent('openai:gpt-4o', output_type=CityInfo)
result = agent.run_sync('Tell me about Paris')
print(result.output.city)  # "Paris"
print(result.output.population)  # int, validated

Agent Configuration

from pydantic_ai import Agent
from pydantic_ai.settings import ModelSettings

agent = Agent(
    'openai:gpt-4o',
    output_type=MyOutput,           # Structured output type
    deps_type=MyDeps,               # Dependency injection type
    instructions='You are helpful.',  # Static instructions
    retries=2,                      # Retry attempts for validation
    name='my-agent',                # For logging/tracing
    model_settings=ModelSettings(   # Provider settings
        temperature=0.7,
        max_tokens=1000
    ),
    end_strategy='early',           # How to handle tool calls with results
)

Running Agents

Three execution methods:

# Async (preferred)
result = await agent.run('prompt', deps=my_deps)

# Sync (convenience)
result = agent.run_sync('prompt', deps=my_deps)

# Streaming
async with agent.run_stream('prompt') as response:
    async for chunk in response.stream_output():
        print(chunk, end='')

Read the full file on GitHub · 166 lines

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 · 166 lines · 47 tokens per session scan A 0e48ba0ae2c6

Subscribe to this mod's changes

pydantic-ai-agent-creation is a skill published in the GitHub repository existential-birds/beagle (80 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 47 tokens to every session and 1,150 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.