Type Safe
Back to integrations
Community exampleNeeds reviewAvailable2026-09-28

Pydantic AI Gateway with Jev

Use Pydantic AI Gateway for supported generative providers and Pydantic AI’s native TypeSafe model support for Jev as separate paths in one Python application.

Install

pip install "pydantic-ai-slim[openai,typesafe]"

Server environment variables

PYDANTIC_AI_GATEWAY_API_KEY, TYPESAFE_API_KEY

Prerequisites

  • Python 3.10 or newer
  • Pydantic AI Gateway credentials for a supported gateway provider
  • A server-side TypeSafe API key for the separate Jev model path
  • A documented human-review fallback

Implementation steps

  1. 1Install the Pydantic AI slim package with both the OpenAI and TypeSafe extras.
  2. 2Set gateway and TypeSafe credentials in the server environment.
  3. 3Configure the gateway Agent only for a provider currently listed in Gateway documentation.
  4. 4Create a TypeSafeModel for Jev as a separate provider path.
  5. 5Validate structured decision fields and confidence before acting.
  6. 6Route uncertain or low-confidence decisions to human review.
Server example
from pydantic_ai import Agent
from pydantic_ai.models.typesafe import TypeSafeModel

gateway_agent = Agent("gateway/openai:gpt-5")
jev_model = TypeSafeModel("jev-1.13.0")

# These are separate provider paths in one application architecture.
# Current Pydantic AI Gateway docs do not list TypeSafe as a gateway upstream.

Production checks

  • Keep both provider credentials on the server.
  • Do not describe TypeSafe as a Gateway upstream unless the Gateway documentation changes.
  • Set and verify timeouts and bounded retries separately for each provider path.
  • Pin package versions and evaluate the complete workflow locally before release.
  • Do not log sensitive input, credentials, or full decision payloads.

Limitations and verification notes

Current Pydantic AI Gateway documentation lists OpenAI, Anthropic, Google Cloud, Groq, and AWS Bedrock. TypeSafe is not currently listed as a Gateway upstream, so this page shows two separate provider paths rather than routing Jev through the Gateway.

Sources

This guide is independently maintained by Type Safe. Check the provider’s current documentation, versions, and terms before use.