Skip to main content

Overview

The Dashboard API provides aggregated data for the web dashboard UI. All endpoints require dashboard authentication.
These endpoints are used by the Codex-LB web interface. They return data optimized for dashboard display.

GET /api/dashboard/overview

Get dashboard overview statistics including account counts, usage summary, and recent activity.

Authentication

Requires valid dashboard session cookie.

Response

accountCounts
object
Account statistics by status
usageSummary
object
Usage statistics for the current billing period
requestCount
integer
Total number of proxy requests in the last 24 hours
errorRate
number
Percentage of failed requests (0-100)

Example Request

cURL
curl http://localhost:2455/api/dashboard/overview \
  -H "Cookie: dashboard_session=<session_id>"
JavaScript
const response = await fetch('http://localhost:2455/api/dashboard/overview', {
  credentials: 'include'
});
const data = await response.json();
console.log(data.accountCounts);
Python
import requests

response = requests.get(
    'http://localhost:2455/api/dashboard/overview',
    cookies={'dashboard_session': session_id}
)
print(response.json())

Example Response

{
  "accountCounts": {
    "total": 5,
    "active": 3,
    "paused": 1,
    "rateLimited": 0,
    "quotaExceeded": 1,
    "deactivated": 0
  },
  "usageSummary": {
    "totalTokens": 125000,
    "totalCost": 2.45,
    "inputTokens": 75000,
    "outputTokens": 50000
  },
  "requestCount": 342,
  "errorRate": 2.3
}

GET /api/models

Get a simplified list of available models for dashboard display.
This endpoint returns a simplified model list. For full model metadata including capabilities and rate limits, use /v1/models or /backend-api/codex/models.

Authentication

Requires valid dashboard session cookie.

Response

models
array
Array of available models

Example Request

cURL
curl http://localhost:2455/api/models \
  -H "Cookie: dashboard_session=<session_id>"

Example Response

{
  "models": [
    {
      "id": "gpt-5.3-codex",
      "name": "GPT-5.3 Codex"
    },
    {
      "id": "gpt-5.3-codex-spark",
      "name": "GPT-5.3 Codex Spark"
    },
    {
      "id": "gpt-4o-mini",
      "name": "GPT-4o Mini"
    },
    {
      "id": "o3-pro",
      "name": "o3 Pro"
    }
  ]
}

Use Cases

Dashboard Home Page

Display key metrics on the dashboard landing page:
const DashboardHome = () => {
  const [overview, setOverview] = useState(null);
  
  useEffect(() => {
    fetch('/api/dashboard/overview', { credentials: 'include' })
      .then(res => res.json())
      .then(data => setOverview(data));
  }, []);
  
  if (!overview) return <Loading />;
  
  return (
    <div>
      <h1>Dashboard Overview</h1>
      <MetricCard 
        title="Active Accounts" 
        value={overview.accountCounts.active} 
        total={overview.accountCounts.total} 
      />
      <MetricCard 
        title="Total Tokens (24h)" 
        value={overview.usageSummary.totalTokens.toLocaleString()} 
      />
      <MetricCard 
        title="Total Cost (24h)" 
        value={`$${overview.usageSummary.totalCost.toFixed(2)}`} 
      />
    </div>
  );
};

Model Selection Dropdown

Populate a model selector in API key creation forms:
const ModelSelector = () => {
  const [models, setModels] = useState([]);
  
  useEffect(() => {
    fetch('/api/models', { credentials: 'include' })
      .then(res => res.json())
      .then(data => setModels(data.models));
  }, []);
  
  return (
    <select name="allowedModels" multiple>
      {models.map(model => (
        <option key={model.id} value={model.id}>
          {model.name}
        </option>
      ))}
    </select>
  );
};

Error Codes

CodeStatusDescription
authentication_required401Dashboard session invalid or expired
totp_required401TOTP verification needed (if enabled)
  • Dashboard Auth - Authentication for dashboard endpoints
  • Accounts - Detailed account management
  • Usage - Detailed usage statistics
  • Models - Full model metadata endpoint

Build docs developers (and LLMs) love