Skip to content

Errors

DevLens returns standard HTTP status codes and OpenAI-compatible error objects.

Status codes

CodeMeaningDescription
200OKRequest succeeded
400Bad RequestMalformed request — check parameters
401UnauthorizedInvalid or missing API key
403ForbiddenInsufficient permissions
404Not FoundEndpoint does not exist
429Too Many RequestsRate limit exceeded or insufficient balance
500Internal Server ErrorServer-side failure
502Bad GatewayUpstream provider unavailable
503Service UnavailableTemporary outage

Error response format

json
{
  "error": {
    "message": "Human-readable description",
    "type": "invalid_request_error",
    "code": "invalid_api_key"
  }
}

Common errors

401 — Invalid API Key

json
{"error": {"message": "Invalid API key", "type": "authentication_error"}}
  1. Verify key starts with sk-
  2. Confirm key is enabled in Console → API Keys
  3. Check header format: Authorization: Bearer sk-xxx

429 — Insufficient Quota

json
{"error": {"message": "Insufficient quota", "type": "insufficient_quota"}}
  1. Add credits via Console → Top Up
  2. Check key-level quota limits

400 — Model Not Found

json
{"error": {"message": "Model not found: xxx", "type": "invalid_request_error"}}
  1. Verify the model parameter spelling
  2. Query GET /v1/models for available identifiers
  3. Confirm the model is accessible with your key

Unified AI Model Gateway