Skip to content

Instantly share code, notes, and snippets.

{
"name": "Batch Process Prompts with OpenAI API",
"nodes": [
{
"parameters": {
"content": "### This workflow automates sending batched prompts to OpenAI. It submits multiple prompts at once and retrieves the results.\n\n#### How to use\n\nCall this workflow with array of `requests`\n\n```json\n[\n {\n \"requests\": [\n {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Write me a short story\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Write me a short story\"\n }\n ],\n \"custom_id\": \"1\",\n \"model\": \"gpt-3.5-turbo-0125\",\n \"method\": \"POST\",\n \"url\": \"/v1/chat/completions\",\n \"max_tokens\": 1000\n },\n {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Write me a short story\"\n },\n {\n \"role\": \"user\",\n \"content\"