diff --git a/pages/generative-apis/troubleshooting/fixing-common-issues.mdx b/pages/generative-apis/troubleshooting/fixing-common-issues.mdx index 1b7fbd2484..1f6a986d79 100644 --- a/pages/generative-apis/troubleshooting/fixing-common-issues.mdx +++ b/pages/generative-apis/troubleshooting/fixing-common-issues.mdx @@ -26,6 +26,19 @@ Below are common issues that you may encounter when using Generative APIs, their - `15k` tokens context window on `H100` Instances - `128k` tokens context window on `H100-2` Instances +## 400: Bad Request - Invalid JSON body + +### Cause +- You provided a JSON body that does not follow the [standard JSON structure](https://datatracker.ietf.org/doc/html/rfc8259), therefore your request cannot be analyzed. + +### Solution +- Verify the JSON body you send is valid: + - You can store your content in a file with the `.json` extension (eg. named `file.json`), and open it with an IDE such as VSCode or Zed. Syntax errors should display if there are any. + - You can copy your content in a JSON formatter tool or linter available online, that will identify errors. + - Usually, most common errors include: + - Missing or unecessary quotes `"`, `'` or commas `,` on properties name and string values. + - Special characters that are not escaped, such as line break `\n` or backslash `\\` + ## 403: Forbidden - Insufficient permissions to access the resource ### Cause @@ -234,4 +247,4 @@ This snippet will output the model response, which is `4`. ### Debugging silent errors - For cases where no explicit error is returned: - Verify all fields in the API request are correctly named and formatted. - - Test the request with smaller and simpler inputs to isolate potential issues. \ No newline at end of file + - Test the request with smaller and simpler inputs to isolate potential issues.