Skip to main content

Introduction

Agno is a powerful framework for building autonomous AI agents that can reason, use tools, maintain memory, and access knowledge bases. The AI Gateway enhances Agno agents with enterprise-grade capabilities for production deployments. The AI Gateway transforms your Agno agents into production-ready systems by providing:
  • Complete observability of agent reasoning, tool usage, and knowledge retrieval
  • Access to 3,000+ LLMs through a unified interface
  • Built-in reliability with fallbacks, retries, and load balancing
  • Cost tracking and optimization across all agent operations
  • Advanced guardrails for safe and compliant agent behavior
  • Enterprise governance with budget controls and access management

Agno AI Official Documentation

Learn more about Agno’s agent framework and core concepts

Setting Up the AI Gateway

If this is your first time using the AI Gateway, you will need to connect your LLM Provider in the app to use them in your Agno AI agents.
1

Create an Integration

Navigate to the Integrations section on the AI Gateway’s Sidebar. This is where you’ll connect your LLM providers.
  1. Find your preferred provider (e.g., OpenAI, Anthropic, etc.)
  2. Click Connect on the provider card
  3. In the “Create New Integration” window:
    • Enter a Name for reference
    • Enter a Slug for the integration
    • Enter your API Key and other provider specific details for the provider
  4. Click Next Step
In your next step you’ll see workspace provisioning options. You can select the default “Shared Team Workspace” if this is your first time OR chose your current one.
2

Configure Models

On the model provisioning page:
  • Leave all models selected (or customize)
  • Toggle Automatically enable new models if desired
Click Create Integration to complete the integration
3

Copy the Provider Slug

Once your Integration is created:
  1. Go to Model CatalogAI Providers tab
  2. Find your integration
  3. Copy the slug (e.g., openai-dev)
This slug is your provider’s unique identifier - you’ll need it for the next step.

Quickstart

You will need
  • AI Gateway API Key & AI Gateway Provider slug from Step 1
1

Install required packages

2

Get your AI Gateway API Key

Sign up at stratacloudmanager.paloaltonetworks.com to get your API key.Once you are on the AI Gateway follow this guide to create your first AI provider and integration that will help us connect Agno to any LLM provider.
3

Configure the AI Gateway with Agno

Agno makes integration incredibly simple - just use the OpenAILike model class with the AI Gateway’s configuration:

Simple E2E example agent

Let’s create a simple Agno agent that uses the AI Gateway for LLM calls:
simple_agent.py
Visit Strata Cloud Manager to see detailed logs of your agent’s execution, including tool calls and model responses!

Production Features

1. Enhanced Observability

The AI Gateway provides comprehensive observability for your Agno agents, helping you understand exactly what’s happening during each execution.
Traces provide a hierarchical view of your agent’s execution, showing the sequence of LLM calls, tool invocations, and state transitions.

2. Reliability - Keep Your Agents Running Smoothly

When running agents in production, things can go wrong - API rate limits, network issues, or provider outages. The AI Gateway’s reliability features ensure your agents keep running smoothly even when problems occur. It’s this simple to enable fallback in your Agno agents:
This configuration will automatically try Claude if the GPT-4o request fails, ensuring your agent can continue operating.

Automatic Retries

Handles temporary failures automatically. If an LLM call fails, the AI Gateway will retry the same request for the specified number of times - perfect for rate limits or network blips.

Request Timeouts

Prevent your agents from hanging. Set timeouts to ensure you get responses (or can fail gracefully) within your required timeframes.

Conditional Routing

Send different requests to different providers. Route complex reasoning to GPT-4, creative tasks to Claude, and quick responses to Gemini based on your needs.

Fallbacks

Keep running even if your primary provider fails. Automatically switch to backup providers to maintain availability.

Load Balancing

Spread requests across multiple API keys or providers. Great for high-volume agent operations and staying within rate limits.

3. Prompting in Agno Agents

The AI Gateway’s Prompt Engineering Studio helps you create, manage, and optimize the prompts used in your Agno agents. Instead of hardcoding prompts or instructions, use the AI Gateway’s prompt rendering API to dynamically fetch and apply your versioned prompts.
Prompt Playground is a place to compare, test and deploy perfect prompts for your AI application. It’s where you experiment with different models, test variables, compare outputs, and refine your prompt engineering strategy before deploying to production. It allows you to:
  1. Iteratively develop prompts before using them in your agents
  2. Test prompts with different variables and models
  3. Compare outputs between different prompt versions
  4. Collaborate with team members on prompt development
This visual environment makes it easier to craft effective prompts for each step in your Agno agent’s workflow.

4. Guardrails for Safe Agents

Guardrails ensure your Agno agents operate safely and respond appropriately in all situations. Why Use Guardrails? Agno agents can experience various failure modes:
  • Generating harmful or inappropriate content
  • Leaking sensitive information like PII
  • Hallucinating incorrect information
  • Generating outputs in incorrect formats
The AI Gateway’s guardrails protect against these issues by validating both inputs and outputs. Implementing Guardrails
The AI Gateway’s guardrails can:
  • Detect and redact PII in both inputs and outputs
  • Filter harmful or inappropriate content
  • Validate response formats against schemas
  • Check for hallucinations against ground truth
  • Apply custom business logic and rules

Learn More About Guardrails

Explore the AI Gateway’s guardrail features to enhance agent safety

5. User Tracking with Metadata

