Pydantic AI
davila7/claude-code-templates
Build production-ready AI agents with PydanticAI — type-safe tool use, structured outputs, dependency injection, and multi-model support.
Add a new provider API capability (prompt caching, strict/structured tool calling, thinking/reasoning effort, service tier, safety settings, logprobs, etc.) to Pydantic AI.
$ npx skills add pydantic/pydantic-ai --skill adding-a-provider-api-feature -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install pydantic/pydantic-ai adding-a-provider-api-feature --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/pydantic/pydantic-ai.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/adding-a-provider-api-feature .claude/skills/adding-a-provider-api-feature && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "adding-a-provider-api-feature" agent skill from https://github.com/pydantic/pydantic-ai/tree/main/.agents/skills/adding-a-provider-api-feature into .claude/skills/adding-a-provider-api-feature/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adding-a-provider-api-feature", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/pydantic/pydantic-ai/tree/main/.agents/skills/adding-a-provider-api-featureType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add pydantic/pydantic-ai --skill adding-a-provider-api-feature -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install pydantic/pydantic-ai adding-a-provider-api-feature --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/pydantic/pydantic-ai.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/adding-a-provider-api-feature .agents/skills/adding-a-provider-api-feature && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "adding-a-provider-api-feature" agent skill from https://github.com/pydantic/pydantic-ai/tree/main/.agents/skills/adding-a-provider-api-feature into .agents/skills/adding-a-provider-api-feature/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adding-a-provider-api-feature", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add pydantic/pydantic-ai --skill adding-a-provider-api-feature -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install pydantic/pydantic-ai adding-a-provider-api-feature --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/pydantic/pydantic-ai.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/adding-a-provider-api-feature .cursor/skills/adding-a-provider-api-feature && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "adding-a-provider-api-feature" agent skill from https://github.com/pydantic/pydantic-ai/tree/main/.agents/skills/adding-a-provider-api-feature into .cursor/skills/adding-a-provider-api-feature/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adding-a-provider-api-feature", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/pydantic/pydantic-ai.git --path .agents/skills/adding-a-provider-api-feature--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add pydantic/pydantic-ai --skill adding-a-provider-api-feature -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install pydantic/pydantic-ai adding-a-provider-api-feature --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/pydantic/pydantic-ai.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/adding-a-provider-api-feature .gemini/skills/adding-a-provider-api-feature && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "adding-a-provider-api-feature" agent skill from https://github.com/pydantic/pydantic-ai/tree/main/.agents/skills/adding-a-provider-api-feature into .gemini/skills/adding-a-provider-api-feature/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adding-a-provider-api-feature", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install pydantic/pydantic-ai adding-a-provider-api-featureInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add pydantic/pydantic-ai --skill adding-a-provider-api-feature -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/pydantic/pydantic-ai.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/adding-a-provider-api-feature .github/skills/adding-a-provider-api-feature && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "adding-a-provider-api-feature" agent skill from https://github.com/pydantic/pydantic-ai/tree/main/.agents/skills/adding-a-provider-api-feature into .github/skills/adding-a-provider-api-feature/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adding-a-provider-api-feature", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add pydantic/pydantic-ai --skill adding-a-provider-api-feature -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install pydantic/pydantic-ai adding-a-provider-api-feature --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/pydantic/pydantic-ai.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/adding-a-provider-api-feature .opencode/skills/adding-a-provider-api-feature && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "adding-a-provider-api-feature" agent skill from https://github.com/pydantic/pydantic-ai/tree/main/.agents/skills/adding-a-provider-api-feature into .opencode/skills/adding-a-provider-api-feature/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adding-a-provider-api-feature", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
adding-a-provider-api-featureAdd a new provider API capability (prompt caching, strict/structured tool calling, thinking/reasoning effort, service tier, safety settings, logprobs, etc.) to Pydantic AI.
Adding A Provider API Feature is an agent skill from pydantic/pydantic-ai, published by the product's own GitHub organization. Add a new provider API capability (prompt caching, strict/structured tool calling, thinking/reasoning effort, service tier, safety settings, logprobs, etc.) to Pydantic AI. Use when wiring a provider feature through the library — it enforces reasoning from the existing cross-provider abstraction before designing anything, and picking default-on vs opt-in deliberately. Not for adding a new model id (that's a different flow) or a bug fix.
Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in AI & LLM Engineering, covering Structured output and tool calling, LLM cost and token optimization and Debugging. It works with Pydantic AI. The repository describes itself as: How Python does AI. Agents, realtime voice, image generation, embeddings. Every model, every interface, typed end to end. The licence is MIT.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 402a2ed. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
Bash(git:*)Bash(gh:*)Bash(rg:*)Bash(ls:*)Bash(uv:*)ReadWriteEditGlobGrep…and 3 more on the same allowed-tools line.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
ghFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use gh, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Adding A Provider API Feature loads about 3.2k tokens when it runs. Until then it costs about 118 tokens; SKILL.md has 1,313 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from pydantic/pydantic-ai at commit 402a2ed, republished under its MIT licence (© pydantic). 1,313 words, ~3,210 tokens.
.claude/skills/adding-a-provider-api-feature/SKILL.md (or your agent's skills folder).Use this when exposing a new provider API capability through Pydantic AI — prompt caching, strict/structured tool calling, thinking/reasoning effort, service tier, safety settings, logprobs, cache breakpoints, and the like. The output is a change that is consistent with how sibling providers already expose the same concept, defaults deliberately, and gates support with a capability flag.
Not for: adding a new model id (that's add-new-model), a bug fix, or a refactor.
Before designing anything, find the existing cross-provider abstraction that governs this capability and let its shape decide the API. Most "how should I expose this?" questions are already answered by an abstraction the codebase has — reaching for a new provider-specific knob when one exists is the single most common thing maintainers reject. When a feature routes through an existing abstraction, the abstraction's shape pre-decides the API surface, the opt-out, and often the default.
The tell that you skipped this: you find yourself listing 2-3 "options" for how a user controls the feature. If one of those options duplicates an existing cross-provider control, it isn't a real option — the existing abstraction wins.
For the capability you're adding, list how every provider that already has an analog exposes it, and name the governing existing abstraction. It is one of:
ToolDefinition.strict: bool | None (tools.py), resolved in models/__init__.py::_customize_tool_def;ModelSettings field — thinking, service_tier (settings.py), each with per-model resolvers mapping to native concepts;{Provider}ModelSettings field — anthropic_cache, openai_prompt_cache_key, groq_reasoning_effort;CachePoint in UserPromptPart.content (messages.py);ModelProfile capability flag — openai_supports_strict_tool_definition, bedrock_supports_prompt_caching.Read the actual sibling implementations and any review threads on the PRs that added them (gh pr view <n> --comments). Contributors who skipped this got redirected: raw google_tool_config → use strict (#5366); string-prefix model detection → use a profile flag (#4604). Only open a design fork if no existing abstraction covers the capability.
_translate_* resolver, a JsonSchemaTransformer subclass, a CachePoint translation). Do not add a provider-prefixed knob for something the shared abstraction already expresses.ModelSettings field with a deliberately narrow common vocabulary and per-model resolvers, keeping per-provider fields underneath as precedence-winning escape hatches (the service_tier promotion, #4926). Don't delete provider knobs; deprecate only genuinely-misnamed ones with a TODO(v3).{provider}_* knob is justified, and it coexists with and outranks the unified field (groq_reasoning_effort, #5797).CachePoint); a structural region (system prompt, tool defs, whole-request setting) → a setting (#3363).Literal, never extra_body or untyped **kwargs (models/AGENTS.md; "kwargs are a big no no… I'd rather be repetitive but type safe" — DouweM, #3457).Default the feature on only when enabling it cannot change observable behavior and cannot cost the user — a pure, backward-compatible improvement (caching only lowers cost; a validation mode that needs no schema rewrite and can't reject a previously-valid request). A backward-compatible, purely-better default is welcome and needs no opt-in.
Keep it opt-in when it:
service_tier 'auto' vs 'default', #4926);When the default isn't obvious, decide it with a live probe, not an opinion (#5897 flipped a default on 0/5 → 5/5 recovery). Beware "automatic" language — verify whether it means a Pydantic AI default or just provider-side management of an opt-in feature.
Detect support with a provider-prefixed ModelProfile flag set in Provider.model_profile() — never inline isinstance/model-name checks (profiles/AGENTS.md). Gate at the layer(s) that actually vary:
google_supports_strict_tool_definition, bedrock_supports_prompt_caching);JsonSchemaTransformer.is_strict_compatible signal (default conservative unless the mode needs no rewrites);UserWarning (#5580, botocore strict param);Unsupported → silently ignore the setting (best-effort so as many requests as possible succeed), documented in the docstring — never hard-error. Conflicting user settings → UserWarning, not UserError. Profiles are layered: developer-keyed base + thin provider overlay resolved per family, with the provider overlay layering last (#5934, #6231).
Live-recorded wire-contract cassette asserting the exact outbound body (mode/field is sent for supported models, absent/ignored for unsupported), plus a test exercising the new setting. Prefer case-based parametrized VCR over mocks; a unit test is still right for asserting an internal request shape a cassette matcher wouldn't catch. This is also where a review bot's "this will fail" claim gets refuted with a recorded cassette.
The new public symbol's docstring lists which providers support it and how each interprets the value. Add/refresh the docs/**.md section and any sibling docstrings that now under-claim ("only OpenAI" → the full provider list). Describe the mechanism only as far as the provider documents it — don't assert a mechanism a provider's docs leave unstated. Update the relevant agent skill.
ModelSettings' Supported by: lists are enforced: tests/models/test_model_settings_support.py probes each model class's outgoing request and asserts every list names exactly the classes that send the field. Forwarding a new setting means editing its list, and a new Model class means adding a Case there. tool_choice and thinking are exempt via HAND_MAINTAINED and stay hand-maintained.
strict… already represented on ToolDefinition… a more complete, consistent, 'doesn't require the user to do something special' implementation would be to automatically use this mode." (#5366)ModelProfile flags, layered base + overlay. (#5934){provider}_* knob today can note the future Caching/Thinking-style capability it should fold into. (#4604)| Capability | Reused abstraction | Default | Gating | PR |
|---|---|---|---|---|
| service tier (cross-provider) | promoted to ModelSettings.service_tier | opt-in, never silent upgrade | map-and-drop | #4926 |
| strict — OpenAI (origin) | ToolDefinition.strict | auto-promote per compatible schema | per-schema is_strict_compatible | #1304 |
| strict — Anthropic | reused strict | conservative opt-in | transformer + profile flag | #3457 |
| strict — Bedrock (+ fix) | reused strict | opt-in (auto-promote reverted) | transformer + profile + SDK probe | #4237, #5580 |
strict — Gemini VALIDATED | reused strict; rejected raw google_tool_config | default-on (mode needs no schema rewrite) | profile flag; is_strict_compatible = True | #6353 |
| thinking (cross-provider) | ModelSettings.thinking + per-provider maps | opt-in, graceful degradation | supports_thinking flags | #4640 |
| reasoning effort — Groq | provider knob coexists with thinking, outranks it | opt-in | per-family profile flag | #5797, #6231 |
| prompt caching — Anthropic → Bedrock/OpenRouter | CachePoint marker + settings | opt-in | {provider}_supports_prompt_caching | #3363, #3438, #4604 |
© pydantic, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/adding-a-provider-api-feature of pydantic/pydantic-ai.
Open the folder on GitHubat commit 402a2ed
Adding A Provider API Feature next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Adding A Provider API Feature this skillpydantic/pydantic-ai | 20k | — | ~3.2k | Automated safety check: Pass | MIT | |
| Pydantic AIdavila7/claude-code-templates | 32k | 4 repos | ~2.9k | Automated safety check: Pass | MIT | |
| Building Pydantic AI Agentsdocling-project/docling | 68k | — | ~2.8k | Automated safety check: Pass | MIT | |
| Celeste Pythonwithceleste/celeste-python | 221 | — | ~1.1k | Automated safety check: Pass | MIT | |
| Prompt EngineerJeffallan/claude-skills | 12k | 1 repos | ~1.5k | Automated safety check: Pass | MIT | |
| Langfuse and LLM Gateway LogsKonghaYao/peri | 223 | — | ~4.3k | Automated safety check: Notes | Apache-2.0 |
davila7/claude-code-templates
Build production-ready AI agents with PydanticAI — type-safe tool use, structured outputs, dependency injection, and multi-model support.
docling-project/docling
Patterns and tested examples for building agents with Pydantic AI: tools, capabilities, structured output, dependency injection, hooks, YAML specs, streaming and testing.
withceleste/celeste-python
A skill your agent uses whenever writing, modifying, reviewing, or debugging code involving Celeste, celeste-ai, celeste-python, import celeste, src/celeste, or withceleste app integrations.
Jeffallan/claude-skills
Designs, tests and refines LLM prompts: zero-shot, few-shot and chain-of-thought patterns, system prompts, structured output schemas and evaluation test suites.
KonghaYao/peri
Queries Langfuse traces, prompts, datasets and sessions, and analyzes local LLM gateway logs for requests, context growth, token use and cache hits.
pydantic/skills
Build AI agents with Pydantic AI — tools, capabilities (including on-demand loading), structured output, streaming, testing, and multi-agent patterns.
pydantic/pydantic-ai
Adds optional capabilities to Pydantic AI agents from pydantic-ai-harness, led by Code Mode, which runs many tool calls as one sandboxed Python script.
pydantic/pydantic-ai
Build AI agents with Pydantic AI — tools, capabilities (including on-demand loading), workspaces, structured output, streaming, testing, and multi-agent patterns.
pydantic/pydantic-ai
Evaluate and complete an issue or PR where the submitted patch fixes only a narrow symptom of the reported pain point.
pydantic/pydantic-ai
Record, rewrite, and debug VCR cassettes for HTTP recordings.
pydantic/pydantic-ai
Migrate Python Agno applications to Pydantic AI and, only when needed, Pydantic AI Harness.
pydantic/pydantic-ai
Migrate Python applications from the Claude Agent SDK to Pydantic AI and, only when needed, Pydantic AI Harness.
Works with
Categories
Add a new provider API capability (prompt caching, strict/structured tool calling, thinking/reasoning effort, service tier, safety settings, logprobs, etc.) to Pydantic AI. Adding A Provider API Feature is an agent skill from pydantic/pydantic-ai, published by the product's own GitHub organization.) to Pydantic AI.
Adding A Provider API Feature fits situations like: wiring a provider feature through the library — it enforces reasoning from the existing cross-provider abstraction before designing anything; picking default-on vs opt-in deliberately.
Run `npx skills add pydantic/pydantic-ai --skill adding-a-provider-api-feature -a claude-code`. Or copy the skill folder (.agents/skills/adding-a-provider-api-feature in pydantic/pydantic-ai) into .claude/skills/adding-a-provider-api-feature in your project. Claude Code loads it when a task matches its description.
Run `npx skills add pydantic/pydantic-ai --skill adding-a-provider-api-feature -a codex`. Or copy the skill folder (.agents/skills/adding-a-provider-api-feature in pydantic/pydantic-ai) into .agents/skills/adding-a-provider-api-feature in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pydantic/pydantic-ai --skill adding-a-provider-api-feature -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/adding-a-provider-api-feature, .gemini/skills/adding-a-provider-api-feature, .github/skills/adding-a-provider-api-feature and .opencode/skills/adding-a-provider-api-feature in your project.
Going by SKILL.md and its folder, Adding A Provider API Feature needs the command-line tools its instructions call (gh). Its frontmatter pre-approves these tools: Bash(git:*), Bash(gh:*), Bash(rg:*), Bash(ls:*), Bash(uv:*), Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion, Agent.
SKILL.md contains no URLs. Its commands use gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Adding A Provider API Feature is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Adding A Provider API Feature: Pydantic AI (davila7/claude-code-templates, 32k stars), Building Pydantic AI Agents (docling-project/docling, 68k stars), Celeste Python (withceleste/celeste-python, 221 stars) and Prompt Engineer (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
pydantic (a GitHub organization, an official publisher) maintains it in pydantic/pydantic-ai, which has 20,465 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on October 7, 2026.
Source: pydantic/pydantic-ai on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.