API Reference

Complete reference for all Metrx API endpoints, including authentication, request/response formats, error codes, and rate limits.

Base URLs

  • Gateway: https://gateway.metrxbot.com (proxy for LLM calls)
  • Web API: https://app.metrxbot.com (dashboard and team management)

Authentication

Gateway Authentication

The Gateway uses API key authentication. Include your API key in the Authorization header:

Authorization: Bearer al_xxxxxxxxxxxxxxxxxxxx

API keys are validated by:

  1. SHA-256 hash lookup in Cloudflare KV cache (fast path)
  2. Cache miss → Supabase lookup with rate limiting
  3. Cached for 1 hour to minimize database queries

Header Format:

Authorization: Bearer <api_key>

Example:

curl -H "Authorization: Bearer al_abc123def456"

Web API Authentication

The Web API uses Clerk for authentication. Sign in at app.metrxbot.com to obtain a session token (automatically managed by the dashboard).

Gateway Endpoints

The Gateway proxies requests to LLM providers while tracking costs and events.

GET /health

Health check endpoint. Requires no authentication.

Request:

curl -X GET https://gateway.metrxbot.com/health

Response (200 OK):

{
  "status": "ok",
  "timestamp": "2024-02-20T12:34:56.789Z",
  "version": "1.0.0"
}

GET /v1/models

List all supported models and their pricing.

Request:

curl -X GET https://gateway.metrxbot.com/v1/models \
  -H "Authorization: Bearer al_xxxxxxxxxxxxxxxxxxxx"

Response (200 OK):

{
  "object": "list",
  "data": [
    {
      "id": "gpt-4",
      "object": "model",
      "created": 0,
      "owned_by": "openai",
      "pricing": {
        "input_per_million_cents": 300,
        "output_per_million_cents": 600
      }
    },
    {
      "id": "gpt-4-turbo",
      "object": "model",
      "created": 0,
      "owned_by": "openai",
      "pricing": {
        "input_per_million_cents": 100,
        "output_per_million_cents": 300
      }
    },
    {
      "id": "claude-3-opus-20240229",
      "object": "model",
      "created": 0,
      "owned_by": "anthropic",
      "pricing": {
        "input_per_million_cents": 150,
        "output_per_million_cents": 750
      }
    }
  ]
}

POST /v1/chat/completions

OpenAI-compatible chat completions endpoint. Proxies requests to OpenAI, Anthropic, Google, or xAI based on the model name.

Request Headers:

HeaderRequiredDescription
AuthorizationYesAPI key: Bearer al_xxxxxxxxxxxxxxxxxxxx
Content-TypeYesapplication/json
X-Provider-KeyYesYour LLM provider API key (e.g., OpenAI key)
X-Agent-IDNoCustom agent identifier (default: “default”)
X-Session-IDNoSession/conversation ID for grouping
X-Customer-IDNoEnd-customer identifier (for multi-tenant apps)

Request Body (OpenAI format):

{
  "model": "gpt-4",
  "messages": [
    {
      "role": "user",
      "content": "Hello, how are you?"
    }
  ],
  "temperature": 0.7,
  "max_tokens": 1000,
  "stream": false
}

Response (200 OK — Non-Streaming):

{
  "id": "chatcmpl-123abc",
  "object": "chat.completion",
  "created": 1708419296,
  "model": "gpt-4",
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 20,
    "total_tokens": 30
  },
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! I'm doing well, thank you for asking."
      },
      "finish_reason": "stop"
    }
  ]
}

Response Headers (Non-Streaming):

Content-Type: application/json
X-Gateway-Latency: 245ms
X-Gateway-Cost: 1500

Response (200 OK — Streaming):

Content-Type: text/event-stream
Cache-Control: no-cache
Connection: keep-alive
X-Gateway-Latency: streaming

