{"product_id":"n8n-workflow-gpt-4o-text-generation-via-openai-api","title":"n8n Workflow: GPT-4o Text Generation via OpenAI API","description":"\u003ch3\u003eGenerate GPT-4o text in n8n using the OpenAI-compatible TokenWorks Chat Completions API\u003c\/h3\u003e\n\u003cp\u003eTurn any prompt into ready-to-use text by running an n8n workflow that sends your input to TokenWorks’ OpenAI-compatible \u003cstrong\u003e\/v1\/chat\/completions\u003c\/strong\u003e endpoint and returns the GPT-4o (or another model) response instantly.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eBuilds a prompt\u003c\/strong\u003e inside the workflow using the \u003cem\u003eSet\u003c\/em\u003e node (a plain text string that defines what you want the model to answer).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSends an HTTP POST request\u003c\/strong\u003e to \u003cstrong\u003eTokenWorks (token8341.com)\u003c\/strong\u003e at \u003cstrong\u003e\/v1\/chat\/completions\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eMaps the prompt into the \u003ccode\u003emessages\u003c\/code\u003e array\u003c\/strong\u003e for a Chat Completions style request.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSets the model field to \u003ccode\u003egpt-4o\u003c\/code\u003e\u003c\/strong\u003e (you can change this to use a different model by updating the request body).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReturns the generated chat completion\u003c\/strong\u003e from TokenWorks as the workflow output.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eCreate draft marketing copy, product descriptions, or landing page sections from a single prompt in an n8n automation.\u003c\/li\u003e\n  \u003cli\u003eGenerate structured text for internal documentation or knowledge base articles.\u003c\/li\u003e\n  \u003cli\u003eProduce response templates (e.g., FAQ answers or support replies) based on input context.\u003c\/li\u003e\n  \u003cli\u003eUse GPT-4o text generation as a building block inside larger n8n automations for SaaS operations.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCategory:\u003c\/strong\u003e n8n automation workflow\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNodes used:\u003c\/strong\u003e \u003cstrong\u003eSet\u003c\/strong\u003e, \u003cstrong\u003eHTTP Request\u003c\/strong\u003e\n\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAPI integration:\u003c\/strong\u003e TokenWorks OpenAI-compatible Chat Completions endpoint \u003ccode\u003e\/v1\/chat\/completions\u003c\/code\u003e\n\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAuthentication:\u003c\/strong\u003e add an n8n HTTP Header Auth credential (e.g., \u003ccode\u003eAuthorization: Bearer \u0026lt;TOKENWORKS_API_KEY\u0026gt;\u003c\/code\u003e) and select it in the HTTP request step\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOutput:\u003c\/strong\u003e the workflow returns the TokenWorks generated chat completion response\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003cp\u003e\u003cstrong\u003eSetup tip:\u003c\/strong\u003e create a TokenWorks account, generate an API key, update the workflow prompt, and confirm the \u003ccode\u003emodel\u003c\/code\u003e you want (default: \u003ccode\u003egpt-4o\u003c\/code\u003e).\u003c\/p\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46066356027571,"sku":"N8N-19755","price":14.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/kt_FJbU04sIirUR9m_xQv_mXtuZiLR.png?v=1789894911","url":"https:\/\/buyflowscripts.com\/products\/n8n-workflow-gpt-4o-text-generation-via-openai-api","provider":"N8N Commerce","version":"1.0","type":"link"}