Skip to content

Errors

All BVE Gateway errors use the OpenAI error envelope format.

{
"error": {
"message": "Human-readable description of the error.",
"type": "error_type",
"code": "machine_readable_code"
}
}
StatusMeaning
400Bad request (invalid JSON, unsupported operation)
401Missing or invalid credentials
403Valid credentials but key is suspended or revoked
404Route not found
413Request body exceeds 10 MB
429Rate limit exceeded
500Internal server error
502Upstream Fuelix error or unreachable
CodeStatusDescription
missing_api_key401No Authorization header present
invalid_api_key401Wrong scheme, wrong prefix, or key not in DB
api_key_suspended403Key is suspended by an admin
api_key_revoked403Key has been revoked
CodeStatusDescription
rate_limit_exceeded429RPM, RPD, or monthly limit hit

Rate limit error messages indicate which limit was exceeded:

{
"error": {
"message": "Rate limit exceeded: requests per minute",
"type": "rate_limit_error",
"code": "rate_limit_exceeded"
}
}

Possible messages:

  • "Rate limit exceeded: requests per minute"
  • "Rate limit exceeded: requests per day"
  • "Monthly request limit exceeded"
CodeStatusDescription
invalid_json400Request body is not valid JSON
unsupported_streaming_completion400stream: true used with /v1/completions
request_too_large413Body exceeds 10 MB
CodeStatusDescription
internal_error500Unhandled exception in the gateway
upstream_error502Fuelix is unreachable or returned 5xx
{
"error": {
"message": "Route GET /v1/unknown not found",
"type": "invalid_request_error",
"code": "route_not_found"
}
}
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'sk-bve-YOUR_KEY',
baseURL: 'https://api.bve.me/v1',
});
try {
const response = await client.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'Hello' }],
});
} catch (err) {
if (err instanceof OpenAI.APIError) {
console.error(err.status, err.message);
// err.error.code for the machine-readable code
}
}