data: {"id":"chatcmpl-123abc","object":"chat.completion.chunk","created":1708419296,"model":"gpt-4","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}

data: {"id":"chatcmpl-123abc","object":"chat.completion.chunk","created":1708419296,"model":"gpt-4","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}

data: {"id":"chatcmpl-123abc","object":"chat.completion.chunk","created":1708419296,"model":"gpt-4","choices":[{"index":0,"delta":{"content":" there"},"finish_reason":null}]}

data: [DONE]

curl Example:

curl -X POST https://gateway.metrxbot.com/v1/chat/completions \
  -H "Authorization: Bearer al_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "X-Provider-Key: sk_openai_xxxxxxxxxxxxxxxxxxxx" \
  -H "X-Agent-ID: my-agent-1" \
  -H "X-Session-ID: session-abc123" \
  -d '{
    "model": "gpt-4",
    "messages": [{"role": "user", "content": "Hello!"}],
    "stream": false
  }'

POST /v1/messages

Anthropic-compatible messages endpoint. Routes to Anthropic’s API (Claude models).

Request Headers (same as /v1/chat/completions):

  • Authorization: Bearer al_xxxxxxxxxxxxxxxxxxxx
  • X-Provider-Key: sk_anthropic_xxxxxxxxxxxxxxxxxxxx
  • X-Agent-ID (optional)
  • X-Session-ID (optional)
  • X-Customer-ID (optional)

Request Body (Anthropic format):

{
  "model": "claude-3-opus-20240229",
  "max_tokens": 1000,
  "messages": [
    {
      "role": "user",
      "content": "Hello, Claude!"
    }
  ]
}

Response (200 OK):

{
  "id": "msg_123abc",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "Hello! I'm Claude, an AI assistant made by Anthropic."
    }
  ],
  "model": "claude-3-opus-20240229",
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": {
    "input_tokens": 10,
    "output_tokens": 25
  }
}

curl Example:

curl -X POST https://gateway.metrxbot.com/v1/messages \
  -H "Authorization: Bearer al_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "X-Provider-Key: sk_anthropic_xxxxxxxxxxxxxxxxxxxx" \
  -d '{
    "model": "claude-3-opus-20240229",
    "max_tokens": 1000,
    "messages": [{"role": "user", "content": "Hello, Claude!"}]
  }'

POST /v1/embeddings

Embeddings endpoint. Routes to OpenAI or other embedding providers.

Request Headers:

  • Authorization: Bearer al_xxxxxxxxxxxxxxxxxxxx
  • X-Provider-Key: sk_openai_xxxxxxxxxxxxxxxxxxxx
  • X-Agent-ID (optional)
  • X-Session-ID (optional)

Request Body:

{
  "model": "text-embedding-3-small",
  "input": "The quick brown fox jumps over the lazy dog.",
  "encoding_format": "float"
}

Response (200 OK):

{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [0.123, 0.456, -0.789, ...]
    }
  ],
  "model": "text-embedding-3-small",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}

curl Example:

curl -X POST https://gateway.metrxbot.com/v1/embeddings \
  -H "Authorization: Bearer al_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "X-Provider-Key: sk_openai_xxxxxxxxxxxxxxxxxxxx" \
  -d '{
    "model": "text-embedding-3-small",
    "input": "Hello world"
  }'

Web API Endpoints

The Web API handles team management, billing, webhooks, and outcome tracking. Requires Clerk authentication.

GET /api/health

Health check endpoint (no authentication required).

Response (200 OK):

{
  "status": "ok",
  "timestamp": "2024-02-20T12:34:56.789Z",
  "version": "0.1.0",
  "uptime": 12345,
  "services": {
    "supabase": "ok",
    "redis": "ok"
  }
}

GET /api/agents

List all agents for the current organization.

Authentication: Clerk session required

Response (200 OK):

{
  "agents": [
    {
      "id": "agent_123abc",
      "name": "Customer Service Bot",
      "organization_id": "org_123abc",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-02-20T09:15:00Z",
      "metadata": {
        "description": "Handles customer inquiries",
        "team": "support"
      }
    }
  ]
}

GET /api/agents/{id}

Get details for a specific agent.

Authentication: Clerk session required

Response (200 OK):

{
  "id": "agent_123abc",
  "name": "Customer Service Bot",
  "organization_id": "org_123abc",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-02-20T09:15:00Z",
  "metadata": {
    "description": "Handles customer inquiries",
    "team": "support"
  }
}

GET /api/agents/{id}/metrics

Get cost and usage metrics for an agent.

Authentication: Clerk session required

Query Parameters:

ParameterTypeDefaultDescription
fromISO 860130 days agoStart date
toISO 8601NowEnd date
group_bystringdayday, week, month

Response (200 OK):

