The Solvice Platform uses API key authentication to secure access to all optimization endpoints. Every request to our solvers requires a valid API key included in the request headers.
All API communications are encrypted using HTTPS to ensure your data and credentials remain secure during transmission.
using var client = new HttpClient();client.DefaultRequestHeaders.Add("Authorization", Environment.GetEnvironmentVariable("SOLVICE_API_KEY"));var response = await client.PostAsJsonAsync( "https://api.solvice.io/v2/vrp/solve", requestData);response.EnsureSuccessStatusCode();var result = await response.Content.ReadFromJsonAsync<SolveResponse>();
Problem: No API key provided in the requestSolution: Ensure the Authorization header is included in your request
# ❌ Missing Authorization headercurl -X POST 'https://api.solvice.io/v2/vrp/solve'# ✅ Correctcurl -X POST 'https://api.solvice.io/v2/vrp/solve' \ -H 'Authorization: YOUR_API_KEY'
401 Unauthorized - Invalid API Key
Problem: The provided API key is invalid or has been revokedSolution:
Verify you’re using the correct API key
Check if the key has been accidentally truncated
Ensure the key hasn’t been revoked in your dashboard
403 Forbidden - Insufficient Permissions
Problem: Your API key doesn’t have permission for the requested operationSolution: Check your key’s permissions in the dashboard and ensure it has access to:
// Client makes requests to your server, not directly to Solviceconst response = await fetch('/api/solve', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(optimizationRequest)});// No API key needed on client sideconst result = await response.json();