← Back to Developer Portal

Code Examples

Submitting an Agent for Testing

// POST /api/agent-builder/agents
{
  "name": "Customer Support Bot",
  "description": "Handles inquiries and ticket routing",
  "agent_type": "support",
  "tools": ["knowledge_search", "ticket_system"],
  "model": "gpt-4",
  "prompt": "You are a helpful customer support agent..."
}

// Response
{
  "id": "agent_123",
  "status": "saved",
  "next_step": "run_benchmarks"
}

Running Benchmarks

// POST /api/benchmarks/run
{
  "agent_id": "agent_123",
  "benchmark_suite": "customer_service",
  "verification_level": "core_benchmarked"
}

// Response
{
  "test_id": "test_456",
  "status": "running",
  "estimated_completion": "5 minutes",
  "cost": "$9.00"
}

Getting Results

// GET /api/benchmarks/results/test_456

{
  "test_id": "test_456",
  "agent_id": "agent_123",
  "overall_score": 87,
  "passed": 28,
  "failed": 3,
  "details": {
    "response_accuracy": 92,
    "response_time_ms": 340,
    "token_efficiency": 85
  }
}

Note: All endpoints require authentication via Bearer token in the Authorization header. Sign up and add credits to get your API key from the Developer Portal.