{
  "agent_id": "agent_123abc",
  "period": {
    "from": "2024-01-21T00:00:00Z",
    "to": "2024-02-20T23:59:59Z"
  },
  "totals": {
    "call_count": 1234,
    "input_tokens": 45678,
    "output_tokens": 23456,
    "cost_microcents": 1234567
  },
  "by_model": [
    {
      "model": "gpt-4",
      "call_count": 800,
      "cost_microcents": 1000000
    },
    {
      "model": "gpt-3.5-turbo",
      "call_count": 434,
      "cost_microcents": 234567
    }
  ],
  "by_day": [
    {
      "date": "2024-02-20",
      "call_count": 45,
      "cost_microcents": 54321
    }
  ]
}

POST /api/webhooks/generic/{orgId}

Register a webhook URL for receiving events (agent calls, outcomes, etc.).

Authentication: Clerk session required

Request Body:

{
  "url": "https://your-app.com/webhooks/metrx",
  "events": ["event.created", "outcome.confirmed"],
  "secret": "your-webhook-secret"
}

Response (201 Created):

{
  "id": "webhook_123abc",
  "url": "https://your-app.com/webhooks/metrx",
  "events": ["event.created", "outcome.confirmed"],
  "secret": "your-webhook-secret",
  "created_at": "2024-02-20T12:34:56Z"
}

Webhook Events

Webhooks send JSON payloads with event data. Each webhook is signed with X-Webhook-Signature using HMAC-SHA256.

Event: event.created

Sent whenever an LLM call completes.

{
  "event_type": "event.created",
  "timestamp": "2024-02-20T12:34:56.789Z",
  "data": {
    "id": "event_123abc",
    "org_id": "org_123abc",
    "agent_key": "customer-service",
    "provider": "openai",
    "model": "gpt-4",
    "input_tokens": 150,
    "output_tokens": 75,
    "cost_microcents": 2250,
    "latency_ms": 1250,
    "status": "success",
    "session_id": "session_abc123",
    "customer_id": "cust_xyz789"
  }
}

Event: outcome.confirmed

Sent when an outcome is confirmed (business result achieved).

{
  "event_type": "outcome.confirmed",
  "timestamp": "2024-02-20T12:35:00.000Z",
  "data": {
    "id": "outcome_xyz789",
    "org_id": "org_123abc",
    "name": "Successfully handled customer inquiry",
    "session_id": "session_abc123",
    "confirmed_by": "user_abc123",
    "confirmed_at": "2024-02-20T12:35:00Z",
    "related_events": 3
  }
}

Custom Headers

The Gateway supports custom headers for flexible cost tracking and outcome management:

HeaderTypeDescriptionExample
X-Agent-IDStringCustom agent identifiersupport-bot-v2
X-Session-IDStringSession or conversation IDsession-2024-02-20-001
X-Customer-IDStringEnd-customer identifier (multi-tenant)cust_12345
X-ProviderStringForce provider (OpenAI, Anthropic, etc.)openai
X-Provider-KeyStringCustomer’s LLM provider API keysk_openai_abc123...

Rate Limits

Rate limits are enforced per organization tier and reset monthly:

TierMonthly CallsBurst LimitOverage Handling
Starter1,00010/min429 Too Many Requests
Lite10,000100/min429 Too Many Requests
Pro100,000500/min429 Too Many Requests
Business1,000,0005,000/min429 Too Many Requests
EnterpriseUnlimitedCustomCustom handling

Response (429 Too Many Requests):

{
  "error": "Rate limit exceeded",
  "limit": 100000,
  "current": 104231,
  "reset_at": "2024-03-20T23:59:59Z",
  "retry_after": 3600
}

Error Codes

The Gateway returns standard HTTP status codes with JSON error responses:

CodeMeaningExample
400Bad RequestInvalid JSON body, missing required field
401UnauthorizedMissing or invalid API key
403ForbiddenAPI key valid but org is inactive/suspended
404Not FoundEndpoint doesn’t exist
413Payload Too LargeRequest body > 10MB
429Too Many RequestsRate limit exceeded
500Internal Server ErrorGateway error (rare)
502Bad GatewayLLM provider unreachable
504Gateway TimeoutLLM provider timeout (>60s)

Error Response Format:

