跳转到主要内容

API 错误参考

所有 API 错误都遵循一致的 JSON 格式:
{
  "error": {
    "type": "error_type",
    "code": "http_status_code",
    "message": "可读的错误信息"
  }
}

错误类型

HTTP 状态码错误类型描述
400invalid_request_error请求体或参数格式错误
401authentication_errorAPI 密钥缺失、无效或已过期
402insufficient_balance账户余额不足
403permission_error账户缺少访问该资源的权限
404not_found_error模型或资源不存在
405invalid_request_errorHTTP 方法错误
429rate_limit_error请求过多,请稍后重试
500+api_error服务器处理请求时发生错误
529overloaded_error服务暂时过载,请稍后重试

错误示例

认证错误 (401)

{
  "error": {
    "type": "authentication_error",
    "code": "401",
    "message": "Incorrect API key provided. Please visit https://console.pipellm.ai/account/api-keys to find your API key."
  }
}

速率限制错误 (429)

当超过速率限制时,响应中会包含您当前的限制信息:
{
  "error": {
    "type": "rate_limit_error",
    "code": "429",
    "message": "Rate limit exceeded. Your current limit is 100 requests per minute (approximately 1 requests per second). Please visit https://console.pipellm.ai/billing to upgrade your plan for higher limits.",
    "rate_limit": {
      "rpm": 100,
      "qps": 1
    }
  }
}

余额不足 (402)

{
  "error": {
    "type": "insufficient_balance",
    "code": "402",
    "message": "Insufficient balance. Please recharge your account at https://console.pipellm.ai/billing."
  }
}

内部错误 (500)

{
  "error": {
    "type": "api_error",
    "code": "500",
    "message": "Internal server error occurred. Our team has been notified and is working on it."
  }
}

模型相关错误

模型未找到

当请求无效的模型时,API 会建议相似的模型:
{
  "error": {
    "type": "invalid_request_error",
    "code": "400",
    "message": "gpt-5 is not a valid model ID. Did you mean one of these: gpt-4o, gpt-4-turbo; You can view all the models in our documentation: https://docs.pipellm.ai"
  }
}

请求中缺少模型

{
  "error": {
    "type": "invalid_request_error",
    "code": "400",
    "message": "The 'model' field is required but was not provided in the request"
  }
}

🤝 支持