Versions in this module Expand all Collapse all v2 v2.3.0 Apr 21, 2026 v2.2.0 Mar 15, 2026 v2.1.0 Feb 9, 2026 v2.0.0 Jan 21, 2026 Changes in this version + var ERR_CONTEXT_LENGTH_EXCEEDED = NewApiError(400, "context_length_exceeded", "Please reduce the length of the messages.", ...) + var ERR_INSUFFICIENT_QUOTA = NewApiError(429, "insufficient_quota", "You exceeded your current quota.", ...) + var ERR_INVALID_API_KEY = NewApiError(401, "invalid_api_key", "Incorrect API key provided or has been disabled.", ...) + var ERR_MODEL_NOT_FOUND = NewApiError(404, "model_not_found", ...) + var ERR_RATE_LIMIT_EXCEEDED = NewApiError(429, "rate_limit_exceeded", "Rate limit reached, Please try again later.", ...) + func As(err error, target any) bool + func Is(err, target error) bool + func New(text string) error + func NewApiError(httpStatusCode int, code any, message, typ string, param any) error + func NewRequestError(httpStatusCode int, err error) error + func Newf(format string, args ...any) error + type ApiError struct + Code any + HttpStatusCode int + Message string + Param any + Type string + func (e *ApiError) Error() string + func (e *ApiError) UnmarshalJSON(data []byte) (err error) + type ErrorResponse struct + Error *ApiError + type RequestError struct + Err error + HttpStatusCode int + func (e *RequestError) Error() string + func (e *RequestError) Unwrap() error