{
  "error": "Unsupported model",
  "model": "gpt-5",
  "supported_providers": ["openai", "anthropic", "google", "xai"]
}

Request/Response Examples

Complete Flow: Chat Completion with Outcome Tracking

Step 1: Make a request through the Gateway

curl -X POST https://gateway.metrxbot.com/v1/chat/completions \
  -H "Authorization: Bearer al_abc123def456" \
  -H "Content-Type: application/json" \
  -H "X-Provider-Key: sk_openai_live_abc123def456" \
  -H "X-Agent-ID: support-bot" \
  -H "X-Session-ID: session-2024-02-20-001" \
  -H "X-Customer-ID: cust_12345" \
  -d '{
    "model": "gpt-4",
    "messages": [
      {"role": "system", "content": "You are a helpful support agent."},
      {"role": "user", "content": "How do I reset my password?"}
    ],
    "temperature": 0.7
  }'

Step 2: Receive the response

{
  "id": "chatcmpl-8x9y0z",
  "object": "chat.completion",
  "created": 1708419296,
  "model": "gpt-4",
  "usage": {
    "prompt_tokens": 34,
    "completion_tokens": 87,
    "total_tokens": 121
  },
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "To reset your password, please visit our account settings page and click on 'Change Password'. You'll receive a verification code via email."
      },
      "finish_reason": "stop"
    }
  ]
}

Step 3: Events are logged automatically

An event is queued in Redis with:

  • Org ID, agent key, model, tokens (34 input, 87 output)
  • Cost calculation: $0.001020 (for GPT-4)
  • Latency: 1234ms
  • Status: success
  • Session ID and customer ID for grouping

Step 4: (Optional) Report an outcome

Via webhook or dashboard, mark this session as successful:

  • “Customer received helpful password reset instructions”
  • ROI calculation: Cost $0.001020 vs. estimated value of resolving a support ticket

Pricing Reference

Costs are calculated in microcents (1/100,000th of a cent).

Common Models:

ModelProviderInput CostOutput Cost
gpt-4OpenAI$0.03/1K$0.06/1K
gpt-4-turboOpenAI$0.01/1K$0.03/1K
gpt-3.5-turboOpenAI$0.0005/1K$0.0015/1K
claude-3-opusAnthropic$0.015/1K$0.075/1K
claude-3-sonnetAnthropic$0.003/1K$0.015/1K
text-embedding-3-smallOpenAI$0.00002/1KN/A

For current pricing, call GET /v1/models.


Budget Endpoints

Manage spending limits and budget enforcement.

GET /api/budgets

List all budgets for the organization.

Authentication: Clerk session required

Response (200 OK):

{
  "budgets": [
    {
      "id": "budget_123abc",
      "period": "monthly",
      "limit_microcents": 1000000000,
      "warning_pct": 80,
      "enforcement_mode": "hard_block",
      "agent_id": "agent_123abc",
      "organization_id": "org_123abc",
      "current_spending_microcents": 750000000,
      "resets_at": "2024-03-01T00:00:00Z",
      "created_at": "2024-02-01T10:00:00Z"
    }
  ]
}

POST /api/budgets

Create a new budget.

Authentication: Clerk session required

Request Body:

{
  "period": "monthly",
  "limit_microcents": 1000000000,
  "warning_pct": 80,
  "enforcement_mode": "hard_block",
  "agent_id": "agent_123abc"
}

Parameters:

  • period (string, required): daily or monthly
  • limit_microcents (integer, required): Maximum spending (in microcents)
  • warning_pct (integer, optional): Alert threshold percentage (0-100)
  • enforcement_mode (string, required): alert_only, soft_block, or hard_block
  • agent_id (string, optional): Apply to specific agent; if omitted, applies organization-wide

Response (201 Created):

{
  "id": "budget_456def",
  "period": "monthly",
  "limit_microcents": 1000000000,
  "warning_pct": 80,
  "enforcement_mode": "hard_block",
  "agent_id": "agent_123abc",
  "organization_id": "org_123abc",
  "current_spending_microcents": 0,
  "resets_at": "2024-03-01T00:00:00Z",
  "created_at": "2024-02-22T10:00:00Z"
}

DELETE /api/budgets/:id

Delete a budget.

Authentication: Clerk session required

Response (204 No Content)


POST /api/budgets/:id/resume

