try { const response = await axios.get('https://api.langdock.com/api/public/assistant/v1/get', ...);} catch (error) { if (error.response) { switch (error.response.status) { case 400: console.error('Invalid agent ID format'); break; case 401: console.error('Invalid or missing API key'); break; case 403: console.error('Insufficient permissions - no access to this agent'); break; case 404: console.error('Agent not found'); break; case 500: console.error('Server error'); break; } }}
Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.