For coders (or the curious bunch), by coders. Code interpreter is a feature that allows you to run Python code in your chat securely and sandboxed.
Even if you’re not a coder, let your curiousity take over. You can ask the AI to run code for you, and it will do so in a secure and sandboxed environment; this means the codes and its executions does not leave your browser. It won’t have access to any of your files and folders on your machine.This is a great way to test out code snippets or even learn how to code.
The first line of code we’re going to ask the AI to run is an obligatory Hello World program. Make sure to click on the Code Interpreter area on your text input field.
Now let’s tell the AI to write a hello world program for us. You can do so with this prompt:
Write a hello world in python
Hello World!
If you click on the Analyzed area, Open WebUI will show you the codes analyzed and its output. You can have fun here, the codes are editable! Try changing it to display your name! Then hit Run on the top right of the code editor.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"SleekChat Docs","colors":{"primary":"#E08484","light":"#E08484","dark":"#E08484"},"logo":{"light":"https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/logo/logo.png?fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=55d3c6bb4503e9f3ab9267d50cf31544","dark":"https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/logo/logo.png?fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=55d3c6bb4503e9f3ab9267d50cf31544"},"favicon":"/favicon.png","navbar":{"links":[{"label":"Support","href":"mailto:hello@sleekchat.net"}],"primary":{"type":"button","label":"Dashboard","href":"https://sleekchat.ai/instances"}},"footer":{"socials":{"x":"https://x.com/sleekchat_ai"}},"navigation":{"global":{"anchors":[{"anchor":"SleekChat at X","icon":"twitter","href":"https://x.com/sleekchat_ai"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"sleekinc","hasAudioNarration":false,"actualSubdomain":"sleekinc","customDomains":["docs.sleekchat.ai"],"gitSource":{"type":"github","owner":"sleek-inc","repo":"sleekchat-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a20c87a41d858a24b3a0e1b","collectionId":"4549e901-c18e-4565-bf47-d987f4042ec0","schemaVersion":"v2"},"entitlements":{},"buildId":"6ae927b555210c1811414629:success","clientVersion":"0.0.4067","searchFilterCounts":[{"language":"default","tag":"Open WebUI","count":17},{"language":"default","tag":"Text, Image, Audio and More","count":5},{"language":"default","tag":"Functions","count":5},{"language":"default","tag":"Initial Setup","count":4},{"language":"default","tag":"Home","count":2},{"language":"default","tag":"Get Started","count":2},{"language":"default","tag":"Quality of Life Improvements","count":2},{"language":"default","tag":"LiteLLM","count":1},{"language":"default","tag":"Administrative Tasks","count":1},{"language":"default","tag":"MCP","count":1}]},"assistantConfig":{},"basePath":"","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":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","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":"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":"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":"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":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","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":"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":"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":"turbopuffer-dual-write","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},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"openwebui/codeexec","slug":"/openwebui/codeexec","pageMetadata":{"title":"Code Execution (Python)","description":"For coders (or the curious bunch), by coders. Code interpreter is a feature that allows you to run Python code in your chat securely and sandboxed.","href":"/openwebui/codeexec"},"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: \"For coders (or the curious bunch), by coders. Code interpreter is a feature that allows you to run Python code in your chat securely and sandboxed.\"\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`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Frame,Heading,OptimizedImage,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Even if you’re not a coder, let your curiousity take over. You can ask the AI to run code for you, and it will do so in a secure and sandboxed environment; this means the codes and its executions does not leave your browser. It won’t have access to any of your files and folders on your machine.`}),`\n`,_jsx(_components.p,{children:`This is a great way to test out code snippets or even learn how to code.`}),`\n`,_jsx(Heading,{level:`2`,id:`hello-world`,children:`Hello World`}),`\n`,_jsxs(_components.p,{children:[`The first line of code we’re going to ask the AI to run is an obligatory `,_jsx(_components.code,{children:`Hello World`}),` program. Make sure to click on the `,_jsx(_components.code,{children:`Code Interpreter`}),` area on your text input field.`]}),`\n`,_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec.png?fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=424d87d4c084c54ff61763da04cafcd7`,\"data-og-width\":`1554`,width:`1554`,\"data-og-height\":`372`,height:`372`,\"data-path\":`images/openwebui-code-exec.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec.png?w=280\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=50347618e237e9ffb1a23af9cca07323 280w, https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec.png?w=560\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=ba4915c155d187ac096f2a75679dcf70 560w, https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec.png?w=840\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=317f1dd83082672e6a4fa2627eb6628f 840w, https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec.png?w=1100\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=724aa0409e021eb363abb34c1f838f29 1100w, https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec.png?w=1650\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=823e1dd33f89d39b0ea3cb9290178583 1650w, https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec.png?w=2500\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=868f0dad78ea979c51bfb633283c6e31 2500w`})}),`\n`,_jsx(_components.p,{children:`Now let’s tell the AI to write a hello world program for us. You can do so with this prompt:`}),`\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:`Write a hello world in python`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(Frame,{caption:`Hello World!`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec-hello-world.png?fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=61ea2a1d4a028324e1ddc3e645daf6a4`,\"data-og-width\":`2000`,width:`2000`,\"data-og-height\":`526`,height:`526`,\"data-path\":`images/openwebui-code-exec-hello-world.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec-hello-world.png?w=280\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=cdcc77aac97e864449672ef782463c54 280w, https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec-hello-world.png?w=560\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=e41b67910c1120aa043f4024e4be4b27 560w, https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec-hello-world.png?w=840\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=dff797ae5fac8b21f771fbc102b5bf80 840w, https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec-hello-world.png?w=1100\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=915ff64480e70973c7898a13c6b16cba 1100w, https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec-hello-world.png?w=1650\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=961577f6b435e745c843037493d6319f 1650w, https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec-hello-world.png?w=2500\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=cd9d8d9719aad685fd3a9a4b6137ccc9 2500w`})}),`\n`,_jsxs(Tip,{children:[_jsx(Frame,{children:_jsx(OptimizedImage,{src:`https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec-hello-world-2.png?fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=961a0a13a94176bcc655d9b08bbf158b`,\"data-og-width\":`2034`,width:`2034`,\"data-og-height\":`872`,height:`872`,\"data-path\":`images/openwebui-code-exec-hello-world-2.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec-hello-world-2.png?w=280\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=e8328d276225108a433180f294f234f4 280w, https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec-hello-world-2.png?w=560\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=53f5f04c938cd8e146dcb3ab4f576276 560w, https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec-hello-world-2.png?w=840\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=04f3292f9f575bedf275a100d137eb5f 840w, https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec-hello-world-2.png?w=1100\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=fdbdf4936b07938b5b03647f45fda1bd 1100w, https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec-hello-world-2.png?w=1650\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=2b6ca9a26b8b505a973595d6cfa19970 1650w, https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/images/openwebui-code-exec-hello-world-2.png?w=2500\u0026fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=e853886ecec4478c22394917c31e911b 2500w`})}),_jsxs(_components.p,{children:[`If you click on the `,_jsx(_components.code,{children:`Analyzed`}),` area, Open WebUI will show you the codes analyzed and its output. You can have fun here, the codes are editable! Try changing it to display your name! Then hit `,_jsx(_components.code,{children:`Run`}),` on the top right of the code editor.`]})]})]})}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":"Code Execution (Python)","description":"For coders (or the curious bunch), by coders. Code interpreter is a feature that allows you to run Python code in your chat securely and sandboxed.","href":"/openwebui/codeexec"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Hello World","slug":"hello-world","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"sleekinc","siteName":"SleekChat Docs","title":"Code Execution (Python) - SleekChat Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-07T07:58:20.304Z","originalFileLocation":"openwebui/codeexec.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=\"For coders (or the curious bunch), by coders. Code interpreter is a feature that allows you to run Python code in your chat securely and sandboxed.\">\u003cmeta data-mint-head name=\"application-name\" content=\"SleekChat 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/sleekinc/59IBcjY_vwAxSD7o/_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/sleekinc/59IBcjY_vwAxSD7o/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/sleekinc/59IBcjY_vwAxSD7o/_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/sleekinc/59IBcjY_vwAxSD7o/_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/sleekinc/59IBcjY_vwAxSD7o/_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/sleekinc/59IBcjY_vwAxSD7o/_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/sleekinc/59IBcjY_vwAxSD7o/_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/sleekinc/59IBcjY_vwAxSD7o/_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/sleekinc/59IBcjY_vwAxSD7o/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Code Execution (Python) - SleekChat Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"For coders (or the curious bunch), by coders. Code interpreter is a feature that allows you to run Python code in your chat securely and sandboxed.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"SleekChat Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.sleekchat.ai/openwebui/codeexec\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://sleekinc.mintlify.app/_mintlify/api/og/v2?division=Text%2C+Image%2C+Audio+and+More\u0026amp;title=Code+Execution+%28Python%29\u0026amp;description=For+coders+%28or+the+curious+bunch%29%2C+by+coders.+Code+interpreter+is+a+feature+that+allows+you+to+run+Python+code+in+your+chat+securely+and+sandboxed.\u0026amp;theme=821cc412d117c8e61cabd2c0\u0026amp;signature=92e75fbdb7fda6da3d92fc833f0e8e5cc88064609ca1634120d5786fe4b02ea3\">\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=\"Code Execution (Python) - SleekChat Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"For coders (or the curious bunch), by coders. Code interpreter is a feature that allows you to run Python code in your chat securely and sandboxed.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://sleekinc.mintlify.app/_mintlify/api/og/v2?division=Text%2C+Image%2C+Audio+and+More\u0026amp;title=Code+Execution+%28Python%29\u0026amp;description=For+coders+%28or+the+curious+bunch%29%2C+by+coders.+Code+interpreter+is+a+feature+that+allows+you+to+run+Python+code+in+your+chat+securely+and+sandboxed.\u0026amp;theme=821cc412d117c8e61cabd2c0\u0026amp;signature=92e75fbdb7fda6da3d92fc833f0e8e5cc88064609ca1634120d5786fe4b02ea3\">\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/sleekinc/59IBcjY_vwAxSD7o/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"SleekChat Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#E08484\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.sleekchat.ai/openwebui/codeexec\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/openwebui/codeexec.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.sleekchat.ai/#organization\",\"name\":\"SleekChat Docs\",\"url\":\"https://docs.sleekchat.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/sleekinc/DKiZGOrvGcLo1bzI/logo/logo.png?fit=max\u0026auto=format\u0026n=DKiZGOrvGcLo1bzI\u0026q=85\u0026s=55d3c6bb4503e9f3ab9267d50cf31544\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.sleekchat.ai#website\",\"name\":\"SleekChat Docs\",\"url\":\"https://docs.sleekchat.ai\",\"publisher\":{\"@id\":\"https://docs.sleekchat.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.sleekchat.ai/openwebui/codeexec#webpage\",\"url\":\"https://docs.sleekchat.ai/openwebui/codeexec\",\"name\":\"Code Execution (Python)\",\"description\":\"For coders (or the curious bunch), by coders. Code interpreter is a feature that allows you to run Python code in your chat securely and sandboxed.\",\"dateModified\":\"2026-01-07T07:58:20.304Z\",\"isPartOf\":{\"@id\":\"https://docs.sleekchat.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.sleekchat.ai/openwebui/codeexec#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.sleekchat.ai/openwebui/codeexec#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Text, Image, Audio and More\",\"item\":\"https://docs.sleekchat.ai/openwebui/firstchat\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Code Execution (Python)\",\"item\":\"https://docs.sleekchat.ai/openwebui/codeexec\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.sleekchat.ai/openwebui/codeexec#article\",\"headline\":\"Code Execution (Python)\",\"name\":\"Code Execution (Python)\",\"description\":\"For coders (or the curious bunch), by coders. Code interpreter is a feature that allows you to run Python code in your chat securely and sandboxed.\",\"url\":\"https://docs.sleekchat.ai/openwebui/codeexec\",\"mainEntityOfPage\":{\"@id\":\"https://docs.sleekchat.ai/openwebui/codeexec#webpage\"},\"dateModified\":\"2026-01-07T07:58:20.304Z\",\"publisher\":{\"@id\":\"https://docs.sleekchat.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.sleekchat.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"SleekChat Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"SleekChat Docs","nav":{"global":{"anchors":[{"anchor":"SleekChat at X","icon":"twitter","href":"https://x.com/sleekchat_ai"}]},"tabs":[{"tab":"Home","pages":[{"title":"Home","href":"/introduction"}]},{"tab":"Open WebUI","groups":[{"group":"Initial Setup","pages":[{"title":"Open WebUI at SleekChat","href":"/openwebui/intro"},{"title":"Create an OpenAI API Key","href":"/openwebui/apikeys"},{"title":"Setup Open WebUI","href":"/openwebui/setup-apikeys"}]},{"group":"Text, Image, Audio and More","pages":[{"title":"Your First Chat","href":"/openwebui/firstchat"},{"title":"Phone Call with an AI","href":"/openwebui/phonecall"},{"title":"Web Search","description":"Yes, you can tell the AI to Google for more context.","href":"/openwebui/websearch"},{"title":"Code Execution (Python)","href":"/openwebui/codeexec"},{"title":"Thinking/Reasoning Models","description":"Take advantage of a smarter and thinking oriented AI models. Open WebUI supports them out of the box.","href":"/openwebui/thinkingmodels"}]},{"group":"MCP","pages":[{"title":"Introduction","href":"/openwebui/mcp/introduction"}]},{"group":"Functions","pages":[{"title":"Introduction","href":"/openwebui/functions/introduction"},{"title":"Adding Anthropic Models","href":"/openwebui/functions/anthropic"},{"title":"Adding Deepseek Models","href":"/openwebui/functions/deepseek"},{"title":"Adding Gemini Models","href":"/openwebui/functions/gemini"},{"title":"Adding Perplexity","href":"/openwebui/functions/perplexity"}]},{"group":"Quality of Life Improvements","pages":[{"title":"Change Your Preferred Language","href":"/openwebui/changelanguage"},{"title":"Use Your Gravatar","href":"/openwebui/useyourgravatar"}]},{"group":"Administrative Tasks","pages":[{"title":"Inviting Friends","href":"/openwebui/invitingfriends"}]}]},{"tab":"LiteLLM","pages":[{"title":"LiteLLM","href":"/litellm/intro"}]}]},"basePath":"","title":"Code Execution (Python) - SleekChat Docs","buildId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","deploymentId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-BdiBGm0H.js","DynamicMarkdown-CbqEDjbV.js","zoom-image-lightbox-CvtNkYOX.js","lightbox-handle-r17bVUz3.js"]}