Resume a paused budget (e.g., after manual reset).

Authentication: Clerk session required

Request Body:

{
  "reset_spending": true
}

Parameters:

  • reset_spending (boolean, optional): If true, reset current spending to zero

Response (200 OK):

{
  "id": "budget_456def",
  "status": "active",
  "current_spending_microcents": 0,
  "resets_at": "2024-03-01T00:00:00Z"
}

GET /api/budgets/status

Get current budget status and spending across all budgets.

Authentication: Clerk session required

Response (200 OK):

{
  "organization_id": "org_123abc",
  "total_spending_microcents": 750000000,
  "budgets": [
    {
      "id": "budget_123abc",
      "limit_microcents": 1000000000,
      "current_spending_microcents": 750000000,
      "percentage_used": 75,
      "enforcement_mode": "hard_block",
      "status": "active",
      "days_remaining": 8,
      "resets_at": "2024-03-01T00:00:00Z"
    }
  ],
  "alerts_triggered": 0
}

Alert Endpoints

Configure and manage notifications.

GET /api/alerts

List all alert events.

Authentication: Clerk session required

Query Parameters:

  • limit (integer, optional): Max results (default: 50)
  • offset (integer, optional): Pagination offset (default: 0)
  • type (string, optional): Filter by alert type

Response (200 OK):

{
  "alerts": [
    {
      "id": "alert_789xyz",
      "type": "cost_spike",
      "triggered_at": "2024-02-22T12:34:56Z",
      "severity": "warning",
      "message": "Daily spending jumped 50% to $145",
      "metadata": {
        "current_spending": 145000000,
        "average_spending": 95000000,
        "percentage_increase": 52.6
      }
    },
    {
      "id": "alert_456def",
      "type": "budget_warning",
      "triggered_at": "2024-02-22T10:00:00Z",
      "severity": "info",
      "message": "Monthly budget 80% spent ($800 of $1000)",
      "metadata": {
        "budget_id": "budget_123abc",
        "percentage_used": 80
      }
    }
  ]
}

GET /api/alerts/preferences

Get alert notification preferences.

Authentication: Clerk session required

Response (200 OK):

{
  "organization_id": "org_123abc",
  "email": "team@company.com",
  "slack_webhook": "https://hooks.slack.com/services/...",
  "telegram_chat_id": "123456789",
  "webhook_url": "https://your-app.com/webhooks/metrx-alerts",
  "alert_types": {
    "cost_spike": {
      "enabled": true,
      "threshold_pct": 50,
      "channels": ["email", "slack"]
    },
    "error_rate": {
      "enabled": true,
      "threshold_pct": 5,
      "channels": ["email"]
    },
    "usage_spike": {
      "enabled": true,
      "threshold_multiplier": 2,
      "channels": ["slack", "webhook"]
    },
    "idle_agent": {
      "enabled": false,
      "threshold_hours": 168,
      "channels": []
    },
    "budget_warning": {
      "enabled": true,
      "threshold_pct": 80,
      "channels": ["email", "telegram"]
    }
  }
}

PATCH /api/alerts/preferences

Update alert preferences.

Authentication: Clerk session required

Request Body:

{
  "email": "alerts@company.com",
  "slack_webhook": "https://hooks.slack.com/services/...",
  "telegram_chat_id": "123456789",
  "webhook_url": "https://your-app.com/webhooks/metrx-alerts",
  "cost_spike_enabled": true,
  "cost_spike_threshold_pct": 50,
  "cost_spike_channels": ["email", "slack"],
  "error_rate_enabled": true,
  "error_rate_threshold_pct": 5,
  "error_rate_channels": ["email"],
  "usage_spike_enabled": true,
  "usage_spike_threshold_multiplier": 2,
  "usage_spike_channels": ["slack"],
  "idle_agent_enabled": false,
  "idle_agent_threshold_hours": 168,
  "idle_agent_channels": [],
  "budget_warning_enabled": true,
  "budget_warning_threshold_pct": 80,
  "budget_warning_channels": ["email", "telegram"]
}

Response (200 OK):

{
  "organization_id": "org_123abc",
  "updated_at": "2024-02-22T12:34:56Z",
  "alert_types": [
    "cost_spike",
    "error_rate",
    "usage_spike",
    "budget_warning"
  ]
}

