{"openapi":"3.0.0","info":{"title":"Breachr API","version":"1.0.0","description":"API for ingesting analytics data into Breachr platform","contact":{"name":"Breachr Support","email":"afia.amine@gmail.com"}},"servers":[{"url":"https://www.breachr.dev","description":"Current server"}],"paths":{"/api/ingest":{"post":{"summary":"Ingest API performance data","description":"Send API performance metrics to the Breachr platform for monitoring and analytics.","operationId":"ingestData","tags":["Analytics"],"security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"api_performance":{"type":"array","description":"Array of API performance metrics","items":{"$ref":"#/components/schemas/ApiPerformance"}}},"required":["api_performance"]},"examples":{"withData":{"summary":"Request with API performance data","value":{"api_performance":[{"provider_name":"OpenAI","provider_url":"https://api.openai.com/v1/chat/completions","http_status_code":200,"latency_ms":150,"source_region":"us-east-1","timestamp":"2024-01-01T00:00:00Z","error_message":null}]}}}}}},"responses":{"200":{"description":"Data successfully ingested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestionResponse"}}}},"400":{"description":"Bad request - Invalid data format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key for authentication. Get your API key from the API Keys page in your dashboard."}},"schemas":{"ApiPerformance":{"type":"object","required":["provider_name","provider_url","http_status_code","latency_ms","source_region"],"properties":{"provider_name":{"type":"string","description":"Name of the API provider","example":"OpenAI"},"provider_url":{"type":"string","format":"uri","description":"URL of the API provider endpoint","example":"https://api.openai.com/v1/chat/completions"},"http_status_code":{"type":"integer","description":"HTTP status code of the response","example":200},"latency_ms":{"type":"integer","minimum":0,"description":"Latency in milliseconds","example":150},"error_message":{"type":"string","nullable":true,"description":"Error message if the request failed","example":null},"source_region":{"type":"string","description":"Region where the request originated","example":"us-east-1"},"timestamp":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of the API call","example":"2024-01-01T00:00:00Z"}}},"IngestionResponse":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the ingestion was successful","example":true},"message":{"type":"string","description":"Success message","example":"Data successfully ingested"},"results":{"type":"object","properties":{"api_performance":{"type":"object","description":"Result of api_performance ingestion"}}}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"Error message","example":"Invalid API key"},"details":{"oneOf":[{"type":"string"},{"type":"object"},{"type":"array"}],"description":"Additional error details"}}}}}}