This endpoint processes messages for a specific agent, generating a response using one of your AI agents. It can optionally maintain conversation history through threads.
curl -X POST https://app.dumplingai.com/api/v1/agents/generate-completion \-H "Content-Type: application/json" \-H "Authorization: Bearer YOUR_API_KEY" \-d '{ "messages": [ { "role": "user", "content": "Hello, can you help me with a task?" } ], "agentId": "agent_123456", "parseJson": false, "threadId": "optional_thread_id"}'
{ "parsedJson": null, "text": "Certainly! I'd be happy to help you with a task. What kind of task do you need assistance with?", "stepsTaken": 1, "steps": [ { "text": "Certainly! I'd be happy to help you with a task. What kind of task do you need assistance with?", "toolCalls": [], "toolResults": [], "finishReason": "stop", "usage": { "promptTokens": 20, "completionTokens": 15, "totalTokens": 35 } } ], "tokenUsage": { "promptTokens": 20, "completionTokens": 15, "totalTokens": 35 }, "creditUsage": 1, "threadId": "thread_123456"}
Parsed JSON extracted from the final assistant text when parseJson is true.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"DumplingAI Docs","colors":{"primary":"#000","light":"#fdfdfd","dark":"#000"},"logo":"https://mintcdn.com/dumplingai/ovQfojsBnkaBEyWP/dumplingai-logo.svg?fit=max\u0026auto=format\u0026n=ovQfojsBnkaBEyWP\u0026q=85\u0026s=46740c45e1bef65a42e4a799407a5d32","favicon":"https://mintcdn.com/dumplingai/ovQfojsBnkaBEyWP/dumplingai-logo.svg?fit=max\u0026auto=format\u0026n=ovQfojsBnkaBEyWP\u0026q=85\u0026s=46740c45e1bef65a42e4a799407a5d32","navbar":{"links":[{"href":"mailto:help@dumplingai.com","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.dumplingai.com"}},"footer":{"socials":{"twitter":"https://twitter.com/dumplingai","linkedin":"https://www.linkedin.com/company/dumplingai"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"dumplingai","hasAudioNarration":false,"actualSubdomain":"dumplingai","customDomains":["docs.dumplingai.com"],"gitSource":{"type":"github","owner":"dumplingai","repo":"dumplingai","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a21e638b8c65e77d6677ad4","collectionId":"71f4a9e0-7aae-4b61-a7a2-ec8cadaf8568","schemaVersion":"v2"},"entitlements":{},"buildId":"6a21e638b8c65e77d6677ad4:success","clientVersion":"0.0.3962","searchFilterCounts":[{"language":"default","tag":"API Reference","count":52},{"language":"default","tag":"Data APIs","count":23},{"language":"default","tag":"Documentation","count":14},{"language":"default","tag":"Document Processing","count":10},{"language":"default","tag":"Core Features","count":7},{"language":"default","tag":"Start Here","count":6},{"language":"default","tag":"Overview","count":5},{"language":"default","tag":"Web Scraping","count":4},{"language":"default","tag":"Usage APIs","count":3},{"language":"default","tag":"AI","count":2}]},"assistantConfig":{},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/endpoint/generate-agent-completion","slug":"/api-reference/endpoint/generate-agent-completion","pageMetadata":{"title":"Generate Agent Completion","openapi":"POST /api/v1/agents/generate-completion","description":"Generate a completion from a DumplingAI agent with streaming or sync support.","href":"/api-reference/endpoint/generate-agent-completion"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Generate a completion from a DumplingAI agent with streaming or sync support.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`description`,children:`Description`}),`\n`,_jsx(_components.p,{children:`This endpoint processes messages for a specific agent, generating a response using one of your AI agents. It can optionally maintain conversation history through threads.`}),`\n`,_jsx(Heading,{level:`2`,id:`endpoint`,children:`Endpoint`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST https://app.dumplingai.com/api/v1/agents/generate-completion`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Heading,{level:`2`,id:`headers`,children:`Headers`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Content-Type:`}),` `,_jsx(_components.code,{children:`application/json`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Authorization:`}),` Bearer `,_jsx(_components.code,{children:`\u003cAPI_KEY>`}),` (required)`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`request-body`,children:`Request Body`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"messages\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"role\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"agentId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"parseJson\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"boolean\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"threadId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`messages`}),`: An array of message objects, each containing:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`role`}),`: Either “user” or “assistant”`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`content`}),`: The content of the message`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`agentId`}),`: The unique identifier of the agent to use for processing`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`parseJson`}),`: Whether to try and parse the JSON in the response into a JSON object`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`threadId`}),`: (Optional) The ID of an existing thread to continue the conversation`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`responses`,children:`Responses`}),`\n`,_jsx(Heading,{level:`3`,id:`success-200-ok`,children:`Success (200 OK)`}),`\n`,_jsx(_components.p,{children:`Returns the generated response, usage information, and thread details.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`21`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"parsedJson\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"stepsTaken\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"number\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"steps\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"toolCalls\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"array\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"toolResults\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"array\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"finishReason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"object\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"tokenUsage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"promptTokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"number\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"completionTokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"number\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"totalTokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"number\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"creditUsage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"number\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"threadId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"string\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`error-responses`,children:`Error Responses`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`400 Bad Request`}),`: If the request is invalid`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`401 Unauthorized`}),`: If the API key is invalid or the user doesn’t have access to the specified agent`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`403 Forbidden`}),`: If the user doesn’t have enough credits`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`404 Not Found`}),`: If the specified agent or thread is not found`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`notes`,children:`Notes`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`This endpoint uses 10 credits per 1000 total tokens used.`}),`\n`,_jsx(_components.li,{children:`The agent must belong to the project owned by the authenticated user.`}),`\n`,_jsx(_components.li,{children:`If no threadId is provided, a new thread will be created automatically.`}),`\n`,_jsx(_components.li,{children:`Messages are stored in the thread for conversation history.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`rate-limiting`,children:`Rate Limiting`}),`\n`,_jsx(_components.p,{children:`Rate limiting is applied based on the user’s subscription.`}),`\n`,_jsx(Heading,{level:`2`,id:`example-request`,children:`Example Request`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://app.dumplingai.com/api/v1/agents/generate-completion`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-H `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Authorization: Bearer YOUR_API_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`-d `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages\": [`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"role\": \"user\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content\": \"Hello, can you help me with a task?\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"agentId\": \"agent_123456\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"parseJson\": false,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"threadId\": \"optional_thread_id\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}'`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`example-response`,children:`Example Response`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`25`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`25`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"parsedJson\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Certainly! I'd be happy to help you with a task. What kind of task do you need assistance with?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"stepsTaken\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"steps\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Certainly! I'd be happy to help you with a task. What kind of task do you need assistance with?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"toolCalls\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"toolResults\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"finishReason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"stop\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"usage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"promptTokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`20`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"completionTokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`15`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"totalTokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`35`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"tokenUsage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"promptTokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`20`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"completionTokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`15`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"totalTokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`35`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"creditUsage\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"threadId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"thread_123456\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Generate Agent Completion","openapi":"POST /api/v1/agents/generate-completion","description":"Generate a completion from a DumplingAI agent with streaming or sync support.","href":"/api-reference/endpoint/generate-agent-completion"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Description","slug":"description","depth":2,"children":[]},{"title":"Endpoint","slug":"endpoint","depth":2,"children":[]},{"title":"Headers","slug":"headers","depth":2,"children":[]},{"title":"Request Body","slug":"request-body","depth":2,"children":[]},{"title":"Responses","slug":"responses","depth":2,"children":[{"title":"Success (200 OK)","slug":"success-200-ok","depth":3,"children":[]},{"title":"Error Responses","slug":"error-responses","depth":3,"children":[]}]},{"title":"Notes","slug":"notes","depth":2,"children":[]},{"title":"Rate Limiting","slug":"rate-limiting","depth":2,"children":[]},{"title":"Example Request","slug":"example-request","depth":2,"children":[]},{"title":"Example Response","slug":"example-response","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/dumplingai/88b5ebac9e923e56/featurebase-messenger.js"],"openApiReferenceData":{"operation":{"tags":["AI"],"summary":"Generate agent completion","operationId":"generateAgentCompletion","description":"Generate a completion from a DumplingAI agent with streaming or sync support.","requestBody":"35c5e3a5-5e4d-46e0-9773-f8ba39739975","responses":{"200":"6fda1aa3-7585-4614-8714-9c367bf5aa8d","400":"1fd20780-27d0-4922-b189-9c64d25e0213","401":"e0f896eb-9829-4d7c-887f-2313829b0cc1","500":"35bbd999-766c-49a1-800c-d89d17003388"},"method":"post","type":"path","servers":["d723038e-161a-49c3-97eb-5fe7a380caa9"],"security":["5e873bfd-9277-42d8-b67f-596c2b666f90"],"path":"/api/v1/agents/generate-completion","baseUrlOptions":["https://app.dumplingai.com"],"title":"Generate agent completion","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Parameters required to request an agent completion.","required":["agentId","messages"],"properties":{"agentId":{"type":"string","description":"Identifier of the agent to run.","isRequired":true,"uniqueKey":"agentId","typeLabel":"string"},"messages":{"type":"array","description":"Ordered conversation history sent to the agent.","items":{"type":"object","description":"Message exchanged with an agent or language model.","required":["role","content"],"properties":{"role":{"type":"string","description":"Role of the message author.","enum":["system","user","assistant","tool"],"isRequired":true,"uniqueKey":"messages.items.[INDEX].role","typeLabel":"enum\u003cstring>"},"content":{"oneOf":[{"type":"string","description":"Message content. Accepts simple strings or structured message parts.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"object","required":["type"],"properties":{"type":{"type":"string","description":"Type of message part such as `text`, `image`, or `tool-call`.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].type","typeLabel":"string"},"text":{"type":"string","description":"Text content for `text` message parts.","uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].text","typeLabel":"string"},"data":{"type":"object","additionalProperties":true,"description":"Additional structured data associated with the part.","uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX].data","typeLabel":"object"}},"additionalProperties":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1.items.[INDEX]","typeLabel":"object"},"description":"Message content. Accepts simple strings or structured message parts.","isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.1","typeLabel":"object[]"},{"type":"object","description":"Message content. Accepts simple strings or structured message parts.","additionalProperties":true,"isRequired":true,"uniqueKey":"messages.items.[INDEX].content.oneOf.2","typeLabel":"object"}],"isRequired":true,"uniqueKey":"messages.items.[INDEX].content","typeLabel":"string | object[] | object"},"providerOptions":{"type":"object","additionalProperties":true,"description":"Provider-specific metadata passed through to the underlying language model.","uniqueKey":"messages.items.[INDEX].providerOptions","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"messages.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"messages","typeLabel":"object[]"},"threadId":{"type":"string","description":"Optional thread identifier for continuing a previous conversation.","uniqueKey":"threadId","typeLabel":"string"},"parseJson":{"type":"boolean","description":"When true, attempt to parse the final response as JSON.","uniqueKey":"parseJson","typeLabel":"boolean"},"requestSource":{"type":"string","description":"Optional identifier describing where the API request originated.","enum":["API","WEB","MAKE_DOT_COM","ZAPIER","N8N","PLAYGROUND","DEFAULT_AUTOMATION","AGENT_PREVIEW","AGENT_LIVE","AUTOPILOT","STUDIO"],"uniqueKey":"requestSource","typeLabel":"enum\u003cstring>"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"default":{"title":"default","value":{"agentId":"agnt_123","messages":[{"role":"user","content":"Summarize this article"}]}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"6fda1aa3-7585-4614-8714-9c367bf5aa8d":{"description":"Agent completion returned.","content":{"application/json":{"schema":{"type":"object","required":["text","stepsTaken","steps","tokenUsage","creditUsage","threadId"],"properties":{"text":{"type":"string","isRequired":true,"uniqueKey":"text","typeLabel":"string"},"stepsTaken":{"type":"integer","isRequired":true,"uniqueKey":"stepsTaken","typeLabel":"integer"},"steps":{"type":"array","items":{"type":"object","required":["finishReason","usage"],"properties":{"finishReason":{"type":"string","isRequired":true,"uniqueKey":"steps.items.[INDEX].finishReason","typeLabel":"string"},"usage":{"type":"object","required":["promptTokens","completionTokens","totalTokens"],"properties":{"promptTokens":{"type":"integer","isRequired":true,"uniqueKey":"steps.items.[INDEX].usage.promptTokens","typeLabel":"integer"},"completionTokens":{"type":"integer","isRequired":true,"uniqueKey":"steps.items.[INDEX].usage.completionTokens","typeLabel":"integer"},"totalTokens":{"type":"integer","isRequired":true,"uniqueKey":"steps.items.[INDEX].usage.totalTokens","typeLabel":"integer"}},"additionalProperties":false,"isRequired":true,"uniqueKey":"steps.items.[INDEX].usage","typeLabel":"object"},"text":{"oneOf":[{"type":"string","uniqueKey":"steps.items.[INDEX].text.oneOf.0","typeLabel":"string"},{"type":"null","uniqueKey":"steps.items.[INDEX].text.oneOf.1","typeLabel":"null"}],"uniqueKey":"steps.items.[INDEX].text","typeLabel":"string | null"},"toolCalls":{"oneOf":[{"type":"array","items":{"type":"object","required":["type","toolCallId","toolName"],"properties":{"type":{"type":"string","enum":["tool-call"],"isRequired":true,"uniqueKey":"steps.items.[INDEX].toolCalls.oneOf.0.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"toolCallId":{"type":"string","isRequired":true,"uniqueKey":"steps.items.[INDEX].toolCalls.oneOf.0.items.[INDEX].toolCallId","typeLabel":"string"},"toolName":{"type":"string","isRequired":true,"uniqueKey":"steps.items.[INDEX].toolCalls.oneOf.0.items.[INDEX].toolName","typeLabel":"string"},"args":{"type":"object","additionalProperties":true,"uniqueKey":"steps.items.[INDEX].toolCalls.oneOf.0.items.[INDEX].args","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"steps.items.[INDEX].toolCalls.oneOf.0.items.[INDEX]","typeLabel":"object"},"uniqueKey":"steps.items.[INDEX].toolCalls.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","required":["type","toolCallId","toolName"],"properties":{"type":{"type":"string","enum":["tool-call"]},"toolCallId":{"type":"string"},"toolName":{"type":"string"},"args":{"type":"object","additionalProperties":true}},"additionalProperties":false},"uniqueKey":"steps.items.[INDEX].toolCalls.oneOf.1","typeLabel":"null"}],"uniqueKey":"steps.items.[INDEX].toolCalls","typeLabel":"object[] | null"},"toolResults":{"oneOf":[{"type":"array","items":{"type":"object","required":["toolCallId","toolName"],"properties":{"toolCallId":{"type":"string","isRequired":true,"uniqueKey":"steps.items.[INDEX].toolResults.oneOf.0.items.[INDEX].toolCallId","typeLabel":"string"},"toolName":{"type":"string","isRequired":true,"uniqueKey":"steps.items.[INDEX].toolResults.oneOf.0.items.[INDEX].toolName","typeLabel":"string"},"result":{"type":"object","additionalProperties":true,"uniqueKey":"steps.items.[INDEX].toolResults.oneOf.0.items.[INDEX].result","typeLabel":"object"}},"additionalProperties":false,"uniqueKey":"steps.items.[INDEX].toolResults.oneOf.0.items.[INDEX]","typeLabel":"object"},"uniqueKey":"steps.items.[INDEX].toolResults.oneOf.0","typeLabel":"object[]"},{"type":"null","items":{"type":"object","required":["toolCallId","toolName"],"properties":{"toolCallId":{"type":"string"},"toolName":{"type":"string"},"result":{"type":"object","additionalProperties":true}},"additionalProperties":false},"uniqueKey":"steps.items.[INDEX].toolResults.oneOf.1","typeLabel":"null"}],"uniqueKey":"steps.items.[INDEX].toolResults","typeLabel":"object[] | null"}},"additionalProperties":false,"uniqueKey":"steps.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"steps","typeLabel":"object[]"},"tokenUsage":{"type":"object","required":["promptTokens","completionTokens","totalTokens"],"properties":{"promptTokens":{"type":"integer","isRequired":true,"uniqueKey":"tokenUsage.promptTokens","typeLabel":"integer"},"completionTokens":{"type":"integer","isRequired":true,"uniqueKey":"tokenUsage.completionTokens","typeLabel":"integer"},"totalTokens":{"type":"integer","isRequired":true,"uniqueKey":"tokenUsage.totalTokens","typeLabel":"integer"}},"additionalProperties":false,"isRequired":true,"uniqueKey":"tokenUsage","typeLabel":"object"},"creditUsage":{"type":"integer","isRequired":true,"uniqueKey":"creditUsage","typeLabel":"integer"},"threadId":{"type":"string","isRequired":true,"uniqueKey":"threadId","typeLabel":"string"},"parsedJson":{"oneOf":[{"type":"object","description":"Parsed JSON extracted from the final assistant text when `parseJson` is true.","additionalProperties":true,"uniqueKey":"parsedJson.oneOf.0","typeLabel":"object"},{"type":"array","items":{"oneOf":[{}],"uniqueKey":"parsedJson.oneOf.1.items.[INDEX]","typeLabel":"any"},"description":"Parsed JSON extracted from the final assistant text when `parseJson` is true.","uniqueKey":"parsedJson.oneOf.1","typeLabel":"any[]"}],"uniqueKey":"parsedJson","typeLabel":"object | any[]"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"text":"\u003cstring>","stepsTaken":123,"steps":[{"finishReason":"\u003cstring>","usage":{"promptTokens":123,"completionTokens":123,"totalTokens":123},"text":"\u003cstring>","toolCalls":[{"type":"tool-call","toolCallId":"\u003cstring>","toolName":"\u003cstring>","args":{}}],"toolResults":[{"toolCallId":"\u003cstring>","toolName":"\u003cstring>","result":{}}]}],"tokenUsage":{"promptTokens":123,"completionTokens":123,"totalTokens":123},"creditUsage":123,"threadId":"\u003cstring>","parsedJson":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"1fd20780-27d0-4922-b189-9c64d25e0213":{"description":"Invalid request payload.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human-readable description of what went wrong.","isRequired":true,"uniqueKey":"error","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"e0f896eb-9829-4d7c-887f-2313829b0cc1":{"description":"Missing or invalid API key.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"35bbd999-766c-49a1-800c-d89d17003388":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Human-readable description of what went wrong.","isRequired":true,"uniqueKey":"error","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"5e873bfd-9277-42d8-b67f-596c2b666f90":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","scopes":[]}}},"servers":{"d723038e-161a-49c3-97eb-5fe7a380caa9":{"url":"https://app.dumplingai.com","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"API Key","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/openapi-v1.yaml"},"subdomain":"dumplingai","siteName":"DumplingAI Docs","title":"Generate Agent Completion - DumplingAI Docs","navMaps":{"firstHrefInVersion":{"v2":{"href":"/documentation/v2/get-started","matchLevel":4},"v1":{"href":"/api-reference/endpoint/generate-agent-completion","matchLevel":0}},"firstHrefInLanguage":{}},"lastModified":"2025-11-21T00:07:09.466Z","originalFileLocation":"api-reference/endpoint/generate-agent-completion.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Generate a completion from a DumplingAI agent with streaming or sync support.\">\u003cmeta data-mint-head name=\"application-name\" content=\"DumplingAI Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dumplingai/i_giEhVPqadP-y2_/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/dumplingai/i_giEhVPqadP-y2_/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dumplingai/i_giEhVPqadP-y2_/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dumplingai/i_giEhVPqadP-y2_/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dumplingai/i_giEhVPqadP-y2_/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dumplingai/i_giEhVPqadP-y2_/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dumplingai/i_giEhVPqadP-y2_/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dumplingai/i_giEhVPqadP-y2_/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dumplingai/i_giEhVPqadP-y2_/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Generate Agent Completion - DumplingAI Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Generate a completion from a DumplingAI agent with streaming or sync support.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"DumplingAI Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.dumplingai.com/api-reference/endpoint/generate-agent-completion\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://dumplingai.mintlify.app/_mintlify/api/og/v2?division=AI\u0026amp;title=Generate+Agent+Completion\u0026amp;description=Generate+a+completion+from+a+DumplingAI+agent+with+streaming+or+sync+support.\u0026amp;theme=f6d65ea4c1e9445145f9cff7\u0026amp;signature=519ccdace2a6e0e970352e44c04bd6fbf95132baf799f9ce7ec2573026fef368\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Generate Agent Completion - DumplingAI Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Generate a completion from a DumplingAI agent with streaming or sync support.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://dumplingai.mintlify.app/_mintlify/api/og/v2?division=AI\u0026amp;title=Generate+Agent+Completion\u0026amp;description=Generate+a+completion+from+a+DumplingAI+agent+with+streaming+or+sync+support.\u0026amp;theme=f6d65ea4c1e9445145f9cff7\u0026amp;signature=519ccdace2a6e0e970352e44c04bd6fbf95132baf799f9ce7ec2573026fef368\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/dumplingai/i_giEhVPqadP-y2_/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"DumplingAI Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#000\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.dumplingai.com/api-reference/endpoint/generate-agent-completion\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoint/generate-agent-completion.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.dumplingai.com/#organization\",\"name\":\"DumplingAI Docs\",\"url\":\"https://docs.dumplingai.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/dumplingai/ovQfojsBnkaBEyWP/dumplingai-logo.svg?fit=max\u0026auto=format\u0026n=ovQfojsBnkaBEyWP\u0026q=85\u0026s=46740c45e1bef65a42e4a799407a5d32\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.dumplingai.com#website\",\"name\":\"DumplingAI Docs\",\"url\":\"https://docs.dumplingai.com\",\"publisher\":{\"@id\":\"https://docs.dumplingai.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.dumplingai.com/api-reference/endpoint/generate-agent-completion#webpage\",\"url\":\"https://docs.dumplingai.com/api-reference/endpoint/generate-agent-completion\",\"name\":\"Generate Agent Completion\",\"description\":\"Generate a completion from a DumplingAI agent with streaming or sync support.\",\"dateModified\":\"2025-11-21T00:07:09.466Z\",\"isPartOf\":{\"@id\":\"https://docs.dumplingai.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.dumplingai.com/api-reference/endpoint/generate-agent-completion#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.dumplingai.com/api-reference/endpoint/generate-agent-completion#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"DumplingAI Docs\",\"item\":\"https://docs.dumplingai.com\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Generate Agent Completion\",\"item\":\"https://docs.dumplingai.com/api-reference/endpoint/generate-agent-completion\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.dumplingai.com/api-reference/endpoint/generate-agent-completion#apireference\",\"headline\":\"Generate Agent Completion\",\"name\":\"Generate Agent Completion\",\"description\":\"Generate a completion from a DumplingAI agent with streaming or sync support.\",\"url\":\"https://docs.dumplingai.com/api-reference/endpoint/generate-agent-completion\",\"mainEntityOfPage\":{\"@id\":\"https://docs.dumplingai.com/api-reference/endpoint/generate-agent-completion#webpage\"},\"dateModified\":\"2025-11-21T00:07:09.466Z\",\"publisher\":{\"@id\":\"https://docs.dumplingai.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.dumplingai.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"DumplingAI Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"DumplingAI Docs","nav":{"global":null,"versions":[{"version":"v2","pages":[{"title":"v2","href":"/documentation/v2/get-started"}]},{"version":"v1","tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/documentation/v1/get-started"}]},{"tab":"API Reference","groups":[{"group":"Overview","pages":[{"title":"API Reference","href":"/api-reference/v1/introduction"},{"title":"Credit Costs","href":"/api-reference/credit-costs"}]},{"group":"Data APIs","pages":[{"title":"Get YouTube Transcript","openapi":"POST /api/v1/get-youtube-transcript","href":"/api-reference/endpoint/get-youtube-transcript"},{"title":"Get YouTube Video","openapi":"POST /api/v1/youtube/video","href":"/api-reference/endpoint/get-youtube-video"},{"title":"Get YouTube Video Comments","openapi":"POST /api/v1/youtube/video/comments","href":"/api-reference/endpoint/get-youtube-video-comments"},{"title":"Get YouTube Channel","openapi":"POST /api/v1/youtube/channel","href":"/api-reference/endpoint/get-youtube-channel"},{"title":"Get YouTube Channel Videos","openapi":"POST /api/v1/youtube/channel-videos","href":"/api-reference/endpoint/get-youtube-channel-videos"},{"title":"Get YouTube Channel Shorts","openapi":"POST /api/v1/youtube/channel/shorts","href":"/api-reference/endpoint/get-youtube-channel-shorts"},{"title":"YouTube Search","openapi":"POST /api/v1/youtube/search","href":"/api-reference/endpoint/search-youtube"},{"title":"Get TikTok Transcript","openapi":"POST /api/v1/get-tiktok-transcript","href":"/api-reference/endpoint/get-tiktok-transcript"},{"title":"Get TikTok Video","openapi":"POST /api/v1/get-tiktok-video","href":"/api-reference/endpoint/get-tiktok-video"},{"title":"Get TikTok Video Comments","openapi":"POST /api/v1/get-tiktok-video-comments","href":"/api-reference/endpoint/get-tiktok-video-comments"},{"title":"Get TikTok Profile","openapi":"POST /api/v1/get-tiktok-profile","href":"/api-reference/endpoint/get-tiktok-profile"},{"title":"Get TikTok Profile Videos","openapi":"POST /api/v1/get-tiktok-profile-videos","href":"/api-reference/endpoint/get-tiktok-profile-videos"},{"title":"Get TikTok User Followers","openapi":"POST /api/v1/get-tiktok-user-followers","href":"/api-reference/endpoint/get-tiktok-user-followers"},{"title":"Get TikTok User Following","openapi":"POST /api/v1/get-tiktok-user-following","href":"/api-reference/endpoint/get-tiktok-user-following"},{"title":"Search TikTok Users","openapi":"POST /api/v1/search-tiktok-users","href":"/api-reference/endpoint/search-tiktok-users"},{"title":"Get LinkedIn Profile","openapi":"POST /api/v1/linkedin/profile","href":"/api-reference/endpoint/get-linkedin-profile"},{"title":"Get LinkedIn Company","openapi":"POST /api/v1/linkedin/company","href":"/api-reference/endpoint/get-linkedin-company"},{"title":"Search","openapi":"POST /api/v1/search","href":"/api-reference/endpoint/search"},{"title":"Search News","openapi":"POST /api/v1/search-news","href":"/api-reference/endpoint/search-news"},{"title":"Search Maps","openapi":"POST /api/v1/search-maps","href":"/api-reference/endpoint/search-maps"},{"title":"Search Places","openapi":"POST /api/v1/search-places","href":"/api-reference/endpoint/search-places"},{"title":"Get Autocomplete","openapi":"POST /api/v1/get-autocomplete","href":"/api-reference/endpoint/get-autocomplete"},{"title":"Get Google Reviews","openapi":"POST /api/v1/get-google-reviews","href":"/api-reference/endpoint/get-google-reviews"}]},{"group":"Web Scraping","pages":[{"title":"Scrape","openapi":"POST /api/v1/scrape","href":"/api-reference/endpoint/scrape"},{"title":"Crawl Website","openapi":"POST /api/v1/crawl","href":"/api-reference/endpoint/crawl"},{"title":"Screenshot","openapi":"POST /api/v1/screenshot","href":"/api-reference/endpoint/screenshot"},{"title":"Extract","openapi":"POST /api/v1/extract","href":"/api-reference/endpoint/extract"}]},{"group":"Document Processing","pages":[{"title":"Doc to Text","openapi":"POST /api/v1/doc-to-text","href":"/api-reference/endpoint/doc-to-text"},{"title":"Convert to PDF","openapi":"POST /api/v1/convert-to-pdf","href":"/api-reference/endpoint/convert-to-pdf"},{"title":"Merge PDFs","openapi":"POST /api/v1/merge-pdfs","href":"/api-reference/endpoint/merge-pdfs"},{"title":"Read PDF Metadata","openapi":"POST /api/v1/read-pdf-metadata","href":"/api-reference/endpoint/read-pdf-metadata"},{"title":"Write PDF Metadata","openapi":"POST /api/v1/write-pdf-metadata","href":"/api-reference/endpoint/write-pdf-metadata"},{"title":"Extract Document","openapi":"POST /api/v1/extract-document","href":"/api-reference/endpoint/extract-document"},{"title":"Extract Image","openapi":"POST /api/v1/extract-image","href":"/api-reference/endpoint/extract-image"},{"title":"Extract Audio","openapi":"POST /api/v1/extract-audio","href":"/api-reference/endpoint/extract-audio"},{"title":"Extract Video","openapi":"POST /api/v1/extract-video","href":"/api-reference/endpoint/extract-video"},{"title":"Trim Video","openapi":"POST /api/v1/trim-video","description":"Trim a video to a specific start and end time and return the resulting asset.","href":"/api-reference/endpoint/trim-video"}]},{"group":"AI","pages":[{"title":"Generate Agent Completion","openapi":"POST /api/v1/agents/generate-completion","href":"/api-reference/endpoint/generate-agent-completion"},{"title":"Generate AI Image","openapi":"POST /api/v1/generate-ai-image","description":"Generate an AI image using DumplingAI's image generation providers.","href":"/api-reference/endpoint/generate-ai-image"}]},{"group":"Developer Tools","pages":[{"title":"Run JavaScript Code","openapi":"POST /api/v1/run-js-code","href":"/api-reference/endpoint/run-js-code"},{"title":"Run Python Code","openapi":"POST /api/v1/run-python-code","href":"/api-reference/endpoint/run-python-code"}]}]}]}]},"title":"Generate Agent Completion - DumplingAI Docs","buildId":"dpl_7EGD3AHhNmnVNgQ8U7beMHiqTzw8","deploymentId":"dpl_7EGD3AHhNmnVNgQ8U7beMHiqTzw8","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-BD4fwK3P.js","utils-DEvhfoIn.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-Bbxkx6RX.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-CXCpkzYi.js","snippetPresets-C1KobSGD.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CbXPTquJ.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CDxejPjz.js","shallow-CKF2GM14.js","getApiPlaygroundDisplay-irpiNmfQ.js","CodeSnippet-CMmU-qdX.js","CodeSnippets-X0z6bNcm.js","Page-DzZeX12I.js","getPastedJson-owIG6uLE.js","icon-CJ0Id64A.js","MethodPill-CTSdHD-F.js","DuplicateIcon-OhvNP1l6.js","createIcon-Dn3UVmnj.js","DynamicMarkdown-D0HL0Gbr.js","SectionHeading-Cr9OIW6W.js","axios-vUo_bRtp.js","Markdown-B5KRcbdD.js","clsx-sjO-6dpI.js","lib--scc4DXi.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CmpPxlnF.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-OSEgb-y8.js"]}