# Open AI Chat Node Error \[Invalid value for 'content': expected a string, got null.\]

**URL:** <https://community.n8n.io/t/open-ai-chat-node-error-invalid-value-for-content-expected-a-string-got-null/50694>\
**Category:** Questions\
**Tags:** openai\
**Created:** [24 Julio, 2024 15:02 UTC](https://community.n8n.io/t/open-ai-chat-node-error-invalid-value-for-content-expected-a-string-got-null/50694 "2024-07-24T15:02:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Devin\_Kearns](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/devin_kearns/32/42271_2.png) [@Devin\_Kearns](https://community.n8n.io/u/Devin_Kearns)\
**Post date:** [24 Julio, 2024 15:02 UTC](https://community.n8n.io/t/open-ai-chat-node-error-invalid-value-for-content-expected-a-string-got-null/50694/1 "2024-07-24T15:02:05Z")

</div>

## Describe the problem/error/question

I’m passing a prompt through with the field ‘chatInput’ but getting the error “Invalid value for ‘content’: expected a string, got null.”. I’ve stringified it and it still doesn’t work. It seems like a problem with the API but not sure.

## What is the error message (if any)?

```auto
{
  "errorMessage": "Bad request - please check your parameters",
  "errorDescription": "Invalid value for 'content': expected a string, got null.",
  "errorDetails": {
    "rawErrorMessage": [
      "400 - {\"error\":{\"message\":\"Invalid value for 'content': expected a string, got null.\",\"type\":\"invalid_request_error\",\"param\":\"messages.[9].content\",\"code\":null}}"
    ],
    "httpCode": "400"
  },
  "n8nDetails": {
    "nodeName": "OpenAI1",
    "nodeType": "@n8n/n8n-nodes-langchain.openAi",
    "nodeVersion": 1.4,
    "resource": "text",
    "operation": "message",
    "itemIndex": 0,
    "time": "7/24/2024, 9:53:37 AM",
    "n8nVersion": "1.52.0 (Cloud)",
    "binaryDataMode": "filesystem",
    "stackTrace": [
      "NodeApiError: Bad request - please check your parameters",
      " at Object.requestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1293:19)",
      " at processTicksAndRejections (node:internal/process/task_queues:95:5)",
      " at Object.requestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:2083:20)",
      " at Object.apiRequest (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/vendors/OpenAi/transport/index.js:17:12)",
      " at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/vendors/OpenAi/actions/text/message.operation.js:240:21)",
      " at Object.router (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/vendors/OpenAi/actions/router.js:64:34)",
      " at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/vendors/OpenAi/OpenAi.node.js:16:16)",
      " at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:728:19)",
      " at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:673:51",
      " at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1085:20"
    ]
  }
}

```

## Please share your workflow

## Share the output returned by the last node

```
  {
    "chatInput": "Summarize my latest email from stephanie walker"
  }

```

## Information on your n8n setup

- **n8n version:**

1.52.0

- **Database (default: SQLite):**

Pinecone

- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):**

Cloud

- **Operating system:**

---

<div class="post-metadata">

**Author:** ![Devin\_Kearns](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/devin_kearns/32/42271_2.png) [@Devin\_Kearns](https://community.n8n.io/u/Devin_Kearns)\
**Post date:** [24 Julio, 2024 15:19 UTC](https://community.n8n.io/t/open-ai-chat-node-error-invalid-value-for-content-expected-a-string-got-null/50694/2 "2024-07-24T15:19:37Z")

</div>

It looks like an issue with the Vector Store tool. It outputs ‘response’ and the node is expecting ‘content’. However, it’s been working just fine in the past, even just yesterday.

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [26 Julio, 2024 15:24 UTC](https://community.n8n.io/t/open-ai-chat-node-error-invalid-value-for-content-expected-a-string-got-null/50694/5 "2024-07-26T15:24:11Z")

</div>

Hey @Devin_Kearns,

Welcome to the community 🍰

It should still be ok, What happens if you disable the json option in the OpenAI node does that make any difference? Did anything change between it working and it not working?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [24 Octubre, 2024 15:24 UTC](https://community.n8n.io/t/open-ai-chat-node-error-invalid-value-for-content-expected-a-string-got-null/50694/6 "2024-10-24T15:24:14Z")

</div>

Cerrado el 24 Octubre, 2024 15:24 UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
