LINKORA
OverviewQuickstart

PydanticAI

Using Linkora with PydanticAI

Using PydanticAI

PydanticAI provides a high-level interface for working with various LLM providers, including Linkora.

Installation

pip install 'pydantic-ai-slim[openai]'

Configuration

You can use Linkora with PydanticAI through its OpenAI-compatible interface:

from pydantic_ai import Agent
from pydantic_ai.models.openai import OpenAIModel

model = OpenAIModel(
    "anthropic/claude-sonnet-4.6",  # or any other Linkora model
    base_url="https://link-ora.net/api/v1",
    api_key="sk-or-...",
)

agent = Agent(model)
result = await agent.run("What is the meaning of life?")
print(result)

For more details about using PydanticAI with Linkora, see the PydanticAI documentation.