Docs/Guides/Cost Optimization Cost Optimization Guide
Reduce AI costs without sacrificing quality or performance through intelligent optimization strategies.
Overview
AI costs can quickly escalate without proper monitoring and optimization. This guide covers:
- Cost Analysis - Understand where your money is going
- Optimization Strategies - Proven techniques to reduce costs
- Budget Management - Set up effective cost controls
- ROI Measurement - Measure optimization impact
- Continuous Optimization - Maintain cost efficiency over time
The foundation of every strategy below is the same: get your LLM calls instrumented so that token usage and cost flow into Agentic Ants, then use the dashboard at https://app.agenticants.ai to analyze, budget, and alert. The SDK's job is to capture the data; the cost analytics, trends, budgets, and alerts are dashboard features.
Cost Analysis
1. Capturing Cost Data
There is no programmatic cost-breakdown API in the SDK. Instead, instrument your LLM calls so that every generation records its model, token counts, and cost, then review the breakdown by component, model, and trace in the Cost dashboards at https://app.agenticants.ai.
The backend computes cost automatically from a generation's model plus its usageDetails (input/output/total tokens). You never send a dollar figure; you send the model name and token counts and the platform prices it. The drop-in OpenAI wrapper does this for you, but to see exactly what cost depends on, here is an explicit generation inside a small agent.
from ants_platform import AntsPlatform
client = AntsPlatform(
public_key=os.environ["ANTS_PLATFORM_PUBLIC_KEY"],
secret_key=os.environ["ANTS_PLATFORM_SECRET_KEY"],
host="https://api.agenticants.ai", # always set host explicitly
)
question = "Summarize our Q3 results."
with client.start_as_current_observation(
name="q3-summary-agent", as_type="agent", agent_name="q3-summary-agent"
):
client.update_current_trace(name="q3-summary-agent", input=question, user_id="demo-user")
with client.start_as_current_observation(
name="summarize",
as_type="generation",
model="gpt-4o-mini",
input=[{"role": "user", "content": question}],
model_parameters={"temperature": 0.2},
) as gen:
# ... call the LLM ...
answer = "Revenue up 12% QoQ; margins flat."
# model + usage_details is what the backend prices into a cost.
gen.update(output=answer, usage_details={"input": 1840, "output": 96, "total": 1936})
client.update_current_trace(output={"answer": answer})
client.flush() # flush before a short-lived process exits
Once calls are instrumented, open the dashboard to see total cost, cost by model, and cost by trace for any period. Use https://app.agenticants.ai for the breakdowns, trends, and filters.
startActiveObservation,
startObservation,
updateActiveTrace,
} from "ants-platform";
const question = "Summarize our Q3 results.";
await startActiveObservation(
"q3-summary-agent",
async () => {
updateActiveTrace({ name: "q3-summary-agent", input: question, userId: "demo-user" });
const gen = startObservation(
"summarize",
{
model: "gpt-4o-mini",
input: [{ role: "user", content: question }],
modelParameters: { temperature: 0.2 },
},
{ asType: "generation" },
);
// ... call the LLM ...
const answer = "Revenue up 12% QoQ; margins flat.";
// model + usageDetails is what the backend prices into a cost.
gen.update({ output: answer, usageDetails: { input: 1840, output: 96, total: 1936 } });
gen.end();
updateActiveTrace({ output: { answer } });
},
{ asType: "agent" },
);
await provider.forceFlush(); // flush before a short-lived process exits
public class Q3SummaryAgent {
public static void main(String[] args) {
AntsPlatformOtel.configure(AntsPlatformOtel.options()
.publicKey(System.getenv("ANTS_PLATFORM_PUBLIC_KEY"))
.secretKey(System.getenv("ANTS_PLATFORM_SECRET_KEY")));
// host defaults to https://api.agenticants.ai
String question = "Summarize our Q3 results.";
String answer = Ants.observe("q3-summary-agent", ObservationType.AGENT, agent -> {
agent.updateTrace(TraceAttributes.builder()
.name("q3-summary-agent").input(question).userId("demo-user").build());
AntsGeneration gen = Ants.startGeneration("summarize")
.model("gpt-4o-mini").modelParameters(Map.of("temperature", 0.2))
.input(List.of(Map.of("role", "user", "content", question)));
// ... call the LLM ...
String result = "Revenue up 12% QoQ; margins flat.";
// model + usage(in, out) is what the backend prices into a cost (server-side).
gen.output(result).usage(1840, 96).end();
agent.updateTrace(TraceAttributes.builder().output(Map.of("answer", result)).build());
return result;
});
AntsPlatformOtel.flush(); // flush before a short-lived process exits
}
}
Cost is computed entirely server-side from the generation's model plus its token usage — verified end to end, a gpt-4o-mini generation reporting only model + usage(in, out) produced a non-zero totalCost in the dashboard. You do not send a dollar figure. If you ever want to override the computed value you can pass .cost(Map.of("totalCost", 0.0042)) on the generation, but for normal use it is unnecessary — let the backend price it.
For most production code the OpenAI drop-in wrapper captures the same model + usageDetails automatically, so you do not have to fill in token counts by hand:
from ants_platform.openai import openai # drop-in: traces every call, fills usage_details
openai.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": question}],
)
// Auto-traces every call as a generation with model + usageDetails for server-side costing.
const openai = observeOpenAI(new OpenAI());
await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: question }],
});
2. Cost Attribution Analysis
Cost attribution by customer, team, or use case is driven by trace metadata. Attach userId, sessionId, and metadata/tags to your traces, then slice cost by those dimensions in the dashboard at https://app.agenticants.ai.
Use the LangChain callback handler to attach attribution fields per invocation:
from ants_platform import AntsPlatform
from ants_platform.langchain import CallbackHandler
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
AntsPlatform(
public_key=os.environ["ANTS_PLATFORM_PUBLIC_KEY"],
secret_key=os.environ["ANTS_PLATFORM_SECRET_KEY"],
host="https://api.agenticants.ai",
)
handler = CallbackHandler()
prompt = ChatPromptTemplate.from_messages([("user", "{question}")])
chain = prompt | ChatOpenAI(model="gpt-4o-mini")
# Attribution metadata lets the dashboard slice cost by team / use case.
chain.invoke(
{"question": "What is our refund policy?"},
config={
"callbacks": [handler],
"metadata": {"team": "support", "use_case": "faq"},
},
)
// userId / tags / traceMetadata flow into the dashboard for cost attribution.
const handler = new CallbackHandler({
userId: "customer-1234",
tags: ["team:support", "use_case:faq"],
traceMetadata: { team: "support" },
});
const prompt = ChatPromptTemplate.fromMessages([["user", "{question}"]]);
const chain = prompt.pipe(new ChatOpenAI({ model: "gpt-4o-mini" }));
await chain.invoke(
{ question: "What is our refund policy?" },
{ callbacks: [handler] },
);
Java has no LangChain callback handler — there are no framework drop-ins yet. The attribution outcome is identical with manual instrumentation: attach userId, tags, and metadata to the trace (and/or the generation) yourself. Those same fields are what let the dashboard slice cost by team / use case:
public class AttributedAgent {
public static void main(String[] args) {
AntsPlatformOtel.configure(AntsPlatformOtel.options()
.publicKey(System.getenv("ANTS_PLATFORM_PUBLIC_KEY"))
.secretKey(System.getenv("ANTS_PLATFORM_SECRET_KEY")));
String question = "What is our refund policy?";
Ants.startActiveObservation("faq-agent", ObservationType.AGENT, agent -> {
// Trace-level attribution: these dimensions drive cost-by-team / use-case in the dashboard.
agent.updateTrace(TraceAttributes.builder()
.name("faq-agent").input(question).userId("customer-1234")
.tags(List.of("team:support", "use_case:faq"))
.metadata(Map.of("team", "ai-platform", "useCase", "summarization"))
.build());
AntsGeneration gen = Ants.startGeneration("answer")
.model("gpt-4o-mini")
// You can also attribute at the observation level if you slice cost per step.
.metadata(Map.of("team", "ai-platform", "useCase", "summarization"))
.input(List.of(Map.of("role", "user", "content", question)));
String answer = "Refunds are accepted within 30 days.";
gen.output(answer).usage(60, 18).end();
agent.updateTrace(TraceAttributes.builder().output(Map.of("answer", answer)).build());
});
AntsPlatformOtel.flush();
}
}
Same outcome as the LangChain handler — manual instrumentation, but the metadata you attach is exactly what the dashboard groups cost by.
To find your highest-cost customers, group traces by userId in the Cost Attribution view at https://app.agenticants.ai and sort by total cost. The dashboard handles the aggregation, query counts, and average-cost-per-query math for you.
3. Cost Efficiency Metrics
Efficiency metrics — cost per query, cost per token, cost per successful query, and their trends — are computed from your traces and shown in the dashboard. There is no SDK API to query them; open the Cost and Metrics views at https://app.agenticants.ai to see efficiency metrics and identify the most expensive operations.
To make those metrics meaningful, wrap your own multi-step operations as nested observations so each operation shows up as its own line item — and put the token usage on the generation so cost lands on the right step:
from ants_platform import AntsPlatform
client = AntsPlatform(
public_key=os.environ["ANTS_PLATFORM_PUBLIC_KEY"],
secret_key=os.environ["ANTS_PLATFORM_SECRET_KEY"],
host="https://api.agenticants.ai", # always set host explicitly
)
def rag_answer(question: str) -> str:
with client.start_as_current_observation(
name="rag-answer", as_type="agent", agent_name="rag-answer"
):
client.update_current_trace(name="rag-answer", input=question, user_id="demo-user")
with client.start_as_current_observation(
name="retrieve", as_type="retriever", input={"query": question}
) as ret:
context = retrieve(question)
ret.update(output={"chunks": len(context)})
with client.start_as_current_observation(
name="generate",
as_type="generation",
model="gpt-4o-mini",
input={"question": question, "context": context},
model_parameters={"temperature": 0.0},
) as gen:
result = generate(question, context)
# cost is computed from model + usage_details on THIS observation.
gen.update(output=result, usage_details={"input": 2310, "output": 128, "total": 2438})
client.update_current_trace(output={"answer": result})
return result
rag_answer("How do I reset my password?")
client.flush() # flush before a short-lived process exits
startActiveObservation,
startObservation,
updateActiveTrace,
} from "ants-platform";
// agent -> retriever -> generation; cost attaches to the generation step.
async function ragAnswer(question: string): Promise<string> {
return startActiveObservation(
"rag-answer",
async () => {
updateActiveTrace({ name: "rag-answer", input: question, userId: "demo-user" });
const ret = startObservation("retrieve", { input: { query: question } }, { asType: "retriever" });
const context = await retrieve(question);
ret.update({ output: { chunks: context.length } });
ret.end();
const gen = startObservation(
"generate",
{
model: "gpt-4o-mini",
input: { question, context },
modelParameters: { temperature: 0.0 },
},
{ asType: "generation" },
);
const result = await generate(question, context);
// cost is computed from model + usageDetails on THIS observation.
gen.update({ output: result, usageDetails: { input: 2310, output: 128, total: 2438 } });
gen.end();
updateActiveTrace({ output: { answer: result } });
return result;
},
{ asType: "agent" },
);
}
await ragAnswer("How do I reset my password?");
await provider.forceFlush();
public class RagAnswer {
// agent -> retriever -> generation; cost attaches to the generation step.
static String ragAnswer(String question) {
return Ants.observe("rag-answer", ObservationType.AGENT, agent -> {
agent.updateTrace(TraceAttributes.builder()
.name("rag-answer").input(question).userId("demo-user").build());
List<String> context = Ants.observe("retrieve", ObservationType.RETRIEVER, ret -> {
ret.input(Map.of("query", question));
List<String> chunks = retrieve(question);
ret.output(Map.of("chunks", chunks.size()));
return chunks;
});
AntsGeneration gen = Ants.startGeneration("generate")
.model("gpt-4o-mini").modelParameters(Map.of("temperature", 0.0))
.input(Map.of("question", question, "context", context));
String result = generate(question, context);
// cost is computed from model + usage on THIS observation.
gen.output(result).usage(2310, 128).end();
agent.updateTrace(TraceAttributes.builder().output(Map.of("answer", result)).build());
return result;
});
}
public static void main(String[] args) {
AntsPlatformOtel.configure(AntsPlatformOtel.options()
.publicKey(System.getenv("ANTS_PLATFORM_PUBLIC_KEY"))
.secretKey(System.getenv("ANTS_PLATFORM_SECRET_KEY")));
ragAnswer("How do I reset my password?");
AntsPlatformOtel.flush(); // flush before a short-lived process exits
}
}
Optimization Strategies
1. Model Selection Optimization
Comparing models for cost and performance is a dashboard workflow: instrument your calls across models, then compare cost-per-query and quality side by side in the Model Comparison / LLM Optimizer views at https://app.agenticants.ai.
To compare models in code, run the same prompt through each candidate as a separate generation under one parent trace. The backend prices each generation from its own model + usageDetails, so the dashboard can rank cost-per-query side by side:
from ants_platform import AntsPlatform
client = AntsPlatform(
public_key=os.environ["ANTS_PLATFORM_PUBLIC_KEY"],
secret_key=os.environ["ANTS_PLATFORM_SECRET_KEY"],
host="https://api.agenticants.ai", # always set host explicitly
)
prompt = [{"role": "user", "content": "Classify this ticket: 'app keeps crashing'"}]
with client.start_as_current_observation(
name="model-bakeoff", as_type="agent", agent_name="model-bakeoff"
):
client.update_current_trace(name="model-bakeoff", input=prompt, tags=["bakeoff"])
for model in ("gpt-4o", "gpt-4o-mini"):
with client.start_as_current_observation(
name=f"classify[{model}]",
as_type="generation",
model=model,
input=prompt,
) as gen:
# ... call the LLM with `model` ...
label, usage = classify(model, prompt)
# different model + same usage shape -> directly comparable cost.
gen.update(output={"label": label}, usage_details=usage)
client.flush()
startActiveObservation,
startObservation,
updateActiveTrace,
} from "ants-platform";
const prompt = [{ role: "user", content: "Classify this ticket: 'app keeps crashing'" }];
await startActiveObservation(
"model-bakeoff",
async () => {
updateActiveTrace({ name: "model-bakeoff", input: prompt, tags: ["bakeoff"] });
for (const model of ["gpt-4o", "gpt-4o-mini"] as const) {
const gen = startObservation(
`classify[${model}]`,
{ model, input: prompt },
{ asType: "generation" },
);
// ... call the LLM with `model` ...
const { label, usage } = await classify(model, prompt);
// different model + same usageDetails shape -> directly comparable cost.
gen.update({ output: { label }, usageDetails: usage });
gen.end();
}
},
{ asType: "agent" },
);
await provider.forceFlush();
Then open https://app.agenticants.ai to compare cost-per-query, latency, and quality scores, and pick the best cost-performance ratio. Recommendations such as "switch to a smaller model" are surfaced by the LLM Optimizer in the dashboard.
2. Prompt Optimization
Prompt-length and prompt-efficiency analysis lives in the dashboard. The SDK's job is to record each prompt variant as a generation with its own usageDetails, so the input-token (and therefore cost) drop from a trimmed prompt is visible per query. Trace both variants under one parent and tag the prompt version:
startActiveObservation,
startObservation,
updateActiveTrace,
} from "ants-platform";
const variants = {
v1: "You are a helpful, friendly, concise assistant. Please summarize: ",
v2: "Summarize: ", // trimmed -> fewer input tokens -> lower cost
};
await startActiveObservation(
"prompt-tuning",
async () => {
updateActiveTrace({ name: "prompt-tuning", tags: ["prompt:support-summary"] });
for (const [version, preamble] of Object.entries(variants)) {
const gen = startObservation(
`summarize[${version}]`,
{ model: "gpt-4o-mini", input: preamble + document, metadata: { promptVersion: version } },
{ asType: "generation" },
);
const { text, usage } = await summarize(preamble + document);
// input tokens shrink with the trimmed prompt; cost follows automatically.
gen.update({ output: text, usageDetails: usage });
gen.end();
}
},
{ asType: "agent" },
);
await provider.forceFlush();
After deploying the shorter prompt, the per-query input-token count and cost drop automatically appear in your traces. Review the savings in the dashboard; there is no SDK call that "applies a prompt optimization" for you.
3. Caching Strategies
Caching is implemented in your own application code (or at your model provider), not configured through the SDK. The SDK's role is to make the savings visible: instrument both cache hits and misses so the dashboard shows the reduced spend.
Record cache hits and misses as observations so the hit rate and cost savings show up in your traces. A hit is a cheap span (no model call, no cost); a miss is a real generation with usage_details, so the dashboard shows exactly the spend caching avoids:
from ants_platform import AntsPlatform
client = AntsPlatform(
public_key=os.environ["ANTS_PLATFORM_PUBLIC_KEY"],
secret_key=os.environ["ANTS_PLATFORM_SECRET_KEY"],
host="https://api.agenticants.ai", # always set host explicitly
)
def answer_with_cache(question: str, cache: dict) -> str:
with client.start_as_current_observation(
name="answer-with-cache", as_type="agent", agent_name="answer-with-cache"
):
client.update_current_trace(input=question)
if question in cache:
# hit: a zero-cost span, tagged so hit-rate is queryable.
with client.start_as_current_observation(
name="cache-hit", as_type="span", input={"question": question}
) as hit:
hit.update(output={"cached": True})
return cache[question]
# miss: a real generation -> model + usage_details -> server-side cost.
with client.start_as_current_observation(
name="cache-miss",
as_type="generation",
model="gpt-4o-mini",
input={"question": question},
) as gen:
result, usage = call_model(question) # your instrumented LLM call
gen.update(output=result, usage_details=usage)
cache[question] = result
return result
Once cache hits and misses are tagged, monitor the hit rate and the resulting cost savings in the dashboard at https://app.agenticants.ai.
4. Request Optimization
Request-pattern analysis (frequency, cost per request, daily cost) and the resulting optimization recommendations are dashboard features. Instrument your request paths with spans, then review the patterns and savings opportunities at https://app.agenticants.ai.
startActiveObservation,
startObservation,
updateActiveTrace,
} from "ants-platform";
// Each request becomes a trace; the model call records cost via usageDetails.
export async function handleRequest(payload: { question: string }) {
return startActiveObservation(
"handle-request",
async () => {
updateActiveTrace({ name: "handle-request", input: payload.question });
const gen = startObservation(
"answer",
{ model: "gpt-4o-mini", input: payload.question },
{ asType: "generation" },
);
const { text, usage } = await callModel(payload.question); // your LLM call
gen.update({ output: text, usageDetails: usage });
gen.end();
updateActiveTrace({ output: { answer: text } });
return text;
},
{ asType: "agent" },
);
}
The dashboard groups these traces into request patterns and highlights where batching or deduplication would cut cost. Apply the changes in your own code; there is no SDK call that applies a request optimization for you.
Budget Management
1. Setting Up Budgets
Budgets — monthly limits, per-team limits, and their warning/critical thresholds — are configured entirely in the dashboard. There is no programmatic budget API in the SDK.
Create and manage budgets under Cost > Budgets at https://app.agenticants.ai. To make per-team budgets meaningful, tag your traces with the owning team (see the attribution example above) so the dashboard can attribute spend to the right budget.
2. Cost Alerts and Notifications
There is no programmatic alerts API in the SDK. Cost-spike alerts, daily-budget alerts, and anomaly alerts — along with their email / Slack / PagerDuty channels — are configured and monitored in the dashboard.
Set up and review cost alerts under Alerts at https://app.agenticants.ai. Alerts fire against the trace cost data your instrumented application sends, so the only SDK-side requirement is to keep your LLM calls instrumented.
ROI Measurement
1. ROI Calculation
ROI analysis — total AI cost vs. revenue and savings, payback period, and ROI by use case — is computed in the dashboard from your cost data plus the business metrics you provide. There is no SDK API that returns an ROI figure.
To feed the calculation, make sure traces carry use-case metadata, then review ROI and ROI-by-use-case in the ROI view at https://app.agenticants.ai.
2. Business Impact Measurement
Business-impact metrics (customer satisfaction, response-time improvement, error-rate reduction, cost and revenue per customer) are tracked in the dashboard. Where you have a quality signal in code, attach it as a score on the relevant trace using the REST client; everything else is viewed at https://app.agenticants.ai.
from ants_platform import AntsPlatform, get_client
AntsPlatform(
public_key=os.environ["ANTS_PLATFORM_PUBLIC_KEY"],
secret_key=os.environ["ANTS_PLATFORM_SECRET_KEY"],
host="https://api.agenticants.ai",
)
# Attach a quality / satisfaction score to the current trace.
get_client().update_current_trace(
metadata={"customer_satisfaction": 0.92},
)
get_client().flush()
Trends across these business metrics are charted in the dashboard; review them at https://app.agenticants.ai.
Continuous Optimization
1. Automated Optimization
Automated model selection, automated prompt optimization, and automated caching policies are managed by the LLM Optimizer in the dashboard, not configured through the SDK. Enable and tune these under Optimizer at https://app.agenticants.ai.
Your only SDK-side responsibility is to keep every LLM call instrumented so the optimizer has the data it needs:
from ants_platform import AntsPlatform
from ants_platform.openai import openai # auto-traces every call
AntsPlatform(
public_key=os.environ["ANTS_PLATFORM_PUBLIC_KEY"],
secret_key=os.environ["ANTS_PLATFORM_SECRET_KEY"],
host="https://api.agenticants.ai",
)
The optimizer surfaces ranked recommendations (potential savings, monthly savings, risk level) in the dashboard; review and apply them there.
2. Optimization Monitoring
Active optimizations, their status, and their measured savings and performance impact are tracked in the dashboard. Monitor them under Optimizer at https://app.agenticants.ai. Because the impact is measured from your trace cost data, keeping instrumentation in place is what makes the before/after comparison accurate.
Best Practices
1. Cost Optimization Checklist
Work through this checklist; each item is verified in the dashboard at https://app.agenticants.ai rather than via an SDK call:
- Model Selection - Compare models in the Model Comparison view and confirm you are on the best cost-performance option for each task.
- Prompt Optimization - Confirm prompts are trimmed and managed as versioned prompts via the REST client.
- Caching Implementation - Confirm cache hits/misses are instrumented and the hit rate is healthy.
- Budget Management - Confirm monthly and per-team budgets exist with warning/critical thresholds.
- ROI Tracking - Confirm use-case metadata is attached so ROI can be attributed.
- Automated Optimization - Confirm the LLM Optimizer is enabled.
The one SDK-side prerequisite for the entire checklist is instrumentation:
from ants_platform import AntsPlatform
from ants_platform.openai import openai # auto-traces every call
AntsPlatform(
public_key=os.environ["ANTS_PLATFORM_PUBLIC_KEY"],
secret_key=os.environ["ANTS_PLATFORM_SECRET_KEY"],
host="https://api.agenticants.ai",
)
2. Cost Optimization Strategy
A phased rollout maps cleanly onto the platform:
- Phase 1: Quick Wins - Instrument all LLM calls (OpenAI wrapper or LangChain handler) and turn on caching in your application.
- Phase 2: Model Optimization - Compare models in the dashboard and move workloads to the best cost-performance option.
- Phase 3: Advanced Optimization - Trim prompts, batch requests, and set budgets + alerts at https://app.agenticants.ai.
- Phase 4: Continuous Optimization - Enable the LLM Optimizer and review its recommendations on a schedule.
Each phase relies on the same instrumentation foundation:
// Phase 1 foundation: every call from here on is traced with cost data.
// Set ANTS_PLATFORM_BASE_URL=https://api.agenticants.ai in the environment.
const openai = observeOpenAI(new OpenAI());
Troubleshooting
Common Cost Issues
Issue: Unexpected cost spikes
Cost-spike detection is a dashboard feature. Open the Cost view at https://app.agenticants.ai, narrow to the affected window, and drill into the spiking traces to find the likely cause (a model change, a runaway loop, or oversized prompts). Make sure the calls in that window are instrumented so the spike is attributable:
from ants_platform import AntsPlatform
from ants_platform.openai import openai # auto-traces every call
AntsPlatform(
public_key=os.environ["ANTS_PLATFORM_PUBLIC_KEY"],
secret_key=os.environ["ANTS_PLATFORM_SECRET_KEY"],
host="https://api.agenticants.ai",
)
Issue: High cost per query
Sort traces by cost in the dashboard at https://app.agenticants.ai to find your most expensive queries, then inspect each trace for the model used and the token counts. Wrapping calls with the OpenAI integration ensures the per-query cost and model are recorded:
// Records model + token + cost per call so high-cost queries are findable in the dashboard.
const openai = observeOpenAI(new OpenAI());
Next Steps
Example Projects
Congratulations! You now have comprehensive cost optimization strategies that will help you reduce AI costs while maintaining quality and performance. Instrument your calls with the SDK, then drive analysis, budgeting, and alerting from the dashboard at https://app.agenticants.ai.