Environment variables, init(), and credential rotation.
The SDK reads its credentials from the environment and starts on the first call. init() overrides that: it accepts credentials in code, pays setup cost up front, and registers identity getters.
import bentolabs_sdk.analytics as bentobento.init(api_key="bl_pk_explicit", base_url="http://localhost:8080")
init() is optional if you only use bento.track_ai. The first call lazy-initializes from env vars. Call init() explicitly to pay setup cost up front (cold-start sensitive workloads), pass credentials from code, or register identity getters (the next section). For integrations, call bento.init() before bento.instrument() so the getters are registered before the first captured call.
init() accepts user_id, session_id, and tags kwargs. Bento invokes them on every span, whether captured by an integration or emitted by bento.track_ai, and writes the result to gen_ai.user.id, gen_ai.conversation.id, and langfuse.tags.
A getter that raises is swallowed by the SDK and the field is dropped for that span. Telemetry must never break the host app.
See Integrations → Identity at init for the three common bridges (framework state, ContextVar, auth library), and Identity helpers for late-binding (update_current_trace, propagate_attributes).
For tools that need the resolved config without standing up a tracer:
from bentolabs_sdk import resolve_optionscfg = resolve_options()print(cfg.api_key, cfg.base_url)
Returns a frozen BentoConfig(api_key, base_url) dataclass. Same resolution order as init().
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Bento","description":"Production infrastructure for AI agents. Monitor what runs. Improve what fails. Compound learnings.","colors":{"primary":"#FF3C00","light":"#FF7A4D","dark":"#C23D0F"},"logo":{"light":"https://mintcdn.com/bentolabs-67c07c24/UR3oVTg-dFSkd4Qv/logo/light.svg?fit=max\u0026auto=format\u0026n=UR3oVTg-dFSkd4Qv\u0026q=85\u0026s=52d59445f69fca8e14170d9f18f24489","dark":"https://mintcdn.com/bentolabs-67c07c24/UR3oVTg-dFSkd4Qv/logo/dark.svg?fit=max\u0026auto=format\u0026n=UR3oVTg-dFSkd4Qv\u0026q=85\u0026s=cb9f386a99e01805f4d0b2e6afb4eee9","href":"https://bentolabs.ai"},"favicon":"https://mintcdn.com/bentolabs-67c07c24/UR3oVTg-dFSkd4Qv/favicon.svg?fit=max\u0026auto=format\u0026n=UR3oVTg-dFSkd4Qv\u0026q=85\u0026s=7af1b6c525f2fa0a76075cfae72bdf22","appearance":{"default":"dark"},"navbar":{"links":[{"icon":"clock-rotate-left","href":"/changelog","label":"Changelog"},{"icon":"github","href":"https://github.com/BentoLabs-ai","label":"GitHub"}],"primary":{"type":"button","label":"Dashboard","href":"https://platform.bentolabs.ai"}},"footer":{"socials":{"x":"https://x.com/bentolabsai","github":"https://github.com/BentoLabs-ai","linkedin":"https://www.linkedin.com/company/bentolabs-ai"},"links":[{"header":"Product","items":[{"label":"Dashboard","href":"https://platform.bentolabs.ai"},{"label":"Website","href":"https://bentolabs.ai"}]},{"header":"Developers","items":[{"label":"GitHub","href":"https://github.com/BentoLabs-ai"},{"label":"Python SDK","href":"/python/installation"},{"label":"TypeScript SDK","href":"/typescript"},{"label":"CLI","href":"/cli/installation"}]},{"header":"Company","items":[{"label":"Support","href":"mailto:support@bentolabs.ai"}]}]},"seo":{"metatags":{"title":"Bento Documentation","description":"Production infrastructure for AI agents. SDK docs, quickstart, and reference for the Bento platform.","keywords":"Bento, BentoLabs, AI agents, AI infrastructure, agent traces, agent monitoring, agent evaluations, signals, OpenTelemetry, Python SDK, gen_ai","author":"BentoLabs","og:type":"website","og:site_name":"Bento Docs","og:title":"Bento Documentation","og:description":"Production infrastructure for AI agents. Monitor what runs. Improve what fails. Compound learnings.","og:url":"https://docs.bentolabs.ai","og:locale":"en_US","twitter:card":"summary","twitter:site":"@bentolabsai","twitter:title":"Bento Documentation","twitter:description":"Production infrastructure for AI agents. SDK docs, quickstart, and reference for the Bento platform.","robots":"index, follow","googlebot":"index, follow"},"indexing":"navigable"},"fonts":{"heading":{"family":"Inter"},"body":{"family":"Inter"}},"contextual":{"options":["copy","view","assistant","claude","chatgpt","perplexity","add-mcp","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"bentolabs-67c07c24","hasAudioNarration":false,"actualSubdomain":"bentolabs-67c07c24","customDomains":["docs.bentolabs.ai"],"gitSource":{"type":"github","owner":"bentolabs-ai","repo":"docs","deployBranch":"main","isPrivate":false,"contentDirectory":"","mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a21dd80a5fe930653fc0085","collectionId":"df42cf17-99f6-410f-a873-850ed68eb3f1","schemaVersion":"v2"},"feedback":{"thumbs":true,"edits":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6a21dd80a5fe930653fc0085:success","clientVersion":"0.0.3971","searchFilterCounts":[{"language":"default","tag":"Get started","count":15},{"language":"default","tag":"CLI","count":13},{"language":"default","tag":"Python SDK","count":9},{"language":"default","tag":"Resources","count":8},{"language":"default","tag":"Concepts","count":5},{"language":"default","tag":"Advanced","count":4},{"language":"default","tag":"Overview","count":3},{"language":"default","tag":"Workspace \u0026 sources","count":2},{"language":"default","tag":"Migrations","count":2},{"language":"default","tag":"Manual tracking","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"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":"python/configuration","slug":"/python/configuration","pageMetadata":{"title":"Configuration","description":"Environment variables, init(), and credential rotation.","icon":"gear","href":"/python/configuration"},"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: \"Environment variables, init(), and credential rotation.\"\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`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`The SDK reads its credentials from the environment and starts on the first call. `,_jsx(_components.code,{children:`init()`}),` overrides that: it accepts credentials in code, pays setup cost up front, and registers identity getters.`]}),`\n`,_jsx(Heading,{level:`2`,id:`environment-variables`,children:`Environment variables`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Variable`}),_jsx(_components.th,{children:`Default`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`BENTOLABS_API_KEY`})}),_jsx(_components.td,{children:`(required)`}),_jsxs(_components.td,{children:[`From `,_jsx(_components.a,{href:`https://platform.bentolabs.ai`,children:`platform.bentolabs.ai`}),`. Format `,_jsx(_components.code,{children:`bl_pk_...`}),` (validated up front).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`BENTOLABS_BASE_URL`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`https://api.bentolabs.ai`})}),_jsxs(_components.td,{children:[`Override only for self-hosted or local dev. Must be `,_jsx(_components.code,{children:`http://`}),` or `,_jsx(_components.code,{children:`https://`}),`.`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`in-code-config`,children:`In-code config`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`init()`}),` kwargs override env vars.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` bentolabs_sdk.analytics `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` bento`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`bento.init(`}),_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:`\"bl_pk_explicit\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`\"http://localhost:8080\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`init()`}),` is optional if you only use `,_jsx(_components.code,{children:`bento.track_ai`}),`. The first call lazy-initializes from env vars. Call `,_jsx(_components.code,{children:`init()`}),` explicitly to pay setup cost up front (cold-start sensitive workloads), pass credentials from code, or `,_jsx(_components.strong,{children:`register identity getters`}),` (the next section). For `,_jsx(_components.a,{href:`/python/integrations`,children:`integrations`}),`, call `,_jsx(_components.code,{children:`bento.init()`}),` before `,_jsx(_components.code,{children:`bento.instrument()`}),` so the getters are registered before the first captured call.`]}),`\n`,_jsx(Heading,{level:`2`,id:`identity-getters`,children:`Identity getters`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`init()`}),` accepts `,_jsx(_components.code,{children:`user_id`}),`, `,_jsx(_components.code,{children:`session_id`}),`, and `,_jsx(_components.code,{children:`tags`}),` kwargs. Bento invokes them on every span, whether captured by an integration or emitted by `,_jsx(_components.code,{children:`bento.track_ai`}),`, and writes the result to `,_jsx(_components.code,{children:`gen_ai.user.id`}),`, `,_jsx(_components.code,{children:`gen_ai.conversation.id`}),`, and `,_jsx(_components.code,{children:`langfuse.tags`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,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:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`bento.init(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` user_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`lambda`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: get_current_user_id(),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` session_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`lambda`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: get_current_session_id(),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` tags`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"env:prod\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"tenant:acme\"`}),_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`]})})}),`\n`,_jsx(_components.p,{children:`Each kwarg accepts three forms:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Form`}),_jsx(_components.th,{children:`Effect`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Zero-arg callable`}),_jsxs(_components.td,{children:[`Invoked on every span. Use for per-request identity (`,_jsx(_components.code,{children:`ContextVar.get`}),`, framework state, auth library).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Static value`}),_jsx(_components.td,{children:`Stamped on every span as-is. Use for single-tenant apps.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Omitted`}),_jsxs(_components.td,{children:[`Keep whatever was previously registered (partial `,_jsx(_components.code,{children:`init()`}),` is an update, not a replace).`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Explicit `,_jsx(_components.code,{children:`None`})]}),_jsx(_components.td,{children:`Clear the source for that field.`})]})]})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`bento.init(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`user_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`get_user) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# registers user_id only`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`bento.init(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`session_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`get_session) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# user_id getter survives`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`bento.init(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`user_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`None`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# explicitly clears user_id`})]}),`\n`]})})}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`A getter that raises is swallowed by the SDK and the field is dropped for that span. Telemetry must never break the host app.`})}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/python/integrations#identity-at-init`,children:`Integrations → Identity at init`}),` for the three common bridges (framework state, ContextVar, auth library), and `,_jsx(_components.a,{href:`/python/identity`,children:`Identity helpers`}),` for late-binding (`,_jsx(_components.code,{children:`update_current_trace`}),`, `,_jsx(_components.code,{children:`propagate_attributes`}),`).`]}),`\n`,_jsx(Heading,{level:`2`,id:`lifecycle`,children:`Lifecycle`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`When`}),_jsx(_components.th,{children:`What to call`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Long-running service`}),_jsxs(_components.td,{children:[`Nothing. Lazy init on the first `,_jsx(_components.code,{children:`track_ai`}),` works.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Serverless or cold-start sensitive`}),_jsxs(_components.td,{children:[`Call `,_jsx(_components.code,{children:`bento.init()`}),` at module load to pay the setup cost up front instead of on a user request.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Short-lived script or Lambda`}),_jsxs(_components.td,{children:[`Call `,_jsx(_components.code,{children:`bento.flush()`}),` before exit. Spans batch by default; without flushing, the last few calls may not ship.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Rotating credentials`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`bento.shutdown()`}),` then `,_jsx(_components.code,{children:`bento.init(api_key=\"bl_pk_new...\")`}),`.`]})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Calling `,_jsx(_components.code,{children:`init()`}),` twice with conflicting credentials raises `,_jsx(_components.code,{children:`BentoAuthError(\"already_initialized\")`}),`. Call `,_jsx(_components.code,{children:`shutdown()`}),` first to rotate.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(_components.p,{children:[`The SDK raises `,_jsx(_components.code,{children:`BentoAuthError`}),` with a typed `,_jsx(_components.code,{children:`code`}),` for fail-fast cases.`]}),`\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:` bentolabs_sdk `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` BentoAuthError`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`try`}),_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:` bento.init()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`except`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` BentoAuthError `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` exc:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` exc.code `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"missing_api_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # telemetry disabled or misconfigured`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` pass`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` elif`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` exc.code `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"invalid_api_key_format\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # key doesn't start with bl_pk_`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` pass`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` elif`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` exc.code `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"already_initialized\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # conflicting credentials, call shutdown() first`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` pass`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` raise`})}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`When`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`missing_api_key`})}),_jsxs(_components.td,{children:[`No key passed and `,_jsx(_components.code,{children:`BENTOLABS_API_KEY`}),` not set.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_api_key_format`})}),_jsxs(_components.td,{children:[`Key does not start with `,_jsx(_components.code,{children:`bl_pk_`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`already_initialized`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`init()`}),` called twice with conflicting `,_jsx(_components.code,{children:`api_key`}),` or `,_jsx(_components.code,{children:`base_url`}),`.`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`resolution-helpers`,children:`Resolution helpers`}),`\n`,_jsx(_components.p,{children:`For tools that need the resolved config without standing up a tracer:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,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:`4`,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:` bentolabs_sdk `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` resolve_options`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`cfg `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` resolve_options()`})]}),`\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:`(cfg.api_key, cfg.base_url)`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Returns a frozen `,_jsx(_components.code,{children:`BentoConfig(api_key, base_url)`}),` dataclass. Same resolution order as `,_jsx(_components.code,{children:`init()`}),`.`]})]})}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":"Configuration","description":"Environment variables, init(), and credential rotation.","icon":"gear","href":"/python/configuration"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Environment variables","slug":"environment-variables","depth":2,"children":[]},{"title":"In-code config","slug":"in-code-config","depth":2,"children":[]},{"title":"Identity getters","slug":"identity-getters","depth":2,"children":[]},{"title":"Lifecycle","slug":"lifecycle","depth":2,"children":[]},{"title":"Errors","slug":"errors","depth":2,"children":[]},{"title":"Resolution helpers","slug":"resolution-helpers","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"bentolabs-67c07c24","siteName":"Bento","title":"Bento Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-05-30T01:44:30.066Z","originalFileLocation":"python/configuration.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=\"dark\"}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=\"Environment variables, init(), and credential rotation.\">\u003cmeta data-mint-head name=\"keywords\" content=\"Bento, BentoLabs, AI agents, AI infrastructure, agent traces, agent monitoring, agent evaluations, signals, OpenTelemetry, Python SDK, gen_ai\">\u003cmeta data-mint-head name=\"application-name\" content=\"Bento\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/bentolabs-67c07c24/5y0pyf96-lCjMzMa/_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/bentolabs-67c07c24/5y0pyf96-lCjMzMa/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/bentolabs-67c07c24/5y0pyf96-lCjMzMa/_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/bentolabs-67c07c24/5y0pyf96-lCjMzMa/_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/bentolabs-67c07c24/5y0pyf96-lCjMzMa/_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/bentolabs-67c07c24/5y0pyf96-lCjMzMa/_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/bentolabs-67c07c24/5y0pyf96-lCjMzMa/_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/bentolabs-67c07c24/5y0pyf96-lCjMzMa/_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/bentolabs-67c07c24/5y0pyf96-lCjMzMa/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Bento Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Production infrastructure for AI agents. Monitor what runs. Improve what fails. Compound learnings.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Bento Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.bentolabs.ai/python/configuration\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://bentolabs-67c07c24.mintlify.app/_mintlify/api/og/v2?division=Get+started\u0026amp;title=Configuration\u0026amp;description=Environment+variables%2C+init%28%29%2C+and+credential+rotation.\u0026amp;theme=7e776a1e7779628f30b79d1e\u0026amp;signature=61a3b69d217da9907a44a623608b0008e952c42bf44d5f0dc93d80f5bee22c23\">\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=\"Bento Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Production infrastructure for AI agents. SDK docs, quickstart, and reference for the Bento platform.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://bentolabs-67c07c24.mintlify.app/_mintlify/api/og/v2?division=Get+started\u0026amp;title=Configuration\u0026amp;description=Environment+variables%2C+init%28%29%2C+and+credential+rotation.\u0026amp;theme=7e776a1e7779628f30b79d1e\u0026amp;signature=61a3b69d217da9907a44a623608b0008e952c42bf44d5f0dc93d80f5bee22c23\">\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/bentolabs-67c07c24/5y0pyf96-lCjMzMa/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Bento\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF3C00\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_US\">\u003cmeta data-mint-head name=\"author\" content=\"BentoLabs\">\u003cmeta data-mint-head name=\"googlebot\" content=\"index, follow\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.bentolabs.ai/python/configuration\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/python/configuration.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.bentolabs.ai/#organization\",\"name\":\"Bento\",\"url\":\"https://docs.bentolabs.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/bentolabs-67c07c24/UR3oVTg-dFSkd4Qv/logo/light.svg?fit=max\u0026auto=format\u0026n=UR3oVTg-dFSkd4Qv\u0026q=85\u0026s=52d59445f69fca8e14170d9f18f24489\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.bentolabs.ai#website\",\"name\":\"Bento\",\"url\":\"https://docs.bentolabs.ai\",\"publisher\":{\"@id\":\"https://docs.bentolabs.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.bentolabs.ai/python/configuration#webpage\",\"url\":\"https://docs.bentolabs.ai/python/configuration\",\"name\":\"Configuration\",\"description\":\"Environment variables, init(), and credential rotation.\",\"dateModified\":\"2026-05-30T01:44:30.066Z\",\"isPartOf\":{\"@id\":\"https://docs.bentolabs.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.bentolabs.ai/python/configuration#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.bentolabs.ai/python/configuration#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Get started\",\"item\":\"https://docs.bentolabs.ai/python/installation\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Configuration\",\"item\":\"https://docs.bentolabs.ai/python/configuration\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.bentolabs.ai/python/configuration#article\",\"headline\":\"Configuration\",\"name\":\"Configuration\",\"description\":\"Environment variables, init(), and credential rotation.\",\"url\":\"https://docs.bentolabs.ai/python/configuration\",\"mainEntityOfPage\":{\"@id\":\"https://docs.bentolabs.ai/python/configuration#webpage\"},\"dateModified\":\"2026-05-30T01:44:30.066Z\",\"publisher\":{\"@id\":\"https://docs.bentolabs.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.bentolabs.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Bento\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Bento","nav":{"global":null,"tabs":[{"tab":"Get started","icon":"rocket","pages":[{"title":"Get started","href":""}]},{"tab":"Python SDK","icon":"python","groups":[{"group":"Get started","icon":"rocket","pages":[{"title":"Installation","description":"Install the Bento Python SDK and send a test trace.","icon":"download","href":"/python/installation"},{"title":"Configuration","icon":"gear","href":"/python/configuration"}]},{"group":"Integrations","icon":"plug","pages":[{"title":"Google ADK","description":"Capture every model call, tool call, and agent step from a Google ADK app with one line.","icon":"google","href":"/python/integrations"}]},{"group":"Manual tracking","icon":"paper-plane","pages":[{"title":"Tracking events","icon":"code","href":"/python/track-ai"},{"title":"Properties","icon":"sliders","href":"/python/properties"}]},{"group":"Advanced","icon":"screwdriver-wrench","pages":[{"title":"Trajectories","icon":"diagram-project","href":"/python/trajectories"},{"title":"Identity helpers","icon":"user-tag","href":"/python/identity"},{"title":"OTel transport","icon":"cube","href":"/python/otel-transport"},{"title":"Threading model","icon":"microchip","href":"/python/threading-model"}]}]},{"tab":"TypeScript SDK","icon":"js","pages":[{"title":"TypeScript SDK","href":"/typescript"}]},{"tab":"CLI","icon":"terminal","pages":[{"title":"CLI","href":"/cli/overview"}]}]},"title":"Bento Documentation","buildId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","deploymentId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","dynamics":[],"chunks":[]}