Guide · Updated June 2026

The best LLM for Pydantic AI

Pydantic AI is for people who want their agents typed — validated outputs, structured tool calls, production discipline. But strict structure has a sharp edge: if a turn returns empty, or a provider rate-limits mid-run, the typed contract breaks before you get a result. CodeBurst gives Pydantic AI an OpenAI-compatible model that fails over across providers and repairs empty tool turns, so your typed pipeline actually returns its type.

Structure makes reliability non-negotiable

A loose chatbot can shrug off a weird response. A typed agent can't — it expects a valid tool call or a parseable structured output every turn. Two failures hit harder here:

What CodeBurst adds

FailureCodeBurst
Provider rate-limits mid-runReroutes to a healthy provider in the same request; the turn returns valid content.
Empty tool-synthesis turncodeburst-agent retries with a corrected format, preserving the typed contract.
A critical step needs more rigorUse codeburst-swarm for a multi-model vote on that step.

Configure the model

Point an OpenAIProvider at CodeBurst:

from pydantic_ai import Agent
from pydantic_ai.models.openai import OpenAIChatModel
from pydantic_ai.providers.openai import OpenAIProvider

model = OpenAIChatModel(
    "codeburst-agent",
    provider=OpenAIProvider(
        base_url="https://codeburst.ai/api/v1",
        api_key="YOUR_CODEBURST_KEY",
    ),
)

agent = Agent(model, result_type=YourSchema)  # your tools + types, unchanged

Your result_type, tools and validation don't change — the endpoint just gains provider failover and tool-call repair underneath.

Get started

Get an API key The best tool-calling API →

FAQ

How do I use a custom model in Pydantic AI?
OpenAIChatModel("codeburst-agent", provider=OpenAIProvider(base_url="https://codeburst.ai/api/v1", api_key=...)).

Why does a typed agent need failover?
Empty turns and rate limits break the typed contract; CodeBurst keeps every turn returning valid content.

Does my schema change?
No — only the model/provider config.