{ "created": 1721722200, "data": [ { "b64_json": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==", "revised_prompt": "A coastal lighthouse at dusk, warm lantern light." } ]}
{
"message": "The image generation request was blocked by the content filter of the Image Model."
}
Generate one standard image with POST /openai/{region}/v1/images/generations. Send a prompt and an image model from your workspace. The response returns the image as b64_json.The request uses the same Completion API scope as OpenAI Chat Completions and OpenAI Responses. Chat tools, workflow nodes, and Agent API imageGeneration are separate surfaces.
The request body is a strict object. Extra fields return 400.
Parameter
Description
model
Required. The image generation model ID from your workspace. Visible image models in the request region with an API-available deployment are accepted. GET /openai/{region}/v1/models lists chat models, not image models. An unknown model returns 400 with the image model IDs available in that region. If the region has none, the 400 says so.
prompt
Required. The image description.
n
Optional. Must be 1 if you send it.
size
Optional. auto (default), 1024x1024, 1536x1024, or 1024x1536. auto and 1024x1024 map to square, 1536x1024 to landscape, and 1024x1536 to portrait.
quality
Optional. auto, low, medium, or high. Langdock forwards the value to the image model. Not every image model uses it.
A successful response is JSON with created and data. data contains one object with b64_json and, when the model returns one, revised_prompt. The HTTP body has no usage object. The ld-model-id response header repeats the model ID.Generation times out after 60 seconds. A timeout returns 504 with The model did not respond in time. Please retry.If Langdock detects that the image model refused the prompt on safety grounds, the request returns 400 with The image generation request was blocked by the content filter of the Image Model. Refused requests are not billed. Unclassified provider failures return 500.
The default limits are 500 RPM (requests per minute) and 150,000 TPM (tokens per minute).
RPM is enforced per workspace, model, and API key.
TPM is shared by all API keys using the same model in a workspace.
On Langdock Cloud, admins can set TPM for custom models in Settings > Workspace > Products > API; it caps the estimated size of a single request.
On dedicated deployments, admins can configure custom limits per model in Settings > Workspace > Products > API.
A rate-limited request returns 429 Too Many Requests. Successful and rate-limited responses include x-ratelimit-limit-requests, x-ratelimit-limit-tokens, x-ratelimit-remaining-requests, and x-ratelimit-remaining-tokens.Personal API key usage counts toward the member’s effective personal budget and the workspace spend limit together with chat and agent usage. Workspace API key usage counts toward the workspace API spend limit. Image generation calls are billed as image generation usage. See Personal API keys and Pricing.
Browser and CORS integrations are not supported. Keep API keys server-side and call the endpoint from a server, CLI, or local development tool. See API Key Best Practices.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Docs","colors":{"primary":"#4469FC","light":"#ECF0FF","dark":"#0D001D"},"logo":{"light":"https://mintcdn.com/langdock-34/URgvNwU7CYGZq8R7/logo/light.svg?fit=max\u0026auto=format\u0026n=URgvNwU7CYGZq8R7\u0026q=85\u0026s=594b4bd597e2629fb1a7dccfae6aa1c4","dark":"https://mintcdn.com/langdock-34/URgvNwU7CYGZq8R7/logo/dark.svg?fit=max\u0026auto=format\u0026n=URgvNwU7CYGZq8R7\u0026q=85\u0026s=d063d52fb4d331afb82adad972214673"},"favicon":"https://mintcdn.com/langdock-34/KbxhVmfYOcTup72x/favicon.png?fit=max\u0026auto=format\u0026n=KbxhVmfYOcTup72x\u0026q=85\u0026s=e12cd6cccfe5c94bf4ae6ea4fba7959c","background":{"color":{"dark":"#090014"}},"navbar":{"primary":{"type":"button","label":"Back to app","href":"https://app.langdock.com"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/langdock"}},"errors":{"404":{"redirect":true}},"contextual":{"options":["copy","view","mcp","cursor","vscode",{"title":"Ask Langdock","description":"Ask Langdock about the current page","icon":"/favicon.png","href":{"base":"https://app.langdock.com/chat","query":[{"key":"q","value":"Read from https://docs.langdock.com$path.md so I can ask questions about it."},{"key":"sendPrompt","value":"true"}]}}],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Changelog","icon":"newspaper","href":"https://www.langdock.com/changelog"},{"anchor":"Status","icon":"signal-bars","href":"https://status.langdock.com/"},{"anchor":"Support","icon":"messages-question","href":"https://www.langdock.com/contact-us"}]},"languages":[{"language":"en","default":true,"href":"en/using-langdock/get-started/introduction"},{"language":"de","href":"de/using-langdock/get-started/introduction"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"langdock-34","hasAudioNarration":false,"actualSubdomain":"langdock-34","customDomains":["docs.langdock.com"],"gitSource":{"type":"github","owner":"langdock","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adfd228240c0930d91e3e9f","collectionId":"ad3521d8-b904-4c28-989d-32ad28071539","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adfd228240c0930d91e3e9f"},"feedback":{"thumbs":true,"agentFeedback":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"DISABLED"},"CONTEXTUAL_FEEDBACK":{"status":"DISABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"DISABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6adfd228240c0930d91e3e9f","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"en","tag":"Using Langdock","count":133},{"language":"de","tag":"Langdock nutzen","count":133},{"language":"en","tag":"Admin","count":100},{"language":"de","tag":"Admin","count":100},{"language":"en","tag":"Developer","count":99},{"language":"de","tag":"Entwickler","count":99},{"language":"en","tag":"Manage Integrations","count":43},{"language":"de","tag":"Integrationen verwalten","count":43},{"language":"en","tag":"Guides","count":40},{"language":"de","tag":"Anleitungen","count":40},{"language":"en","tag":"Workflows","count":28},{"language":"de","tag":"Workflows","count":28},{"language":"en","tag":"Integrations","count":19},{"language":"de","tag":"Integrationen","count":19},{"language":"en","tag":"Node Types","count":18},{"language":"de","tag":"Node Types","count":18},{"language":"en","tag":"Integration Setup Guides","count":17},{"language":"de","tag":"Integrations-Setup-Anleitungen","count":17},{"language":"en","tag":"Microsoft Integration Scopes","count":16},{"language":"de","tag":"Microsoft Integration Scopes","count":16}]},"assistantConfig":{"deflection":{"enabled":false}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"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":"workos-sso-scim","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},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"en/developer/completion-api/openai-images","slug":"/en/developer/completion-api/openai-images","pageMetadata":{"title":"OpenAI Image Generations","description":"Generate one standard image as base64 with a Completion API key.","openapi":"POST /openai/{region}/v1/images/generations","keywords":["api","openai","images","generations","b64_json","image generation"],"href":"/en/developer/completion-api/openai-images"},"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 one standard image as base64 with a Completion API key.\"\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={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Info,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Generate one standard image with `,_jsx(_components.code,{children:`POST /openai/{region}/v1/images/generations`}),`. Send a prompt and an image model from your workspace. The response returns the image as `,_jsx(_components.code,{children:`b64_json`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`The request uses the same Completion API scope as `,_jsx(_components.a,{href:`/en/developer/completion-api/openai`,children:`OpenAI Chat Completions`}),` and `,_jsx(_components.a,{href:`/en/developer/completion-api/openai-responses`,children:`OpenAI Responses`}),`. Chat tools, workflow nodes, and Agent API `,_jsx(_components.code,{children:`imageGeneration`}),` are separate surfaces.`]}),`\n`,_jsx(Heading,{level:`2`,id:`before-you-start`,children:`Before You Start`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`API key`}),`: Create a `,_jsx(_components.a,{href:`/en/using-langdock/account/personal-api-keys`,children:`personal API key`}),` or ask your workspace admin for a workspace API key with the Completion API scope.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`base-url`,children:`Base URL`}),`\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:`https://api.langdock.com/openai/{region}/v1/images/generations`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(Warning,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Dedicated deployments`})}),_jsxs(_components.p,{children:[`Replace `,_jsx(_components.code,{children:`api.langdock.com`}),` with `,_jsx(_components.code,{children:`\u003cyour-deployment-url>/api/public`}),` in all requests.`]})]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`{region}`}),` path value must be `,_jsx(_components.code,{children:`eu`}),` or `,_jsx(_components.code,{children:`us`}),`. This route does not accept `,_jsx(_components.code,{children:`global`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`parameters`,children:`Parameters`}),`\n`,_jsxs(_components.p,{children:[`The request body is a strict object. Extra fields return `,_jsx(_components.code,{children:`400`}),`.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Parameter`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`model`})}),_jsxs(_components.td,{children:[`Required. The image generation model ID from your workspace. Visible image models in the request region with an API-available deployment are accepted. `,_jsx(_components.code,{children:`GET /openai/{region}/v1/models`}),` lists chat models, not image models. An unknown model returns `,_jsx(_components.code,{children:`400`}),` with the image model IDs available in that region. If the region has none, the `,_jsx(_components.code,{children:`400`}),` says so.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`prompt`})}),_jsx(_components.td,{children:`Required. The image description.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`n`})}),_jsxs(_components.td,{children:[`Optional. Must be `,_jsx(_components.code,{children:`1`}),` if you send it.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`size`})}),_jsxs(_components.td,{children:[`Optional. `,_jsx(_components.code,{children:`auto`}),` (default), `,_jsx(_components.code,{children:`1024x1024`}),`, `,_jsx(_components.code,{children:`1536x1024`}),`, or `,_jsx(_components.code,{children:`1024x1536`}),`. `,_jsx(_components.code,{children:`auto`}),` and `,_jsx(_components.code,{children:`1024x1024`}),` map to square, `,_jsx(_components.code,{children:`1536x1024`}),` to landscape, and `,_jsx(_components.code,{children:`1024x1536`}),` to portrait.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`quality`})}),_jsxs(_components.td,{children:[`Optional. `,_jsx(_components.code,{children:`auto`}),`, `,_jsx(_components.code,{children:`low`}),`, `,_jsx(_components.code,{children:`medium`}),`, or `,_jsx(_components.code,{children:`high`}),`. Langdock forwards the value to the image model. Not every image model uses it.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`response_format`})}),_jsxs(_components.td,{children:[`Optional. `,_jsx(_components.code,{children:`b64_json`}),` only.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`user`})}),_jsx(_components.td,{children:`Optional. Accepted for OpenAI compatibility.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`A successful response is JSON with `,_jsx(_components.code,{children:`created`}),` and `,_jsx(_components.code,{children:`data`}),`. `,_jsx(_components.code,{children:`data`}),` contains one object with `,_jsx(_components.code,{children:`b64_json`}),` and, when the model returns one, `,_jsx(_components.code,{children:`revised_prompt`}),`. The HTTP body has no `,_jsx(_components.code,{children:`usage`}),` object. The `,_jsx(_components.code,{children:`ld-model-id`}),` response header repeats the model ID.`]}),`\n`,_jsxs(_components.p,{children:[`Generation times out after 60 seconds. A timeout returns `,_jsx(_components.code,{children:`504`}),` with `,_jsx(_components.code,{children:`The model did not respond in time. Please retry.`})]}),`\n`,_jsxs(_components.p,{children:[`If Langdock detects that the image model refused the prompt on safety grounds, the request returns `,_jsx(_components.code,{children:`400`}),` with `,_jsx(_components.code,{children:`The image generation request was blocked by the content filter of the Image Model.`}),` Refused requests are not billed. Unclassified provider failures return `,_jsx(_components.code,{children:`500`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`differences-from-the-openai-api`,children:`Differences from the OpenAI API`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`One image per request. `,_jsx(_components.code,{children:`n`}),` other than `,_jsx(_components.code,{children:`1`}),` is rejected.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`response_format`}),` is `,_jsx(_components.code,{children:`b64_json`}),` only. URL output is not supported.`]}),`\n`,_jsx(_components.li,{children:`HD / high-resolution generation is not supported.`}),`\n`,_jsxs(_components.li,{children:[`There is no public `,_jsx(_components.code,{children:`/v1/images/edits`}),` route.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`using-the-openai-python-library`,children:`Using the OpenAI Python library`}),`\n`,_jsxs(_components.p,{children:[`Set Langdock as the base URL and call `,_jsx(_components.code,{children:`images.generate`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`python`,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:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.langdock.com/openai/eu/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cYOUR_LANGDOCK_API_KEY>\"`}),_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`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`image `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.images.generate(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` model`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"your-image-model-id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` prompt`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"A lighthouse at dusk\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` size`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1024x1024\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` response_format`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"b64_json\"`}),_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`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(image.data[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`].b64_json)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`rate-limits`,children:`Rate limits`}),`\n`,_jsxs(_components.p,{children:[`The default limits are `,_jsx(_components.strong,{children:`500 RPM`}),` (requests per minute) and `,_jsx(_components.strong,{children:`150,000 TPM`}),` (tokens per minute).`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`RPM is enforced per workspace, model, and API key.`}),`\n`,_jsx(_components.li,{children:`TPM is shared by all API keys using the same model in a workspace.`}),`\n`,_jsxs(_components.li,{children:[`On Langdock Cloud, admins can set TPM for custom models in `,_jsx(_components.strong,{children:`Settings > Workspace > Products > API`}),`; it caps the estimated size of a single request.`]}),`\n`,_jsxs(_components.li,{children:[`On dedicated deployments, admins can configure custom limits per model in `,_jsx(_components.strong,{children:`Settings > Workspace > Products > API`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`A rate-limited request returns `,_jsx(_components.code,{children:`429 Too Many Requests`}),`. Successful and rate-limited responses include `,_jsx(_components.code,{children:`x-ratelimit-limit-requests`}),`, `,_jsx(_components.code,{children:`x-ratelimit-limit-tokens`}),`, `,_jsx(_components.code,{children:`x-ratelimit-remaining-requests`}),`, and `,_jsx(_components.code,{children:`x-ratelimit-remaining-tokens`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Personal API key usage counts toward the member’s effective personal budget and the workspace spend limit together with chat and agent usage. Workspace API key usage counts toward the workspace API spend limit. Image generation calls are billed as image generation usage. See `,_jsx(_components.a,{href:`/en/using-langdock/account/personal-api-keys`,children:`Personal API keys`}),` and `,_jsx(_components.a,{href:`/en/admin/billing/pricing#api`,children:`Pricing`}),`.`]}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`Browser and CORS integrations are not supported. Keep API keys server-side and call the endpoint from a server, CLI, or local development tool. See `,_jsx(_components.a,{href:`/en/admin/ai-adoption-and-rollout/best-practices/api-key-best-practices`,children:`API Key Best Practices`}),`.`]})})]})}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":"OpenAI Image Generations","description":"Generate one standard image as base64 with a Completion API key.","openapi":"POST /openai/{region}/v1/images/generations","keywords":["api","openai","images","generations","b64_json","image generation"],"href":"/en/developer/completion-api/openai-images"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Before You Start","slug":"before-you-start","depth":2,"children":[]},{"title":"Base URL","slug":"base-url","depth":2,"children":[]},{"title":"Parameters","slug":"parameters","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Differences from the OpenAI API","slug":"differences-from-the-openai-api","depth":2,"children":[]},{"title":"Using the OpenAI Python library","slug":"using-the-openai-python-library","depth":2,"children":[]},{"title":"Rate limits","slug":"rate-limits","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Images"],"summary":"Generates one standard image as base64.","description":"Generate one standard image as base64 with a Completion API key.","operationId":"createImage","parameters":["5a1847a5-b631-4ed1-a146-187d2d1d066f"],"requestBody":"573bca6c-e130-458f-94c8-194bd9d0ddef","responses":{"200":"92cb3343-9fc2-4903-a8d6-c969cbd51017","400":"c45fa80b-3338-4c4a-a1db-f773f95ffec9","401":"be26f7b4-7c5f-44d5-95e7-673f776452a5","403":"60e54035-900d-47b9-b078-a39af9a5eb5d","429":"4fcafcc9-8bc9-43b4-b0c9-f44c0f604982","500":"a3506eab-5ea5-49f6-9809-816458d382cc","504":"36706533-f750-4389-b2a5-f4ebfe31a09b"},"security":["64302acc-c8ba-4a7b-96a9-0365d7fef7b4"],"method":"post","type":"path","servers":["08bc2233-6b47-42b9-90bf-06abe264f1cc"],"path":"/openai/{region}/v1/images/generations","baseUrlOptions":["https://api.langdock.com"],"title":"Generates one standard image as base64.","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"5a1847a5-b631-4ed1-a146-187d2d1d066f":{"name":"region","in":"path","required":true,"description":"The region of the API to use. Must be eu or us.","schema":{"type":"string","enum":["eu","us"],"default":"eu","isRequired":true,"description":"The region of the API to use. Must be eu or us.","uniqueKey":"","typeLabel":"enum\u003cstring>"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["model","prompt"],"properties":{"model":{"type":"string","minLength":1,"description":"Image generation model ID from your workspace. GET /openai/{region}/v1/models lists chat models, not image models.","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"prompt":{"type":"string","minLength":1,"description":"The image description.","isRequired":true,"uniqueKey":"prompt","typeLabel":"string"},"n":{"type":"integer","enum":[1],"description":"Number of images. Only 1 is supported.","uniqueKey":"n","typeLabel":"enum\u003cinteger>"},"size":{"type":"string","enum":["auto","1024x1024","1536x1024","1024x1536"],"default":"auto","description":"Output size. auto and 1024x1024 map to square, 1536x1024 to landscape, and 1024x1536 to portrait.","uniqueKey":"size","typeLabel":"enum\u003cstring>"},"quality":{"type":"string","enum":["auto","low","medium","high"],"description":"Quality hint forwarded to the image model. Not every image model uses it.","uniqueKey":"quality","typeLabel":"enum\u003cstring>"},"response_format":{"type":"string","enum":["b64_json"],"description":"Response format. Only b64_json is supported.","uniqueKey":"response_format","typeLabel":"enum\u003cstring>"},"user":{"type":"string","description":"Optional end-user identifier. Accepted for OpenAI compatibility.","uniqueKey":"user","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"example":{"model":"your-image-model-id","prompt":"A lighthouse at dusk","n":1,"size":"1024x1024","response_format":"b64_json"},"examples":{"Example":{"title":"Example","value":{"model":"your-image-model-id","prompt":"A lighthouse at dusk","n":1,"size":"1024x1024","response_format":"b64_json"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"92cb3343-9fc2-4903-a8d6-c969cbd51017":{"description":"OK","headers":{"ld-model-id":{"description":"The image model ID used for the request.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["created","data"],"properties":{"created":{"type":"integer","description":"Unix timestamp in seconds.","isRequired":true,"uniqueKey":"created","typeLabel":"integer"},"data":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"object","required":["b64_json"],"properties":{"b64_json":{"type":"string","description":"Base64-encoded image.","isRequired":true,"uniqueKey":"data.items.[INDEX].b64_json","typeLabel":"string"},"revised_prompt":{"type":"string","description":"Revised prompt when the model returns one.","uniqueKey":"data.items.[INDEX].revised_prompt","typeLabel":"string"}},"uniqueKey":"data.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"data","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"created":1721722200,"data":[{"b64_json":"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==","revised_prompt":"A coastal lighthouse at dusk, warm lantern light."}]},"examples":{"Example":{"title":"Example","value":{"created":1721722200,"data":[{"b64_json":"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==","revised_prompt":"A coastal lighthouse at dusk, warm lantern light."}]}}},"exampleType":"examples"}},"exampleType":"examples"},"c45fa80b-3338-4c4a-a1db-f773f95ffec9":{"description":"Invalid fields, an unavailable image model, no image models in the region, or a detected safety refusal by the image model. Refused requests are not billed.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"description":"Error message. Validation errors return a list of issues instead of a string.","uniqueKey":"message","typeLabel":"any"}},"uniqueKey":"","typeLabel":"object"},"example":{"message":"The image generation request was blocked by the content filter of the Image Model."},"examples":{"Example":{"title":"Example","value":{"message":"The image generation request was blocked by the content filter of the Image Model."}}},"exampleType":"examples"}},"exampleType":"examples"},"be26f7b4-7c5f-44d5-95e7-673f776452a5":{"description":"Missing, invalid, or expired API key.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"60e54035-900d-47b9-b078-a39af9a5eb5d":{"description":"API key without the Completion API scope.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"4fcafcc9-8bc9-43b4-b0c9-f44c0f604982":{"description":"Usage or rate limit exceeded.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"a3506eab-5ea5-49f6-9809-816458d382cc":{"description":"Internal server or upstream provider error.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"36706533-f750-4389-b2a5-f4ebfe31a09b":{"description":"The model did not respond in time. Please retry.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"64302acc-c8ba-4a7b-96a9-0365d7fef7b4":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API key as Bearer token. Format \"Bearer YOUR_API_KEY\"","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"08bc2233-6b47-42b9-90bf-06abe264f1cc":{"url":"https://api.langdock.com","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API key as Bearer token. Format \"Bearer YOUR_API_KEY\"","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"API key as Bearer token. Format \"Bearer YOUR_API_KEY\"","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"openapi.yaml"},"subdomain":"langdock-34","siteName":"Docs","title":"OpenAI Image Generations - Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/en/developer/completion-api/openai-images","matchLevel":0},"de":{"href":"/de/developer/completion-api/openai-images","matchLevel":1}}},"lastModified":"2026-10-26T17:48:51.213Z","originalFileLocation":"en/developer/completion-api/openai-images.mdx","locale":"en"},"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 one standard image as base64 with a Completion API key.\">\u003cmeta data-mint-head name=\"application-name\" content=\"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/langdock-34/8EMNQyrrZlRONhj1/_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/langdock-34/8EMNQyrrZlRONhj1/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/langdock-34/8EMNQyrrZlRONhj1/_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/langdock-34/8EMNQyrrZlRONhj1/_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/langdock-34/8EMNQyrrZlRONhj1/_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/langdock-34/8EMNQyrrZlRONhj1/_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/langdock-34/8EMNQyrrZlRONhj1/_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/langdock-34/8EMNQyrrZlRONhj1/_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/langdock-34/8EMNQyrrZlRONhj1/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"OpenAI Image Generations - Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Generate one standard image as base64 with a Completion API key.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.langdock.com/en/developer/completion-api/openai-images\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://langdock-34.mintlify.app/_mintlify/api/og/v2?division=Completion+API\u0026amp;title=OpenAI+Image+Generations\u0026amp;description=Generate+one+standard+image+as+base64+with+a+Completion+API+key.\u0026amp;theme=af251cb8027ba7e8fe3cc77e\u0026amp;signature=8ee7d13e56fdff45744f6be92307e8cd7168cfb501373d346cee05a8065e5f99\">\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=\"OpenAI Image Generations - Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Generate one standard image as base64 with a Completion API key.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://langdock-34.mintlify.app/_mintlify/api/og/v2?division=Completion+API\u0026amp;title=OpenAI+Image+Generations\u0026amp;description=Generate+one+standard+image+as+base64+with+a+Completion+API+key.\u0026amp;theme=af251cb8027ba7e8fe3cc77e\u0026amp;signature=8ee7d13e56fdff45744f6be92307e8cd7168cfb501373d346cee05a8065e5f99\">\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/langdock-34/8EMNQyrrZlRONhj1/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#4469FC\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.langdock.com/en/developer/completion-api/openai-images\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/developer/completion-api/openai-images.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.langdock.com/en/developer/completion-api/openai-images\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"de\" href=\"https://docs.langdock.com/de/developer/completion-api/openai-images\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.langdock.com/en/developer/completion-api/openai-images\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.langdock.com/#organization\",\"name\":\"Docs\",\"url\":\"https://docs.langdock.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/langdock-34/URgvNwU7CYGZq8R7/logo/light.svg?fit=max\u0026auto=format\u0026n=URgvNwU7CYGZq8R7\u0026q=85\u0026s=594b4bd597e2629fb1a7dccfae6aa1c4\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.langdock.com#website\",\"name\":\"Docs\",\"url\":\"https://docs.langdock.com\",\"publisher\":{\"@id\":\"https://docs.langdock.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.langdock.com/en/developer/completion-api/openai-images#webpage\",\"url\":\"https://docs.langdock.com/en/developer/completion-api/openai-images\",\"name\":\"OpenAI Image Generations\",\"description\":\"Generate one standard image as base64 with a Completion API key.\",\"dateModified\":\"2026-10-26T17:48:51.213Z\",\"isPartOf\":{\"@id\":\"https://docs.langdock.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.langdock.com/en/developer/completion-api/openai-images#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.langdock.com/en/developer/completion-api/openai-images#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Completion API\",\"item\":\"https://docs.langdock.com/en/developer/completion-api/completion-overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"OpenAI Image Generations\",\"item\":\"https://docs.langdock.com/en/developer/completion-api/openai-images\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.langdock.com/en/developer/completion-api/openai-images#apireference\",\"headline\":\"OpenAI Image Generations\",\"name\":\"OpenAI Image Generations\",\"description\":\"Generate one standard image as base64 with a Completion API key.\",\"url\":\"https://docs.langdock.com/en/developer/completion-api/openai-images\",\"mainEntityOfPage\":{\"@id\":\"https://docs.langdock.com/en/developer/completion-api/openai-images#webpage\"},\"dateModified\":\"2026-10-26T17:48:51.213Z\",\"keywords\":\"api, openai, images, generations, b64_json, image generation\",\"publisher\":{\"@id\":\"https://docs.langdock.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.langdock.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Docs","nav":{"global":{"anchors":[{"anchor":"Changelog","icon":"newspaper","href":"https://www.langdock.com/changelog"},{"anchor":"Status","icon":"signal-bars","href":"https://status.langdock.com/"},{"anchor":"Support","icon":"messages-question","href":"https://www.langdock.com/contact-us"}]},"languages":[{"language":"en","default":true,"tabs":[{"tab":"Using Langdock","pages":[{"title":"Using Langdock","href":"/en/using-langdock/get-started/introduction"}]},{"tab":"Developer","groups":[{"group":"Overview","pages":[{"title":"API Introduction","href":"/en/developer/overview/api-introduction"},{"title":"Cookbook","href":"/en/developer/overview/cookbook"}]},{"group":"Completion API","pages":[{"title":"Completion API Overview","href":"/en/developer/completion-api/completion-overview"},{"title":"OpenAI Chat completion","openapi":"POST /openai/{region}/v1/chat/completions","href":"/en/developer/completion-api/openai"},{"title":"OpenAI Responses API","description":"Create stateless model responses for Codex, SDKs, and other OpenAI-compatible clients.","openapi":"POST /openai/{region}/v1/responses","href":"/en/developer/completion-api/openai-responses"},{"title":"OpenAI Image Generations","openapi":"POST /openai/{region}/v1/images/generations","href":"/en/developer/completion-api/openai-images"},{"title":"Anthropic Messages","description":"Creates a model response given a structured list of input messages using the Anthropic API.","openapi":"POST /anthropic/{region}/v1/messages","href":"/en/developer/completion-api/anthropic"},{"title":"Google Completion API","openapi":"POST /google/{region}/v1beta/models/{model}:generateContent","href":"/en/developer/completion-api/google"},{"title":"Codestral","openapi":"POST /mistral/{region}/v1/fim/completions","href":"/en/developer/completion-api/mistral"}]},{"group":"Embedding API","pages":[{"title":"OpenAI Embeddings","openapi":"POST /openai/{region}/v1/embeddings","href":"/en/developer/embedding-api/openai-embedding"}]},{"group":"Agents API","pages":[{"title":"Agents API Overview","href":"/en/developer/agents-api/agents-overview"},{"title":"Sharing Agents with API Keys","href":"/en/developer/agents-api/agent-api-guide"},{"title":"Agents Completions API","openapi":"POST /agent/v1/chat/completions","href":"/en/developer/agents-api/agent"},{"title":"Agent Get API","openapi":"GET /agent/v1/get","href":"/en/developer/agents-api/agent-get"},{"title":"Agent Create API","openapi":"POST /agent/v1/create","href":"/en/developer/agents-api/agent-create"},{"title":"Agent Update API","openapi":"PATCH /agent/v1/update","href":"/en/developer/agents-api/agent-update"},{"title":"Agent Publish API","openapi":"POST /agent/v1/publish","href":"/en/developer/agents-api/agent-publish"},{"title":"Agent Disable API","openapi":"PATCH /agent/v1/disable","href":"/en/developer/agents-api/agent-disable"},{"title":"Models for Agent API","openapi":"GET /agent/v1/models","href":"/en/developer/agents-api/agent-models"},{"title":"Upload Attachment API","openapi":"POST /attachment/v1/upload","href":"/en/developer/agents-api/upload-attachments"},{"title":"Delete Attachment API","openapi":"DELETE /attachment/v1/delete","href":"/en/developer/agents-api/delete-attachments"},{"title":"Agent Migration Guide","href":"/en/developer/agents-api/agent-migration"},{"title":"Migrating from Assistants API to Agents API","href":"/en/developer/agents-api/assistant-to-agent-migration"}]},{"group":"Integrations API","pages":[{"title":"Integrations API Overview","href":"/en/developer/integrations-api/integrations-overview"},{"title":"List Integrations","openapi":"GET /integrations/v1/get","href":"/en/developer/integrations-api/list-integrations"},{"title":"Create Integration","openapi":"POST /integrations/v1/create","href":"/en/developer/integrations-api/create-integration"},{"title":"Get Integration","openapi":"GET /integrations/v1/{integrationId}","href":"/en/developer/integrations-api/get-integration"},{"title":"Update Integration","openapi":"PATCH /integrations/v1/{integrationId}","href":"/en/developer/integrations-api/update-integration"},{"title":"Get Integration Icon","openapi":"GET /integrations/v1/{integrationId}/icon","href":"/en/developer/integrations-api/get-icon"},{"title":"Replace Integration Icon","openapi":"PUT /integrations/v1/{integrationId}/icon","href":"/en/developer/integrations-api/replace-icon"},{"title":"Update Auth Configuration","openapi":"PATCH /integrations/v1/{integrationId}/auth","href":"/en/developer/integrations-api/update-auth"},{"title":"Create Action","openapi":"POST /integrations/v1/{integrationId}/actions/create","href":"/en/developer/integrations-api/create-action"},{"title":"Update Action","openapi":"PUT /integrations/v1/{integrationId}/actions/{actionId}","href":"/en/developer/integrations-api/update-action"},{"title":"Delete Action","openapi":"DELETE /integrations/v1/{integrationId}/actions/{actionId}","href":"/en/developer/integrations-api/delete-action"},{"title":"Create Trigger","openapi":"POST /integrations/v1/{integrationId}/triggers/create","href":"/en/developer/integrations-api/create-trigger"},{"title":"Update Trigger","openapi":"PUT /integrations/v1/{integrationId}/triggers/{triggerId}","href":"/en/developer/integrations-api/update-trigger"},{"title":"Delete Trigger","openapi":"DELETE /integrations/v1/{integrationId}/triggers/{triggerId}","href":"/en/developer/integrations-api/delete-trigger"}]},{"group":"Skills API","pages":[{"title":"Skills API Overview","href":"/api-endpoints/skills/skills-overview"},{"title":"List Skills","openapi":"GET /skills/v1","href":"/api-endpoints/skills/list-skills"},{"title":"Create Skill","openapi":"POST /skills/v1","href":"/api-endpoints/skills/create-skill"},{"title":"Get Skill","openapi":"GET /skills/v1/{skillId}","href":"/api-endpoints/skills/get-skill"},{"title":"Get Skill File","openapi":"GET /skills/v1/{skillId}/files","href":"/api-endpoints/skills/get-skill-file"},{"title":"Update Skill","openapi":"PATCH /skills/v1/{skillId}","href":"/api-endpoints/skills/update-skill"},{"title":"Delete Skill","openapi":"DELETE /skills/v1/{skillId}","href":"/api-endpoints/skills/delete-skill"},{"title":"Import Skill","openapi":"POST /skills/v1/import","href":"/api-endpoints/skills/import-skill"}]},{"group":"Knowledge Folder API","pages":[{"title":"Knowledge Folder API Overview","href":"/en/developer/knowledge-folder-api/knowledge-folder-overview"},{"title":"Share Knowledge bases with the API","href":"/en/developer/knowledge-folder-api/sharing"},{"title":"Share Knowledge base access","openapi":"post /knowledge/{folderId}/access","href":"/en/developer/knowledge-folder-api/share-access"},{"title":"List Knowledge bases","openapi":"get /knowledge","href":"/en/developer/knowledge-folder-api/list-knowledge-folders"},{"title":"Upload File to Knowledge Folder","openapi":"post /knowledge/{folderId}","href":"/en/developer/knowledge-folder-api/upload-file"},{"title":"Update Attachment in Knowledge Folder","openapi":"patch /knowledge/{folderId}","href":"/en/developer/knowledge-folder-api/update-attachment"},{"title":"Update Knowledge base","openapi":"patch /knowledge/{folderId}/folder","href":"/en/developer/knowledge-folder-api/update-folder"},{"title":"Retrieve Files from Knowledge Folder","openapi":"get /knowledge/{folderId}/list","href":"/en/developer/knowledge-folder-api/retrieve-files"},{"title":"Delete Attachment from Knowledge Folder","openapi":"delete /knowledge/{folderId}/{attachmentId}","href":"/en/developer/knowledge-folder-api/delete-attachment"},{"title":"Search Knowledge bases","openapi":"post /knowledge/search","href":"/en/developer/knowledge-folder-api/search-knowledge-folder"}]},{"group":"Prompt Library API","pages":[{"title":"Prompt Library API Overview","href":"/en/developer/prompts-api/prompts-overview"},{"title":"List Prompts","openapi":"GET /prompts/v1","href":"/en/developer/prompts-api/list-prompts"},{"title":"Create Prompt","openapi":"POST /prompts/v1","href":"/en/developer/prompts-api/create-prompt"},{"title":"Get Prompt","openapi":"GET /prompts/v1/{promptId}","href":"/en/developer/prompts-api/get-prompt"},{"title":"Update Prompt","openapi":"PATCH /prompts/v1/{promptId}","href":"/en/developer/prompts-api/update-prompt"},{"title":"Delete Prompt","openapi":"DELETE /prompts/v1/{promptId}","href":"/en/developer/prompts-api/delete-prompt"},{"title":"List Prompt Folders","openapi":"GET /prompts/v1/folders","href":"/en/developer/prompts-api/list-folders"},{"title":"Create Prompt Folder","openapi":"POST /prompts/v1/folders","href":"/en/developer/prompts-api/create-folder"},{"title":"Get Prompt Folder","openapi":"GET /prompts/v1/folders/{folderId}","href":"/en/developer/prompts-api/get-folder"},{"title":"Update Prompt Folder","openapi":"PATCH /prompts/v1/folders/{folderId}","href":"/en/developer/prompts-api/update-folder"},{"title":"Delete Prompt Folder","openapi":"DELETE /prompts/v1/folders/{folderId}","href":"/en/developer/prompts-api/delete-folder"}]},{"group":"Usage Export API","pages":[{"title":"Usage Export API Overview","href":"/en/developer/usage-export-api/intro-to-usage-export-api"},{"title":"Export User Usage","openapi":"POST /export/users","href":"/en/developer/usage-export-api/export-users"},{"title":"Export Agent Usage","openapi":"POST /export/agents","href":"/en/developer/usage-export-api/export-agents"},{"title":"Export API Key Usage","openapi":"POST /export/api-keys","href":"/en/developer/usage-export-api/export-api-keys"},{"title":"Export Project Usage","openapi":"POST /export/projects","href":"/en/developer/usage-export-api/export-projects"},{"title":"Export Model Usage","openapi":"POST /export/models","href":"/en/developer/usage-export-api/export-models"},{"title":"Export Workflow Usage","openapi":"POST /export/workflows","href":"/en/developer/usage-export-api/export-workflows"}]},{"group":"Workflow API","pages":[{"title":"Workflow API Overview","href":"/en/developer/workflow-api/workflows-overview"},{"title":"List Workflows","openapi":"GET /workflows/v1/list","href":"/en/developer/workflow-api/list-workflows"},{"title":"Create Workflow","openapi":"POST /workflows/v1/create","href":"/en/developer/workflow-api/create-workflow"},{"title":"Get Workflow","openapi":"GET /workflows/v1/get","href":"/en/developer/workflow-api/get-workflow"},{"title":"Update Workflow","openapi":"PATCH /workflows/v1/update","href":"/en/developer/workflow-api/update-workflow"},{"title":"Publish Workflow","openapi":"POST /workflows/v1/publish","href":"/en/developer/workflow-api/publish-workflow"},{"title":"Delete Workflow","openapi":"DELETE /workflows/v1/delete","href":"/en/developer/workflow-api/delete-workflow"},{"title":"List Workflow Runs","openapi":"GET /workflows/v1/runs","href":"/en/developer/workflow-api/list-workflow-runs"},{"title":"Workflow Run Export API","openapi":"GET /workflows/{workflowId}/runs","href":"/en/developer/workflow-api/intro-to-workflow-api"}]},{"group":"Scheduled Tasks API","pages":[{"title":"Scheduled Tasks API Overview","href":"/en/developer/scheduled-tasks-api/scheduled-tasks-overview"},{"title":"List Scheduled Tasks","openapi":"GET /automations/v1","href":"/en/developer/scheduled-tasks-api/list-scheduled-tasks"},{"title":"Create Scheduled Task","openapi":"POST /automations/v1","href":"/en/developer/scheduled-tasks-api/create-scheduled-task"},{"title":"Get Scheduled Task","openapi":"GET /automations/v1/{automationId}","href":"/en/developer/scheduled-tasks-api/get-scheduled-task"},{"title":"Update Scheduled Task","openapi":"PATCH /automations/v1/{automationId}","href":"/en/developer/scheduled-tasks-api/update-scheduled-task"},{"title":"Delete Scheduled Task","openapi":"DELETE /automations/v1/{automationId}","href":"/en/developer/scheduled-tasks-api/delete-scheduled-task"},{"title":"Pause Scheduled Task","openapi":"POST /automations/v1/{automationId}/pause","href":"/en/developer/scheduled-tasks-api/pause-scheduled-task"},{"title":"Resume Scheduled Task","openapi":"POST /automations/v1/{automationId}/resume","href":"/en/developer/scheduled-tasks-api/resume-scheduled-task"},{"title":"Run Scheduled Task","openapi":"POST /automations/v1/{automationId}/run","href":"/en/developer/scheduled-tasks-api/run-scheduled-task"}]},{"group":"User Management API","pages":[{"title":"User Management API Overview","href":"/en/developer/user-management-api/user-management-overview"},{"title":"Invite Users","openapi":"POST /user-management/v1/invite","href":"/en/developer/user-management-api/invite"},{"title":"Update User Role","openapi":"POST /user-management/v1/update-user-role","href":"/en/developer/user-management-api/update-user-role"},{"title":"List Roles","openapi":"GET /user-management/v1/roles","href":"/en/developer/user-management-api/roles"},{"title":"Deactivate User","openapi":"POST /user-management/v1/deactivate-user","href":"/en/developer/user-management-api/deactivate-user"}]},{"group":"Audit Logs API","pages":[{"title":"Audit Logs API Overview","href":"/en/developer/audit-logs-api/intro-to-audit-logs-api"},{"title":"List Audit Logs","openapi":"GET /audit-logs/{workspace_id}","href":"/en/developer/audit-logs-api/list-audit-logs"}]},{"group":"Compliance API","pages":[{"title":"Export tool parameters and outputs","href":"/en/developer/compliance-api/export-tool-results"}]}]},{"tab":"Admin","pages":[{"title":"Admin","href":"/en/admin/workspace/workspace"}]}]},{"language":"de","pages":[{"title":"de","href":"/de/developer/completion-api/openai-images"}]}]},"title":"OpenAI Image Generations - Docs","buildId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","deploymentId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-WRhTSUDL.js","utils-ChMov4Kr.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-_REmC2bI.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Bp6nVRCu.js","snippetPresets-DZadmXoU.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CY2WdoTl.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-DwYG-Q4l.js","shallow-BXQIGwv4.js","getApiPlaygroundDisplay-CK5nK5B9.js","CodeSnippet-TH4a2aGW.js","CodeSnippets-DwsQiOFS.js","Page-R3M_BF4L.js","getPastedJson-DD7kUzi_.js","icon-holE3QoJ.js","MethodPill-DUW0T8us.js","DuplicateIcon-CI_p4be-.js","createIcon-BdbRvavb.js","DynamicMarkdown-DN96a4Ur.js","SectionHeading-SCu36A9d.js","axios-vUo_bRtp.js","Markdown-CCeGv-zI.js","clsx-BGBGWFTt.js","lib--scc4DXi.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-Cv_O2fky.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-2C5OB2eV.js"]}