The LLM Verifier REST API provides programmatic access to all functionality of the LLM Verifier system. It is built using the GinGonic framework and provides a comprehensive set of endpoints for managing models, providers, verification results, and system configuration.
- Model Management: CRUD operations for LLM models and providers
- Verification: Trigger and monitor model verification processes
- Reporting: Generate detailed reports in multiple formats
- Configuration: Runtime configuration management
- Authentication: JWT-based secure authentication
- Rate Limiting: Built-in protection against abuse
- Brotli Compression Support: Detect and report Brotli compression capabilities
- Swagger Documentation: Interactive API documentation at
/swagger/index.html
The API follows RESTful principles with the following key components:
- Authentication Middleware: JWT token validation
- Rate Limiting Middleware: Request throttling
- CORS Support: Cross-origin resource sharing
- Structured Error Responses: Consistent error handling
- Pagination: Efficient data retrieval for large datasets
- Validation: Input sanitization and validation
http://localhost:8080/api/v1
The API supports JWT-based authentication for secure access.
POST /auth/login
Content-Type: application/json
{
"username": "admin",
"password": "password"
}Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 3600,
"user": {
"id": 1,
"username": "admin",
"role": "admin"
}
}Include the JWT token in the Authorization header for subsequent requests:
GET /models
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...The API implements rate limiting to prevent abuse:
- Authenticated requests: 1000 requests per hour
- Unauthenticated requests: 100 requests per hour
Rate limit information is included in response headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200
All responses follow a consistent format:
{
"success": true,
"data": {
// Response data
},
"meta": {
"total": 100,
"page": 1,
"per_page": 20,
"timestamp": "2024-01-01T00:00:00Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": {
"field": "email",
"message": "Email is required"
}
},
"meta": {
"timestamp": "2024-01-01T00:00:00Z"
}
}GET /modelsQuery Parameters:
search(string): Search term for model name or descriptionprovider_id(int): Filter by provider IDmin_score(float): Minimum overall scoreverification_status(string): Filter by verification statussupports_tool_use(bool): Filter by tool use supportsupports_code_generation(bool): Filter by code generation supportpage(int): Page number (default: 1)per_page(int): Items per page (default: 20)sort(string): Sort field (name, score, created_at)order(string): Sort order (asc, desc)
Response:
{
"success": true,
"data": [
{
"id": 1,
"provider_id": 1,
"model_id": "gpt-4-turbo",
"name": "GPT-4 Turbo",
"description": "OpenAI's most capable model",
"version": "2024-04",
"architecture": "transformer",
"parameter_count": 170000000000,
"context_window_tokens": 128000,
"max_output_tokens": 4096,
"is_multimodal": true,
"supports_vision": true,
"supports_audio": false,
"supports_video": false,
"supports_reasoning": true,
"open_source": false,
"deprecated": false,
"tags": ["gpt", "openai", "turbo"],
"language_support": ["en", "es", "fr", "de", "it", "pt", "nl", "ru", "ja", "ko", "zh"],
"use_case": "general_purpose",
"verification_status": "verified",
"overall_score": 92.5,
"code_capability_score": 95.0,
"responsiveness_score": 88.0,
"reliability_score": 94.0,
"feature_richness_score": 91.0,
"value_proposition_score": 89.0,
"last_verified": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
],
"meta": {
"total": 50,
"page": 1,
"per_page": 20
}
}GET /models/{model_id}Response:
{
"success": true,
"data": {
"id": 1,
"provider_id": 1,
"model_id": "gpt-4-turbo",
"name": "GPT-4 Turbo",
"description": "OpenAI's most capable model",
"version": "2024-04",
"architecture": "transformer",
"parameter_count": 170000000000,
"context_window_tokens": 128000,
"max_output_tokens": 4096,
"is_multimodal": true,
"supports_vision": true,
"supports_audio": false,
"supports_video": false,
"supports_reasoning": true,
"supports_brotli": true,
"supports_brotli": true,
"open_source": false,
"deprecated": false,
"tags": ["gpt", "openai", "turbo"],
"language_support": ["en", "es", "fr", "de", "it", "pt", "nl", "ru", "ja", "ko", "zh"],
"use_case": "general_purpose",
"verification_status": "verified",
"overall_score": 92.5,
"code_capability_score": 95.0,
"responsiveness_score": 88.0,
"reliability_score": 94.0,
"feature_richness_score": 91.0,
"value_proposition_score": 89.0,
"last_verified": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
}POST /models
Content-Type: application/json
{
"provider_id": 1,
"model_id": "custom-model",
"name": "Custom Model",
"description": "A custom language model",
"version": "1.0",
"architecture": "transformer",
"parameter_count": 7000000000,
"context_window_tokens": 8192,
"max_output_tokens": 2048,
"is_multimodal": false,
"supports_vision": false,
"supports_audio": false,
"supports_video": false,
"supports_reasoning": false,
"open_source": true,
"deprecated": false,
"tags": ["custom", "open-source"],
"language_support": ["en"],
"use_case": "specialized"
}PUT /models/{model_id}
Content-Type: application/json
{
"name": "Updated Model Name",
"description": "Updated description",
"deprecated": true
}DELETE /models/{model_id}POST /models/{model_id}/verifyResponse:
{
"success": true,
"data": {
"verification_id": 123,
"status": "started",
"message": "Verification started for model"
}
}GET /models/{model_id}/resultsGET /providersQuery Parameters:
search(string): Search term for provider nameis_active(bool): Filter by active statuspage(int): Page numberper_page(int): Items per page
GET /providers/{provider_id}POST /providers
Content-Type: application/json
{
"name": "Custom Provider",
"endpoint": "https://api.custom-provider.com/v1",
"api_key_encrypted": "encrypted_api_key",
"description": "A custom LLM provider",
"website": "https://custom-provider.com",
"support_email": "[email protected]",
"documentation_url": "https://docs.custom-provider.com"
}PUT /providers/{provider_id}
Content-Type: application/json
{
"name": "Updated Provider Name",
"is_active": false
}DELETE /providers/{provider_id}GET /verification-resultsQuery Parameters:
model_id(int): Filter by model IDstatus(string): Filter by status (running, completed, failed)from_date(date): Filter results from this dateto_date(date): Filter results to this datemin_score(float): Minimum overall scorepage(int): Page numberper_page(int): Items per page
GET /verification-results/{result_id}Response:
{
"success": true,
"data": {
"id": 123,
"model_id": 1,
"verification_type": "full",
"started_at": "2024-01-01T00:00:00Z",
"completed_at": "2024-01-01T00:05:00Z",
"status": "completed",
"exists": true,
"responsive": true,
"overloaded": false,
"latency_ms": 150,
"supports_tool_use": true,
"supports_function_calling": true,
"supports_code_generation": true,
"supports_code_completion": true,
"supports_code_review": true,
"supports_code_explanation": true,
"supports_embeddings": true,
"supports_reranking": false,
"supports_image_generation": false,
"supports_audio_generation": false,
"supports_video_generation": false,
"supports_mcps": true,
"supports_lsps": true,
"supports_multimodal": true,
"supports_streaming": true,
"supports_json_mode": true,
"supports_structured_output": true,
"supports_reasoning": true,
"supports_parallel_tool_use": true,
"max_parallel_calls": 10,
"supports_batch_processing": false,
"code_language_support": ["python", "javascript", "go", "java", "cpp"],
"code_debugging": true,
"code_optimization": true,
"test_generation": true,
"documentation_generation": true,
"refactoring": true,
"error_resolution": true,
"architecture_design": true,
"security_assessment": true,
"pattern_recognition": true,
"debugging_accuracy": 0.85,
"max_handled_depth": 5,
"code_quality_score": 0.92,
"logic_correctness_score": 0.88,
"runtime_efficiency_score": 0.85,
"overall_score": 92.5,
"code_capability_score": 95.0,
"responsiveness_score": 88.0,
"reliability_score": 94.0,
"feature_richness_score": 91.0,
"value_proposition_score": 89.0,
"avg_latency_ms": 145,
"p95_latency_ms": 200,
"min_latency_ms": 100,
"max_latency_ms": 300,
"throughput_rps": 6.9,
"created_at": "2024-01-01T00:00:00Z"
}
}GET /verification-results/latestGET /config-exportsPOST /config-exports
Content-Type: application/json
{
"export_type": "opencode",
"name": "High Quality Models",
"description": "Models with score >= 80",
"target_models": [1, 2, 3],
"filters": {
"min_score": 80,
"supports_code_generation": true,
"supports_tool_use": true
}
}GET /config-exports/{export_id}/downloadResponse: Configuration file content (JSON format)
GET /config-exports/opencodeQuery Parameters:
min_score(float): Minimum score filtersupports_tool_use(bool): Tool use support filtersupports_code_generation(bool): Code generation support filter
GET /schedulesPOST /schedules
Content-Type: application/json
{
"name": "Daily Verification",
"description": "Daily verification of all models",
"schedule_type": "cron",
"cron_expression": "0 2 * * *",
"target_type": "all_models",
"target_id": null,
"is_active": true
}PUT /schedules/{schedule_id}
Content-Type: application/json
{
"name": "Updated Schedule Name",
"is_active": false
}DELETE /schedules/{schedule_id}POST /schedules/{schedule_id}/runGET /eventsQuery Parameters:
event_type(string): Filter by event typeseverity(string): Filter by severity (debug, info, warning, error, critical)model_id(int): Filter by model IDprovider_id(int): Filter by provider IDfrom_date(date): Filter events from this dateto_date(date): Filter events to this datepage(int): Page numberper_page(int): Items per page
POST /events/subscribe
Content-Type: application/json
{
"event_types": ["verification_completed", "issue_detected"],
"model_ids": [1, 2, 3],
"webhook_url": "https://your-webhook.com/events",
"webhook_secret": "your-webhook-secret"
}DELETE /events/subscribe/{subscription_id}GET /notifications/settingsPUT /notifications/settings
Content-Type: application/json
{
"slack": {
"enabled": true,
"webhook_url": "https://hooks.slack.com/services/...",
"channel": "#llm-alerts"
},
"email": {
"enabled": true,
"smtp_host": "smtp.gmail.com",
"smtp_port": 587,
"username": "[email protected]",
"password": "app-password",
"from": "[email protected]",
"to": ["[email protected]"]
},
"telegram": {
"enabled": true,
"bot_token": "bot-token",
"chat_id": "chat-id"
}
}GET /issuesQuery Parameters:
model_id(int): Filter by model IDseverity(string): Filter by severity (critical, high, medium, low)status(string): Filter by status (open, resolved)issue_type(string): Filter by issue type
GET /issues/{issue_id}POST /issues
Content-Type: application/json
{
"model_id": 1,
"issue_type": "performance",
"severity": "high",
"title": "High latency detected",
"description": "Model is showing consistently high response times",
"symptoms": "Response times > 5 seconds",
"workarounds": "Retry requests with exponential backoff",
"affected_features": ["streaming", "real_time"]
}PUT /issues/{issue_id}
Content-Type: application/json
{
"severity": "critical",
"resolved_at": "2024-01-01T00:00:00Z",
"resolution_notes": "Issue resolved after API provider fix"
}GET /healthResponse:
{
"success": true,
"data": {
"status": "healthy",
"timestamp": "2024-01-01T00:00:00Z",
"version": "1.0.0",
"database": "connected",
"uptime": 3600
}
}GET /system/infoResponse:
{
"success": true,
"data": {
"version": "1.0.0",
"build_time": "2024-01-01T00:00:00Z",
"go_version": "1.21.0",
"git_commit": "abc123",
"database_version": "3.40.0",
"total_models": 150,
"total_providers": 10,
"total_verifications": 5000,
"system_stats": {
"cpu_usage": 15.2,
"memory_usage": 45.8,
"disk_usage": 23.1
}
}
}GET /system/database-statsResponse:
{
"success": true,
"data": {
"total_size": "125.5 MB",
"table_stats": [
{
"table": "models",
"rows": 150,
"size": "2.1 MB"
},
{
"table": "verification_results",
"rows": 5000,
"size": "45.2 MB"
},
{
"table": "events",
"rows": 15000,
"size": "78.2 MB"
}
],
"index_stats": [
{
"index": "idx_models_overall_score",
"size": "0.8 MB"
}
]
}
}Connect to the WebSocket endpoint for real-time event streaming:
const ws = new WebSocket('ws://localhost:8080/api/v1/events/stream');
ws.onopen = function(event) {
console.log('Connected to event stream');
};
ws.onmessage = function(event) {
const data = JSON.parse(event.data);
console.log('Received event:', data);
};
ws.onerror = function(error) {
console.error('WebSocket error:', error);
};Subscribe to specific events by sending a subscription message:
{
"action": "subscribe",
"event_types": ["verification_completed", "issue_detected"],
"model_ids": [1, 2, 3]
}Events are sent as JSON messages:
{
"event_type": "verification_completed",
"severity": "info",
"title": "Verification Completed",
"message": "Model GPT-4 verification completed with score 92.5",
"data": {
"model_id": 1,
"verification_result_id": 123,
"score": 92.5
},
"timestamp": "2024-01-01T00:00:00Z"
}The API uses standard HTTP status codes and provides detailed error information:
- 200 OK: Successful request
- 201 Created: Resource created successfully
- 400 Bad Request: Invalid request parameters
- 401 Unauthorized: Authentication required or invalid
- 403 Forbidden: Insufficient permissions
- 404 Not Found: Resource not found
- 409 Conflict: Resource conflict
- 422 Unprocessable Entity: Validation error
- 429 Too Many Requests: Rate limit exceeded
- 500 Internal Server Error: Server error
VALIDATION_ERROR: Request validation failedAUTHENTICATION_ERROR: Authentication failedAUTHORIZATION_ERROR: Insufficient permissionsNOT_FOUND: Resource not foundCONFLICT: Resource conflictRATE_LIMIT_EXCEEDED: Rate limit exceededDATABASE_ERROR: Database operation failedEXTERNAL_API_ERROR: External API call failedINTERNAL_ERROR: Internal server error
package main
import (
"fmt"
"github.com/your-org/llm-verifier-go-client"
)
func main() {
client := llmverifier.NewClient("http://localhost:8080/api/v1")
client.SetAuthToken("your-jwt-token")
// List models
models, err := client.ListModels(nil)
if err != nil {
panic(err)
}
for _, model := range models {
fmt.Printf("Model: %s, Score: %.1f\n", model.Name, model.OverallScore)
}
}from llm_verifier_client import LLMVerifierClient
client = LLMVerifierClient("http://localhost:8080/api/v1")
client.set_auth_token("your-jwt-token")
# List models
models = client.list_models()
for model in models:
print(f"Model: {model['name']}, Score: {model['overall_score']}")
# Get specific model
model = client.get_model(1)
print(f"Model details: {model}")const { LLMVerifierClient } = require('llm-verifier-client');
const client = new LLMVerifierClient('http://localhost:8080/api/v1');
client.setAuthToken('your-jwt-token');
// List models
const models = await client.listModels();
models.forEach(model => {
console.log(`Model: ${model.name}, Score: ${model.overall_score}`);
});
// Get specific model
const model = await client.getModel(1);
console.log('Model details:', model);List endpoints support pagination using the following parameters:
page(int): Page number (default: 1)per_page(int): Items per page (default: 20, max: 100)
Pagination information is included in the response meta:
{
"success": true,
"data": [...],
"meta": {
"total": 150,
"page": 2,
"per_page": 20,
"total_pages": 8,
"has_next": true,
"has_prev": true
}
}Most list endpoints support filtering and search:
Use the search parameter to search across text fields:
GET /models?search=gptUse specific field parameters to filter results:
GET /models?min_score=80&supports_tool_use=true&verification_status=verifiedUse the sort and order parameters:
GET /models?sort=overall_score&order=descThe API uses URL versioning. The current version is v1:
/api/v1/...
When breaking changes are introduced, a new version will be released (e.g., /api/v2/). The previous version will be maintained for a deprecation period.
- Initial API release
- Full CRUD operations for models, providers, and verification results
- Event streaming with WebSocket support
- Configuration export functionality
- Scheduling system
- Notification system integration
- Comprehensive filtering and search
- JWT authentication
- Rate limiting
This API documentation provides comprehensive information for integrating with the LLM Verifier REST API. For additional support or to report issues, please visit our GitHub repository.