Analytics Endpoint

GET /api/analytics

Get analytics data with trends, model distribution, and summary statistics.

Authentication: Clerk session required

Query Parameters:

  • from (ISO 8601, optional): Start date (default: 30 days ago)
  • to (ISO 8601, optional): End date (default: now)
  • agent_id (string, optional): Filter to specific agent

Response (200 OK):

{
  "summary": {
    "total_calls": 5234,
    "total_cost_microcents": 2345600000,
    "avg_latency_ms": 1234,
    "error_rate": 0.02,
    "period": {
      "from": "2024-01-23T00:00:00Z",
      "to": "2024-02-22T23:59:59Z"
    }
  },
  "by_model": [
    {
      "model": "gpt-4",
      "call_count": 2500,
      "cost_microcents": 1500000000,
      "avg_latency_ms": 1500
    },
    {
      "model": "gpt-3.5-turbo",
      "call_count": 2734,
      "cost_microcents": 845600000,
      "avg_latency_ms": 900
    }
  ],
  "trend": [
    {
      "date": "2024-02-22",
      "call_count": 145,
      "cost_microcents": 67500000,
      "avg_latency_ms": 1200
    },
    {
      "date": "2024-02-21",
      "call_count": 132,
      "cost_microcents": 61200000,
      "avg_latency_ms": 1180
    }
  ]
}

Partner Endpoints

Endpoints for design partners and feedback.

POST /api/partners/register

Register as a design partner.

Authentication: Clerk session required (user must be organization owner)

Request Body:

{
  "company_name": "Acme Corp",
  "contact_email": "partner@acme.com",
  "use_case": "Customer support automation",
  "monthly_llm_spend": 5000,
  "team_size": 5
}

Response (201 Created):

{
  "partner_id": "partner_123abc",
  "organization_id": "org_123abc",
  "status": "active",
  "tier": "design_partner",
  "registered_at": "2024-02-22T12:34:56Z",
  "benefits": [
    "dedicated_support",
    "priority_feature_requests",
    "custom_integrations",
    "discount_on_spend"
  ]
}

POST /api/partners/feedback

Submit design partner feedback.

Authentication: Clerk session required

Request Body:

{
  "category": "feature_request",
  "subject": "Real-time cost alerts",
  "description": "Would love to see cost alerts push to mobile via SMS",
  "priority": "high",
  "metadata": {
    "feature_area": "alerts",
    "estimated_impact": "high"
  }
}

Categories:

  • bug_report: Report a bug
  • feature_request: Suggest a feature
  • integration_request: Request an integration
  • documentation: Documentation issue
  • general_feedback: General feedback

Response (201 Created):

{
  "feedback_id": "feedback_xyz789",
  "organization_id": "org_123abc",
  "status": "received",
  "submitted_at": "2024-02-22T12:34:56Z",
  "acknowledgment": "Thank you for your feedback! Our product team will review this."
}

Topology Endpoint

GET /api/topology

Get agent network topology data showing how agents interact.

Authentication: Clerk session required

Query Parameters:

  • from (ISO 8601, optional): Start date for interaction data
  • to (ISO 8601, optional): End date for interaction data

Response (200 OK):

{
  "nodes": [
    {
      "id": "agent_123abc",
      "name": "Customer Support Bot",
      "status": "active",
      "last_activity": "2024-02-22T12:34:56Z",
      "metrics": {
        "call_count_30d": 1234,
        "cost_microcents": 567800000,
        "error_rate": 0.01
      }
    },
    {
      "id": "agent_456def",
      "name": "Content Generator",
      "status": "idle",
      "last_activity": "2024-02-20T08:00:00Z",
      "metrics": {
        "call_count_30d": 567,
        "cost_microcents": 234500000,
        "error_rate": 0.005
      }
    }
  ],
  "edges": [
    {
      "from": "agent_123abc",
      "to": "agent_456def",
      "interaction_count": 34,
      "last_interaction": "2024-02-22T11:20:00Z"
    }
  ],
  "statistics": {
    "total_agents": 2,
    "active_agents": 1,
    "total_interactions": 34,
    "period": {
      "from": "2024-01-23T00:00:00Z",
      "to": "2024-02-22T23:59:59Z"
    }
  }
}

Next Steps: See the Integration Guide for implementation examples.