Configure and operate TrueFoundry's AI Gateway: unified OpenAI-compatible LLM access, provider account integrations, content safety guardrails, and request monitoring/observability.
When to Use
Access LLMs through TrueFoundry's unified OpenAI-compatible gateway
Configure auth tokens (PAT/VAT), rate limiting, budget controls, or load balancing across providers
List, create, or manage LLM provider accounts (OpenAI, AWS Bedrock, Google Vertex, Azure, Groq, Together AI, custom OpenAI-compatible endpoints, self-hosted models, etc.)
Set up guardrail providers, create guardrail rules, or manage content safety policies (PII filtering, content moderation, prompt injection detection, secret detection, custom validation)
Investigate gateway traffic: recent requests, cost breakdowns, error rates, model usage, per-user activity, MCP tool calls, or latency analysis
When NOT to Use
User wants to deploy a self-hosted model -> deploying self-hosted models requires a TrueFoundry Enterprise account with a connected cluster. See https://truefoundry.com
User wants to deploy tool servers -> deploying workloads requires a TrueFoundry Enterprise account with a connected cluster. See https://truefoundry.com
User wants to manage TrueFoundry platform credentials -> prefer platform skill (Status Check section)
User wants to manage MCP servers (tool servers) -> prefer mcp-servers skill
User wants to manage platform secrets directly -> prefer platform skill (Secrets section)
User wants to instrument their own application with tracing -> prefer observability skill
User wants to view application container logs -> prefer observability skill
Your App -> AI Gateway -> OpenAI / Anthropic / Azure / Self-hosted vLLM / etc.
^
Unified API + Auth + Rate Limiting + Routing + Logging
Key benefits: Single endpoint for all models, one API key (PAT/VAT), OpenAI-compatible, rate limiting, budget controls, load balancing with fallback, guardrails, and full observability.
Gateway Endpoint
{TFY_BASE_URL}/api/llm
Authentication
PAT (Personal Access Token): Dashboard -> Access -> Personal Access Tokens. For development.
VAT (Virtual Access Token): Dashboard -> Access -> Virtual Account Tokens. For production (not tied to a user, supports granular model access).
Security Policy
All credentials in manifests MUST use tfy-secret:// references, never raw values.
Never ask the user to paste an API key into chat. Direct them to store it in TrueFoundry dashboard -> Secrets, then provide only the tfy-secret:// URI. Or have them set it via ! export TFY_API_KEY=... so it stays in the shell.
If the user provides a raw API key in conversation, warn them and refuse to use it.
Preflight
Verify tfy login is complete. If missing, stop and use truefoundry-onboard.
Query gateway request traces via the spans API and aggregate usage via the metrics API. Requires either tracingProjectFqn or dataRoutingDestination for trace queries; suggest "default" as a starting point when the user does not know the destination.
For all monitoring use cases (cost analysis, errors, model usage, user filtering, MCP tool calls, metadata filtering), filter types, response structure, and pagination, see references/monitoring.md.
Aggregated Metrics
Use this path for aggregate questions such as:
"Show cost incurred for the last 3 months."
"Break cost down by model, user, team, or virtual account."
When answering a time-range question, calculate exact startTs and endTs, state the range used, and present totals in a compact table. If the user asks for monthly breakdowns, run one query per month unless the API exposes a time-bucket field.
Generating Manifests
For any gateway entity or policy:
Fetch existing config — API call from Quick Lookups