The SambaNova Cloud API uses standard HTTP response status codes to indicate whether an API request was successful or failed.

When a request fails, the API responds with a JSON object containing details about the error. These include:

  • Error code

    • Identifies the type of error.
  • Parameter (if applicable)

    • Specifies the property causing the error.
  • Error message

    • Provides a clear explanation of the issue.

Error message

This error message indicates that a parameter value exceeded the allowed maximum. The top_p parameter received a value of 100, whereas it should be between 0 and 1. The error type is invalid_request_error, with the code decimal_above_max_value.

Example error message
{
  "error": {
    "message": "Decimal above maximum value. Expected a value between 0 and 1, but got 100 instead.",
    "type": "invalid_request_error",
    "param": "top_p",
    "code": "decimal_above_max_value"
  }
}

Error categories

Use the following table to understand the various error categories.

Error categoryDescription
HTTP 400 errors: Bad requestThese errors occur when the server cannot process the client’s request due to invalid syntax or input values.
HTTP 401 errors: UnauthorizedThese errors occur when the client does not provide valid authentication credentials.
HTTP 408 errors: Request timeoutThese errors occur when a client’s request times out before being completed.
HTTP 429 errors: Too many requestsThese errors occur when the client exceeds the rate limit for their subscription tier.

Error code reference

Use the following table to understand and troubleshoot errors programmatically.

Error categoryError codeDescription
HTTP 400context_length_exceededInput and output tokens exceed the model’s supported context length.
invalid_typeParameter value is of a different type than expected (e.g., an int is required, but a float is provided).
decimal_above_max_valueParameter value exceeds the allowed maximum.
decimal_below_min_valueParameter value is below the allowed minimum.
integer_above_max_valueParameter value exceeds the maximum allowed integer.
model_not_foundProvided model ID does not exist.
HTTP 401invalid_authenticationThe API key provided is invalid or unauthorized. Generate a valid API key from the SambaNova Cloud portal.
HTTP 408request_timeoutRequest timed out due to high traffic. Consider upgrading to a higher subscription tier to avoid this.
HTTP 429insufficient_quotaRate-limited access due to subscription tier. Upgrade to a higher tier to increase quota.