
logfire-gateway
Configure an application's model calls to use the Pydantic AI Gateway. Use when the user asks to route application inference through Gateway, connect a Gateway key, or add a Gateway provider snippet. This does not configure or instrument coding agents.
- Installs
- 77
- Last 24h
- +9
- Trending rank
- #9177
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/pydantic/skills --skill logfire-gateway- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads logfire-gateway automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Configure an Application with Pydantic AI Gateway
For observing or routing Claude Code/Codex itself, use coding-agent setup instead. Keep this application workflow separate from coding-session recording and provider setup.
Preserve the user's confirmed project, region, provider, and existing credential mechanism. An existing application Gateway key needs no CLI login or SDK write token. To create a key through the CLI, follow the CLI Gateway credential procedure. Use the UI's Gateway Connect flow when CLI access is unavailable.
Use this skill for model traffic, provider routing, and Gateway credentials. It
is separate from logfire-instrumentation: a Logfire write token sends
telemetry, while a Gateway key authorizes model requests. Do not substitute one
for the other. Do not configure coding-agent providers, telemetry, or MCP integrations.
A prepared setup handoff may already identify the exact project and credentials. Reuse it rather than repeating authentication or selecting another project.
1. Identify the application
Before changing files, inspect the repository and identify the existing model client, model, provider, environment loader, and runnable entrypoint. If the request names an application or the repository contains a clear inference client, wire that application through Gateway. Preserve its provider protocol and model unless the user requests a change.
If there is no inference application or the target is ambiguous, ask which application the user wants to connect. Confirm a new application's purpose before scaffolding it.
A Gateway setup request authorizes routing the selected application's model calls through Gateway. Ordinary Logfire instrumentation does not imply that choice.
Continue this setup in the current agent. A prepared wizard handoff already finished account and project selection. Do not invoke the wizard again or launch another setup agent. Preserve the existing model client, provider abstraction, dependency versions, and environment conventions.
2. Handle credentials without exposing them
Reuse an existing Gateway credential provided through the repository's secret
mechanism. Otherwise obtain a project-scoped Gateway key using the UI's Connect
flow or the CLI credential procedure.
Do not create a telemetry write token merely to configure an existing Gateway key.
Never print the one-time secret in a recorded terminal or agent messages.
Store it using the environment variable read by the selected SDK or Connect
snippet: PYDANTIC_AI_GATEWAY_API_KEY for Pydantic AI. For other clients, keep
the application's existing variable, or use LOGFIRE_GATEWAY_API_KEY and
explicitly read it into the client's API-key option. Setting a variable alone
does not make an arbitrary client consume it.
Keep unrelated values intact. For a local environment file, require a gitignored
regular file with user-only permissions, replace exactly one existing assignment
or insert one, and write the file atomically. Never stage or commit the
secret-bearing file or key to source control. Do not append duplicate assignments. If the existing
secret mechanism cannot be updated safely, ask the user to install the key
through their normal secret manager.
A downloaded Connect credential can use the same secret mechanism without printing or sourcing the downloaded file. Never put a key in agent messages, source code, logs, tests, or snapshots.
Use the environment variable expected by the selected SDK. Keep the key out of browser code and client-side bundles. Key creation does not activate Gateway, configure provider billing, or select a routing endpoint. If the public API rejects creation because Gateway is inactive or permission is missing, explain that specific prerequisite. Missing OAuth scope requires renewed consent with the needed permission; provider activation or billing requires Gateway settings. Do not activate paid provider access without the user's agreement. Reuse a successfully created key; do not mint another key during a configuration retry.
3. Configure the detected application
Prefer the existing client and dependency versions. Make the smallest change that preserves the application's current provider abstraction.
Pydantic AI
Use the Gateway model form when the selected provider and model are known:
from pydantic_ai import Agent
# Set PYDANTIC_AI_GATEWAY_API_KEY and PYDANTIC_AI_GATEWAY_BASE_URL from Connect.
agent = Agent('gateway/openai:gpt-5.2')
Set PYDANTIC_AI_GATEWAY_BASE_URL to the Gateway root URL supplied by Connect
for the selected region or self-hosted deployment, alongside the API key.
Use the Pydantic AI snippet's root URL, not a provider-specific endpoint copied
from another client's snippet. Preserve an explicitly configured matching URL;
do not rely on SDK region inference or a default to select the user's destination.
The normal credential is PYDANTIC_AI_GATEWAY_API_KEY. When the application
needs an explicit key or custom route, use the installed Pydantic AI version's
gateway_provider() and preserve the provider type and route from the Connect
handoff. Do not guess a provider slug from a model name.
OpenAI-compatible clients
Use the exact Gateway base URL and route supplied by Connect, or derive the documented regional route from the handoff and existing provider protocol. Read the provider-specific examples in the Gateway documentation when needed. Preserve the client's existing API shape and load its API key from the application's selected environment variable into the client's API-key option through its normal environment loading mechanism. Do not hard-code a regional URL when the handoff already provides one. A self-hosted origin is not a hosted region: use its confirmed Gateway resource and configured route, or ask for them. A documented provider path alone does not prove that this organization has that route enabled.
Anthropic, Google, and other native clients
Use the provider-specific Gateway snippet from Connect or the linked public Gateway documentation for the selected region. Native provider paths are not interchangeable: Anthropic, OpenAI Responses, Google, Bedrock, and chat-completions routes have different URLs and request shapes. Do not translate a native request into another protocol merely to make the example compile.
4. Verify one real request
Explain that a live request sends its prompt to the selected provider through Gateway and may incur usage charges. Use one small synthetic payload with no application, customer, or secret data. An explicit request to configure and test the selected route authorizes this bounded check; otherwise ask for approval before sending it. Do not activate paid access or run production workloads as a test.
Run that request through the selected route. Check the response and the application's normal error handling. A successful import, configuration parse, or process exit is not proof that the request used the Gateway.
If the project has a read-capable Logfire login, query the exact project for a fresh Gateway request or open its Gateway activity view. Do not use the send-only SDK write token for reads. If read verification is unavailable, report the request response as verified and mark Logfire-side arrival as unverified.
Run the project's formatter, type checker, build, and focused tests. Report the exact provider, route, model, endpoint class, credential variable, request result, and any unverified Logfire-side check. Never claim that a Gateway request was observed when this session did not check it.
After setup, return the relevant project or Gateway view link. If provider activation or another prerequisite prevents the request, report that blocker and mark application inference as unverified.
References
FAQ
What does the logfire-gateway skill do?
Configure an application's model calls to use the Pydantic AI Gateway. Use when the user asks to route application inference through Gateway, connect a Gateway key, or add a Gateway provider snippet. This does not configure or instrument coding agents.
How do I install logfire-gateway?
Run npx skills add https://github.com/pydantic/skills --skill logfire-gateway in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/logfire-gateway/ (personal) or .claude/skills/logfire-gateway/ (project).
Which AI agents can use logfire-gateway?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is logfire-gateway safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains logfire-gateway?
It is published by pydantic in pydantic/skills. It has 77 recorded installs.
More from pydantic/skills
building-pydantic-ai-agents
pydantic/skills
Build AI agents with Pydantic AI — tools, capabilities (including on-demand loading), workspaces, structured output, streaming, testing, and multi-agent patterns. Use when the user mentions Pydantic AI, imports pydanticai, or asks to build an AI agent, add tools/capabilities, attach a workspace, defer capability loading, stream output, define agents from YAML, or test agent behavior.
pydantic-ai-harness
pydantic/skills
Extend Pydantic AI agents with capabilities from pydantic-ai-harness -- the Coder coding agent, file and shell tools in local or sandboxed workspaces (Modal, E2B, Sprites, smolvm), Code Mode, sub-agents and planning, memory and skills, context compaction, guardrails and spend limits, web research and browsers, hosted SaaS integrations, step persistence, and background agents on Render Workflows. Use when the user mentions pydantic-ai-harness or pydanticaiharness, imports a harness capability such as Coder, CodeMode, FileSystem, Shell, SubAgents, Memory, or ToolGuardrail, or wants a Pydantic AI agent that edits files, runs commands or agent-written Python, delegates, remembers, manages long context, stays within limits, or runs model and tool operations as chained Render task runs.
logfire-instrumentation
pydantic/skills
Add Pydantic Logfire observability to application code — traces, logs, metrics, and AI/agent spans. Use when the user asks to add or configure Logfire, observability, tracing, logging, or monitoring; maximize useful telemetry; or understand what an app is doing. Supports Python, JavaScript/TypeScript, Rust, and major AI agent frameworks including Pydantic AI, OpenAI Agents SDK, Claude Agent SDK, LangChain, LangGraph, CrewAI, AutoGen, and Google ADK. For infrastructure-only monitoring (hosts, Docker, Kubernetes, databases, or cloud metrics with no app-code changes), use logfire-infrastructure. For evaluating AI/agent behavior against test datasets, use logfire-evals.
pydantic
pydantic/skills
Pydantic is a Python data validation and serialization library, based on type hints. Use this skill whenever you need to do relatively complex data modeling using Pydantic, e.g. when adding constraints, defining a model hierarchy with subclasses, etc.
logfire-query
pydantic/skills
Query and analyze Logfire telemetry data — traces, logs, spans, metrics, summaries, and SQL results. Use this skill when the user asks to "query logfire", "search traces", "find logs", "query data", "search spans", "look up errors in logfire", "get metrics from logfire", "analyze telemetry", "summarize errors", "find root cause", or add Logfire querying capabilities to code. Do not use this skill for direct Logfire UI, browser, live-view, Explore-page, or link-opening requests; use logfire-ui instead. If "show" or "view" wording is ambiguous, ask whether the user wants a UI view or query analysis.
logfire-ui
pydantic/skills
Open or return Logfire project pages, live views, trace links, and Explore pages in the Codex browser without querying telemetry first. Use this skill when the user asks to "open in Logfire", "show in the live view", "open Explore", "open the UI", "show in Codex", "use the browser", "give me a link", or asks for a Logfire GUI/browser/live-view presentation of a project, time range, service, span, trace, log, or filter. If "show" or "view" wording is ambiguous, ask whether the user wants a UI view or query analysis.
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available