Track individual users through your Agno agents using the AI Gateway’s metadata system. What is Metadata in the AI Gateway? Metadata allows you to associate custom data with each request, enabling filtering, segmentation, and analytics. The special _user field is specifically designed for user tracking. Filter Analytics by User With metadata in place, you can filter analytics by user and analyze performance metrics on a per-user basis: This enables:
  • Per-user cost tracking and budgeting
  • Personalized user analytics
  • Team or organisation-level metrics
  • Environment-specific monitoring (staging vs. production)

Learn More About Metadata

Explore how to use custom metadata to enhance your analytics

6. Caching for Efficient Agents

Implement caching to make your Agno agents more efficient and cost-effective:
Simple caching performs exact matches on input prompts, caching identical requests to avoid redundant model executions.

7. Model Interoperability: using different LLMs

One of the AI Gateway’s key strengths is providing access to 3,000+ LLMs through a unified interface. Here’s how to use different providers with Agno:

Supported Providers

See the full list of LLM providers supported by the AI Gateway

End-to-End Examples

Level 1: Agent with Tools and Observability

Let’s build an agent that uses tools while leveraging the AI Gateway’s observability features:

Level 2: Agent with Knowledge Base and Caching

Enhance your Agno agent with knowledge retrieval while using the AI Gateway’s caching to optimize costs:

Level 3: Agent with Memory, Reasoning, and Reliability

Build a sophisticated agent that leverages Agno’s advanced features with the AI Gateway’s reliability configurations:
advanced_agent.py

Set Up Enterprise Governance for Agno AI agents

Why Enterprise Governance? If you are using Agno AI agents inside your orgnaization, you need to consider several governance aspects:
  • Cost Management: Controlling and tracking AI spending across teams
  • Access Control: Managing which teams can use specific models
  • Usage Analytics: Understanding how AI is being used across the organisation
  • Security & Compliance: Maintaining enterprise security standards
  • Reliability: Ensuring consistent service across all users
The AI Gateway adds a comprehensive governance layer to address these enterprise needs. Let’s implement these controls step by step. Enterprise Implementation Guide The AI Gateway allows you to use 3,000+ LLMs with your Agno AI agents setup, with minimal configuration required. Let’s set up the core components in the AI Gateway that you’ll need for integration.

Step 1: Implement Budget Controls & Rate Limits

Model Catalog enables you to have granular control over LLM access at the team/department level. This helps you:
  • Set up budget limits
  • Prevent unexpected usage spikes using Rate limits
  • Track departmental spending

Setting Up Department-Specific Controls:

  1. Navigate to Model Catalog in Strata Cloud Manager
  2. Create new Provider for each engineering team with budget limits and rate limits
  3. Configure department-specific limits

Step 2: Define Model Access Rules

As your AI usage scales, controlling which teams can access specific models becomes crucial. You can simply manage AI models in your org by provisioning model at the top integration level.
The AI Gateway allows you to control your routing logic very simply with it’s Configs feature. AI Gateway Configs provide this control layer with things like:
  • Data Protection: Implement guardrails for sensitive code and data
  • Reliability Controls: Add fallbacks, load-balance, retry and smart conditional routing logic
  • Caching: Implement Simple and Semantic Caching. and more…

Example Configuration:

Here’s a basic configuration to load-balance requests to OpenAI and Anthropic:
Create your config on the Configs page in Strata Cloud Manager. You’ll need the config ID for connecting to Cline’s setup.
Configs can be updated anytime to adjust controls without affecting running applications.

Step 3: Implement Access Controls

Create User-specific API keys that automatically:
  • Track usage per developer/team with the help of metadata
  • Apply appropriate configs to route requests
  • Collect relevant metadata to filter logs
  • Enforce access permissions
Create API keys through:Example using Python SDK:For detailed key management instructions, see our API Keys documentation.

Step 4: Deploy & Monitor

After distributing API keys to your engineering teams, your enterprise-ready Cline setup is ready to go. Each developer can now use their designated API keys with appropriate access levels and budget controls. Apply your governance setup using the integration steps from earlier sections Monitor usage in Strata Cloud Manager:
  • Cost tracking by engineering team
  • Model usage patterns for AI agent tasks
  • Request volumes
  • Error rates and debugging logs

Enterprise Features Now Available

Agno AI agents now has:
  • Departmental budget controls
  • Model access governance
  • Usage tracking & attribution
  • Security guardrails
  • Reliability features

Frequently Asked Questions

The AI Gateway adds production-grade features to Agno agents including comprehensive observability (traces, logs, analytics), reliability (fallbacks, retries, load balancing), access to 3,000+ LLMs, cost management, and enterprise governance - all without changing your agent logic.
Yes! The AI Gateway provides access to 3,000+ LLMs from providers like OpenAI, Anthropic, Google, Cohere, and many more. Just change the model ID in your configuration to switch between providers.
The AI Gateway automatically tracks costs for all LLM calls. You can segment costs by agent type, user, or custom metadata. Set up AI Provider integrations with budget limits to control spending on Model Catalog.
Yes! The AI Gateway works seamlessly with all Agno features including tools, reasoning, memory, knowledge bases, and storage. It adds observability and reliability without limiting any Agno functionality.
The AI Gateway’s detailed logs and traces make debugging easy. You can see the complete execution flow, including failed tool calls, LLM errors, and retry attempts. Filter by trace ID or metadata to find specific issues.

Resources

Agno Documentation

Learn more about building agents with Agno

AI Gateway Features

Explore all AI Gateway capabilities
Last modified on September 15, 2026