Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jonwiggins/optio/llms.txt

Use this file to discover all available pages before exploring further.

Optio records the USD cost of every agent run — both coding and review tasks — extracted directly from the agent’s output. The Costs dashboard (/costs) aggregates this data so you can understand where spend is going and catch runaway tasks early.

The Costs dashboard

Open the dashboard from the sidebar (dollar sign icon) or navigate to /costs.

Summary cards

The top row shows four summary metrics for the selected period:
MetricDescription
Total costSum of all task costs in USD
Task countNumber of tasks with recorded cost
Average costMean cost per task
Cost trendPercentage change vs. the previous equivalent period

Charts

Daily costs (area chart) — per-day cost and task count for the selected period. Use this to spot unusual spikes. Cost by repository (bar chart) — total spend aggregated per repository, sorted by highest cost. Useful for identifying which repos are driving the most spend. Cost by task type (pie chart) — breakdown between coding tasks and review tasks.

Top 10 most expensive tasks

A table listing the ten costliest tasks in the period, with columns for title, repository, task type, state, model used, input/output tokens, and cost in USD. Click any task to open its detail view.

Filtering

Two filters are available at the top of the dashboard:
  • Period — select 7d, 14d, 30d, or 90d. Defaults to 30 days.
  • Repository — filter all charts and the top-tasks table to a single repository.
Changing either filter immediately refreshes all charts and summary cards.

Programmatic access

The same data is available via the API:
GET /api/analytics/costs
Query parameters:
ParameterTypeDefaultDescription
daysinteger30Number of days to include
repoUrlstringFilter to a specific repository URL
Response shape:
{
  "summary": {
    "totalCost": "4.2310",
    "taskCount": 87,
    "tasksWithCost": 83,
    "avgCost": "0.0509",
    "costTrend": "-12.4",
    "prevPeriodCost": "4.8200",
    "days": 30
  },
  "forecast": {
    "dailyAvgCost": "0.1410",
    "monthCostSoFar": "2.1800",
    "forecastedMonthTotal": "5.0900",
    "daysRemaining": 14
  },
  "dailyCosts": [
    { "date": "2025-01-01", "cost": 0.32, "taskCount": 6 }
  ],
  "costByRepo": [
    { "repoUrl": "https://github.com/org/repo", "totalCost": 1.84, "taskCount": 32 }
  ],
  "costByType": [
    { "taskType": "coding", "totalCost": 3.91, "taskCount": 74 },
    { "taskType": "review", "totalCost": 0.32, "taskCount": 9 }
  ],
  "costByModel": [
    {
      "model": "claude-opus-4-20250514",
      "totalCost": 3.12,
      "taskCount": 42,
      "successRate": 95,
      "avgCost": 0.074,
      "totalInputTokens": 5880000,
      "totalOutputTokens": 756000
    }
  ],
  "anomalies": [
    {
      "id": "uuid",
      "title": "Migrate database schema",
      "repoUrl": "https://github.com/org/repo",
      "taskType": "coding",
      "state": "completed",
      "costUsd": "4.2100",
      "modelUsed": "claude-opus-4-20250514",
      "repoAvgCost": 0.84,
      "costRatio": 5.01,
      "createdAt": "2025-01-12T09:00:00Z"
    }
  ],
  "modelSuggestions": [
    {
      "repoUrl": "https://github.com/org/repo",
      "currentModel": "claude-opus-4-20250514",
      "taskCount": 15,
      "avgCost": 0.92,
      "cheaperModelAvgCost": 0.18
    }
  ],
  "topTasks": [
    {
      "id": "uuid",
      "title": "Refactor auth module",
      "repoUrl": "https://github.com/org/repo",
      "taskType": "coding",
      "state": "completed",
      "costUsd": "0.8140",
      "inputTokens": 142000,
      "outputTokens": 18000,
      "modelUsed": "claude-opus-4-20250514",
      "createdAt": "2025-01-15T10:32:00Z"
    }
  ]
}
All cost values are returned as strings or numbers depending on the field. The summary cost fields are strings to preserve decimal precision.

Additional response fields

FieldDescription
costByModelCost aggregated by model, including success rate and token totals
anomaliesTasks costing 3× or more the repository average (up to 20 results)
modelSuggestionsRepos using expensive models where a cheaper model has proven results
Review tasks typically require far fewer turns than coding tasks. Set reviewModel to sonnet (the default) in your repository settings to use a cheaper model for review subtasks without sacrificing quality.
Set maxTurnsCoding on a repository to cap the maximum number of agent turns per coding task. Fewer turns means lower cost per task and a predictable spend ceiling. You can configure this in the repository settings under Agent settings.

Build docs developers (and LLMs) love