To authenticate with Encord you must register a public key in the Encord platform. See our documentation here to learn more. Users can only access Projects, Datasets, and Ontologies from within their Workspace.
Authentication must occur every time an SDK script is run.
Ensure your private key is not password protected. All private keys generated on the Encord platform as described in our documentation are not password protected by default.
After registering a public key, use the corresponding private key to authenticate your EncordUserClient. The following code sample needs to be included in all SDK interactions, and hence is included in all code snippets we provide in these tutorials.
We recommend using the file path to your private key, rather than the private key itself when authenticating.
The following script must be added to all Encord SDK scripts. It is present in all complete code examples we provide.
# Import dependenciesfrom encord import EncordUserClient# Authenticate with Encord using the path to your private keyuser_client = EncordUserClient.create_with_ssh_private_key( ssh_private_key_path="<private_key_path>", # For US platform users use "https://api.us.encord.com" domain="https://api.encord.com", )
# Import dependenciesfrom encord import EncordUserClient# Authenticate with Encord using the path to your private keyuser_client = EncordUserClient.create_with_ssh_private_key( ssh_private_key_path="/Users/chris-encord/sdk-ssh-private-key", # For US platform users use "https://api.us.encord.com" domain="https://api.encord.com", )
If a script or service cannot store your private key, you can authenticate with a bearer token instead. Use an SSH-authenticated client to generate the token with get_bearer_token(), then pass the token to EncordUserClient.create_with_bearer_token().
A bearer token grants the same access as your private key. Store it securely and never commit it to version control.
# Import dependenciesfrom encord import EncordUserClient# Authenticate with your private key and generate a bearer tokenssh_client = EncordUserClient.create_with_ssh_private_key( ssh_private_key_path="<private_key_path>", # For US platform users use "https://api.us.encord.com" domain="https://api.encord.com", )bearer_token = ssh_client.get_bearer_token()# Authenticate with Encord using the bearer tokenuser_client = EncordUserClient.create_with_bearer_token( bearer_token, # For US platform users use "https://api.us.encord.com" domain="https://api.encord.com",)# For US platform users, also pass the US domain# user_client = EncordUserClient.create_with_bearer_token(bearer_token, domain="https://api.us.encord.com")
If you are using Encord’s US based hosted platform, ALL authentication for the SDK MUST include the following:
domain="https://api.us.encord.com"
# Import dependenciesfrom encord import EncordUserClient# Authenticate with Encord using the path to your private keyuser_client = EncordUserClient.create_with_ssh_private_key( ssh_private_key_path="<private_key_path>", domain="https://api.us.encord.com",)
# Import dependenciesfrom encord import EncordUserClient# Authenticate with Encord using the path to your private keyuser_client = EncordUserClient.create_with_ssh_private_key( ssh_private_key_path="/Users/chris-encord/sdk-ssh-private-key", domain="https://api.us.encord.com", )
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Encord","colors":{"primary":"#A6E40E","light":"#C4F53A","dark":"#7AAA0A"},"logo":{"light":"https://storage.googleapis.com/docs-media.encord.com/primary-logo-light.png","dark":"https://storage.googleapis.com/docs-media.encord.com/primary-logo-dark.png"},"favicon":"https://mintcdn.com/encord-30/9VGa3mvnov97xugB/favicon.png?fit=max\u0026auto=format\u0026n=9VGa3mvnov97xugB\u0026q=85\u0026s=3f6951e96cf860a1c336e00cfc11dcbe","appearance":{"default":"system","strict":false},"navbar":{"links":[{"icon":"signal","href":"https://status.encord.com/","label":"Status"},{"icon":"newspaper","href":"https://encord.com/blog/","label":"Blog"}],"primary":{"type":"button","label":"Book a demo","href":"https://encord.com/book-demo/?utm_source=encord_docs_header_cta"}},"footer":{"socials":{"github":"https://github.com/encord-team","linkedin":"https://www.linkedin.com/company/encord-team"}},"styling":{"eyebrows":"breadcrumbs","codeblocks":"dark","latex":false},"integrations":{"clearbit":{"publicApiKey":"pk_3adfa5e57fcda43370d4da97618f3856"},"heap":{"appId":"3135473550"}},"banner":{"content":"Introducing Encord Data Labs. [Research at the Frontier](https://encord.com/data-labs/).","dismissible":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"encord-30","hasAudioNarration":false,"actualSubdomain":"encord-30","customDomains":["docs.encord.com"],"gitSource":{"type":"github","owner":"encord-team","repo":"encord-docs-mint","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6af32e9961b7ee08971803c0","clientVersion":"0.0.4094","searchFilterCounts":[{"language":"default","tag":"SDK","count":192},{"language":"default","tag":"Platform","count":129},{"language":"default","tag":"General","count":123},{"language":"default","tag":"SDK Reference","count":121},{"language":"default","tag":"Data","count":53},{"language":"default","tag":"Labels and Logs","count":47},{"language":"default","tag":"Get Started","count":42},{"language":"default","tag":"Fundamentals","count":36},{"language":"default","tag":"Solutions","count":34},{"language":"default","tag":"Modalities","count":27}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","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":"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":"editor-metadata","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":[{"filePath":"styles.css","content":":root{--encord-primary: #A6E40E;--encord-primary-light: #C4F53A;--encord-primary-dark: #7AAA0A;--encord-text: #1B1916;--encord-white: #FFFFFF;--encord-black: #1B1916}.text-primary,.dark .dark\\:text-primary-light{color:var(--encord-text)!important}.dark a[aria-current=\"location\"]{color:var(--encord-primary-light)!important}.dark #table-of-contents li[data-active]>a{color:var(--encord-primary-light)!important}.bg-primary\\/10{background-color:rgba(166, 228, 14, 0.14)!important}.dark .dark\\:bg-primary-light\\/10,.dark .bg-primary\\/10{background-color:rgba(196, 245, 58, 0.92)!important}.border-primary,.border-primary-light,.dark .dark\\:border-primary-light{border-color:var(--encord-primary)!important}.ring-primary,.ring-primary-light,.dark .dark\\:ring-primary-light{--tw-ring-color: var(--encord-primary) !important}#topbar-cta-button .bg-primary-dark{background-color:var(--encord-primary)!important}#topbar-cta-button a:hover .bg-primary-dark,.group:hover #topbar-cta-button .bg-primary-dark{background-color:var(--encord-primary-light)!important}#topbar-cta-button a,#topbar-cta-button a *{color:var(--encord-text)!important}#assistant-entry,#assistant-entry *,#ask-assistant-code-block-button,#ask-assistant-code-block-button *{color:var(--encord-text)!important}.dark #assistant-entry,.dark #assistant-entry *,.dark #ask-assistant-code-block-button,.dark #ask-assistant-code-block-button *{color:var(--encord-white)!important}#banner{background-color:var(--encord-black)!important;border-color:var(--encord-black)!important}.dark #banner{background-color:var(--encord-white)!important;border-color:var(--encord-white)!important}@layer utilities{#banner,#banner *,#banner a,#banner button,#banner svg{color:var(--encord-white)!important;text-decoration-color:var(--encord-white)!important}.dark #banner,.dark #banner *,.dark #banner a,.dark #banner button,.dark #banner svg{color:var(--encord-black)!important;text-decoration-color:var(--encord-black)!important}}.container{display:flex;flex-wrap:wrap;gap:10px}.clickable-button,.clickable-div{display:flex;align-items:center;justify-content:center;padding:10px 20px;border:2px solid #F0F0F0;border-radius:5px;background-color:var(--encord-white);color:var(--encord-text);font-size:16px;text-align:center;text-decoration:none;cursor:pointer;width:220px;height:60px;line-height:1.2;transition:background-color 0.3s, border-color 0.3s, color 0.3s, transform 0.15s}.dark .clickable-button,.dark .clickable-div{background-color:rgb(var(--gray-900));border-color:rgb(var(--gray-800));color:var(--encord-white)}.clickable-button:hover,.clickable-div:hover,.dark .clickable-button:hover,.dark .clickable-div:hover{background-color:var(--encord-primary-light);border-color:var(--encord-primary-light);color:var(--encord-text)}.clickable-button:hover ol li::marker,.clickable-div:hover ol li::marker,.dark .clickable-button:hover ol li::marker,.dark .clickable-div:hover ol li::marker{color:var(--encord-text)}.clickable-button:active,.clickable-div:active,.dark .clickable-button:active,.dark .clickable-div:active{background-color:var(--encord-primary-dark);border-color:var(--encord-primary-dark);color:var(--encord-text);transform:scale(0.98)}.dark [data-component-part=\"callout-content\"]{--tw-prose-kbd: var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows: var(--tw-prose-invert-kbd-shadows)}.dark [data-component-part=\"tab-button\"][data-active=\"true\"]{color:var(--encord-primary-light)!important}#encord-kapa-ask-ai{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;margin-left:6px!important;height:40px!important;min-width:104px!important;padding:0 16px!important;border-radius:12px!important;border:1px solid var(--encord-primary)!important;background:var(--encord-primary)!important;background-color:var(--encord-primary)!important;color:var(--encord-text)!important;font-size:14px!important;font-weight:600!important;line-height:1!important;white-space:nowrap!important;cursor:pointer!important;flex-shrink:0!important}#encord-kapa-ask-ai:hover{background:var(--encord-primary-light)!important;background-color:var(--encord-primary-light)!important;border-color:var(--encord-primary-light)!important;color:var(--encord-text)!important}#encord-kapa-ask-ai:active{background:var(--encord-primary-dark)!important;background-color:var(--encord-primary-dark)!important;border-color:var(--encord-primary-dark)!important;color:var(--encord-text)!important}.dark #encord-kapa-ask-ai,.dark #encord-kapa-ask-ai:hover,.dark #encord-kapa-ask-ai:active{color:var(--encord-text)!important}#encord-kapa-ask-ai .encord-kapa-ask-ai-icon,#encord-kapa-ask-ai .encord-kapa-ask-ai-label{display:inline-flex!important;align-items:center!important;white-space:nowrap!important;line-height:1!important;color:inherit!important}img[alt=\"Project Logo\"]+p,img[alt=\"Project Logo\"]~p,img[alt=\"Project Logo\"]+.mantine-Text-root,img[alt=\"Project Logo\"]~.mantine-Text-root,img[alt=\"Project Logo\"]~*{color:var(--encord-text)!important}img[alt=\"Project Logo\"],img[alt=\"Project Logo\"]~span,img[alt=\"Project Logo\"]~div{color:var(--encord-text)!important}.loom-thumb{position:relative;display:block;cursor:pointer;width:100%;aspect-ratio:16 / 9;background-size:cover;background-position:center;background-repeat:no-repeat;border-radius:0.75rem;overflow:hidden}.loom-thumb::before{content:\"\";position:absolute;top:50%;left:50%;width:72px;height:50px;transform:translate(-50%, -50%);background:rgba(0, 0, 0, 0.65);border-radius:12px;transition:background 0.15s ease;pointer-events:none}.loom-thumb::after{content:\"\";position:absolute;top:50%;left:50%;transform:translate(-38%, -50%);border-style:solid;border-width:11px 0 11px 19px;border-color:transparent transparent transparent #ffffff;pointer-events:none}.loom-thumb:hover::before{background:var(--encord-primary, #A6E40E)}.loom-thumb:hover::after{border-left-color:#1B1916}@keyframes loom-spin{to{transform:rotate(360deg)}}.loom-thumb[aria-label=\"\"],.loom-thumb:not([role=\"button\"])::before,.loom-thumb:not([role=\"button\"])::after{display:none}"}],"page":{"pagePath":"sdk-documentation/general-sdk/authentication-sdk","slug":"/sdk-documentation/general-sdk/authentication-sdk","pageMetadata":{"title":"2. Authentication Basics","metadata":{"title":"Authentication Basics"},"description":null,"href":"/sdk-documentation/general-sdk/authentication-sdk"},"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`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Info,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`To authenticate with Encord you must register a public key in the Encord platform. See `,_jsx(_components.a,{href:`/platform-documentation/General/general-access-keys`,children:`our documentation here`}),` to learn more. Users can only access Projects, Datasets, and Ontologies from within their `,_jsx(_components.a,{href:`/platform-documentation/General/general-workspace-settings`,children:`Workspace`}),`.`]}),`\n`,_jsx(Info,{children:`Authentication must occur every time an SDK script is run.`}),`\n`,_jsxs(Info,{children:[`Ensure your private key is not password protected. All private keys generated on the Encord platform as described in `,_jsx(_components.a,{href:`/platform-documentation/General/general-access-keys`,children:`our documentation`}),` are not password protected by default.`]}),`\n`,_jsxs(_components.p,{children:[`After registering a public key, use the corresponding private key to authenticate your `,_jsx(_components.a,{href:`/sdk-documentation/sdk-references/user_client`,children:`EncordUserClient`}),`. The following code sample needs to be included in all SDK interactions, and hence is included in all code snippets we provide in these tutorials.`]}),`\n`,_jsx(Tip,{children:`We recommend using the file path to your private key, rather than the private key itself when authenticating.`}),`\n`,_jsx(_components.p,{children:`The following script must be added to all Encord SDK scripts. It is present in all complete code examples we provide.`}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Template`,numberOfLines:`9`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Import dependencies`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` encord `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` EncordUserClient`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Authenticate with Encord using the path to your private key`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`user_client = EncordUserClient.create_with_ssh_private_key(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` ssh_private_key_path`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cprivate_key_path>\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` # For US platform users use \"https://api.us.encord.com\"`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` domain`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.encord.com\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Example Global`,numberOfLines:`11`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Import dependencies`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` encord `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` EncordUserClient`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Authenticate with Encord using the path to your private key`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`user_client = EncordUserClient.create_with_ssh_private_key(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` ssh_private_key_path`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"/Users/chris-encord/sdk-ssh-private-key\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` # For US platform users use \"https://api.us.encord.com\"`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` domain`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.encord.com\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`authenticate-with-a-bearer-token`,children:`Authenticate with a Bearer Token`}),`\n`,_jsxs(_components.p,{children:[`If a script or service cannot store your private key, you can authenticate with a bearer token instead. Use an SSH-authenticated client to generate the token with `,_jsx(_components.code,{children:`get_bearer_token()`}),`, then pass the token to `,_jsx(_components.code,{children:`EncordUserClient.create_with_bearer_token()`}),`.`]}),`\n`,_jsx(Warning,{children:`A bearer token grants the same access as your private key. Store it securely and never commit it to version control.`}),`\n`,_jsx(CodeGroup,{children:_jsx(CodeBlock,{filename:`Template`,numberOfLines:`20`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`20`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Import dependencies`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` encord `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` EncordUserClient`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Authenticate with your private key and generate a bearer token`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`ssh_client = EncordUserClient.create_with_ssh_private_key(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` ssh_private_key_path`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cprivate_key_path>\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` # For US platform users use \"https://api.us.encord.com\"`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` domain`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.encord.com\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`bearer_token = ssh_client.get_bearer_token()`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Authenticate with Encord using the bearer token`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`user_client = EncordUserClient.create_with_bearer_token(`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` bearer_token,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:` # For US platform users use \"https://api.us.encord.com\"`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` domain`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.encord.com\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# For US platform users, also pass the US domain`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# user_client = EncordUserClient.create_with_bearer_token(bearer_token, domain=\"https://api.us.encord.com\")`})}),`\n`]})})})}),`\n`,_jsx(Heading,{level:`2`,id:`us-customers`,children:`US Customers`}),`\n`,_jsx(_components.p,{children:`If you are using Encord’s US based hosted platform, ALL authentication for the SDK MUST include the following:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`domain=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.us.encord.com\"`})]}),`\n`]})})}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`Template`,numberOfLines:`9`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Import dependencies`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` encord `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` EncordUserClient`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Authenticate with Encord using the path to your private key`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`user_client = EncordUserClient.create_with_ssh_private_key(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` ssh_private_key_path`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cprivate_key_path>\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` domain`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.us.encord.com\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Example US Domain`,numberOfLines:`10`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Import dependencies`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` encord `}),_jsx(_components.span,{style:{color:`#C586C0`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` EncordUserClient`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6A9955`,\"--shiki-dark\":`#6A9955`},children:`# Authenticate with Encord using the path to your private key`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`user_client = EncordUserClient.create_with_ssh_private_key(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` ssh_private_key_path`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"/Users/chris-encord/sdk-ssh-private-key\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#9CDCFE`,\"--shiki-dark\":`#9CDCFE`},children:` domain`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.us.encord.com\"`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`]})})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"2. Authentication Basics","metadata":{"title":"Authentication Basics"},"description":null,"href":"/sdk-documentation/general-sdk/authentication-sdk"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Authenticate with a Bearer Token","slug":"authenticate-with-a-bearer-token","depth":2,"children":[]},{"title":"US Customers","slug":"us-customers","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/encord-30/d15b515f4c558429/kapa.js","/_mintlify/custom/encord-30/29a7567284ffb810/hubspot-tracking.js"],"subdomain":"encord-30","siteName":"Encord","title":"2. Authentication Basics - Encord","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-10T12:47:56.551Z","originalFileLocation":"sdk-documentation/general-sdk/authentication-sdk.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=\"application-name\" content=\"Encord\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/encord-30/fUSFXKv0aq-6s8pC/_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/encord-30/fUSFXKv0aq-6s8pC/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/encord-30/fUSFXKv0aq-6s8pC/_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/encord-30/fUSFXKv0aq-6s8pC/_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/encord-30/fUSFXKv0aq-6s8pC/_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/encord-30/fUSFXKv0aq-6s8pC/_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/encord-30/fUSFXKv0aq-6s8pC/_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/encord-30/fUSFXKv0aq-6s8pC/_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/encord-30/fUSFXKv0aq-6s8pC/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"2. Authentication Basics - Encord\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Encord\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.encord.com/sdk-documentation/general-sdk/authentication-sdk\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://encord-30.mintlify.site/_mintlify/api/og/v2?division=First+Steps\u0026amp;title=2.+Authentication+Basics\u0026amp;theme=9922bbf922698869e1d3a373\u0026amp;signature=00bfa2171fe671b70325008e596638e69627d1e1e637a5f9e5ff6cea2baeeac0\">\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=\"2. Authentication Basics - Encord\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://encord-30.mintlify.site/_mintlify/api/og/v2?division=First+Steps\u0026amp;title=2.+Authentication+Basics\u0026amp;theme=9922bbf922698869e1d3a373\u0026amp;signature=00bfa2171fe671b70325008e596638e69627d1e1e637a5f9e5ff6cea2baeeac0\">\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/encord-30/fUSFXKv0aq-6s8pC/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Encord\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#A6E40E\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.encord.com/sdk-documentation/general-sdk/authentication-sdk\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/sdk-documentation/general-sdk/authentication-sdk.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.encord.com/#organization\",\"name\":\"Encord\",\"url\":\"https://docs.encord.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://storage.googleapis.com/docs-media.encord.com/primary-logo-light.png\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.encord.com#website\",\"name\":\"Encord\",\"url\":\"https://docs.encord.com\",\"publisher\":{\"@id\":\"https://docs.encord.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.encord.com/sdk-documentation/general-sdk/authentication-sdk#webpage\",\"url\":\"https://docs.encord.com/sdk-documentation/general-sdk/authentication-sdk\",\"name\":\"2. Authentication Basics\",\"dateModified\":\"2026-11-10T12:47:56.551Z\",\"isPartOf\":{\"@id\":\"https://docs.encord.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.encord.com/sdk-documentation/general-sdk/authentication-sdk#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.encord.com/sdk-documentation/general-sdk/authentication-sdk#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Get Started\",\"item\":\"https://docs.encord.com/sdk-documentation/general-sdk/general-concepts-sdk\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"First Steps\",\"item\":\"https://docs.encord.com/sdk-documentation/getting-started-sdk/sdk-intro\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"2. Authentication Basics\",\"item\":\"https://docs.encord.com/sdk-documentation/general-sdk/authentication-sdk\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.encord.com/sdk-documentation/general-sdk/authentication-sdk#article\",\"headline\":\"2. Authentication Basics\",\"name\":\"2. Authentication Basics\",\"url\":\"https://docs.encord.com/sdk-documentation/general-sdk/authentication-sdk\",\"mainEntityOfPage\":{\"@id\":\"https://docs.encord.com/sdk-documentation/general-sdk/authentication-sdk#webpage\"},\"dateModified\":\"2026-11-10T12:47:56.551Z\",\"publisher\":{\"@id\":\"https://docs.encord.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.encord.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Encord\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Encord","nav":{"global":null,"tabs":[{"tab":"Platform","pages":[{"title":"Platform","href":"/platform-documentation/GettingStarted/gettingstarted-welcome"}]},{"tab":"SDK","groups":[{"group":"Get Started","pages":[{"title":"Entities and Relationships","href":"/sdk-documentation/general-sdk/general-concepts-sdk"},{"title":"SDK Quick Peek","href":"/sdk-documentation/general-sdk/sdk-quick-lookup"},{"group":"First Steps","expanded":false,"pages":[{"title":"Encord SDK Introduction","href":"/sdk-documentation/getting-started-sdk/sdk-intro"},{"title":"1. Prerequisites and Installation","description":null,"href":"/sdk-documentation/getting-started-sdk/installation-sdk"},{"title":"2. Authentication Basics","href":"/sdk-documentation/general-sdk/authentication-sdk"},{"group":"3. Register Cloud Data","pages":[{"title":"Import/Register Data (SDK)","description":null,"href":"/sdk-documentation/getting-started-sdk/sdk-register-data"},{"title":"Register AWS Data (SDK)","href":"/sdk-documentation/getting-started-sdk/sdk-register-data-aws"},{"title":"Register GCP Data (SDK)","href":"/sdk-documentation/getting-started-sdk/sdk-register-data-gcp"},{"title":"Register Azure Data (SDK)","href":"/sdk-documentation/getting-started-sdk/sdk-register-data-azure"},{"title":"Register OTC Data (SDK)","href":"/sdk-documentation/getting-started-sdk/sdk-register-data-otc"}]},{"group":"4. Set Up Your Project and Team","pages":[{"title":"Create an Ontology","href":"/sdk-documentation/getting-started-sdk/sdk-get-started-ontology"},{"title":"Create a Workflow Template","hidden":false,"href":"/sdk-documentation/getting-started-sdk/sdk-get-started-workflow-template"},{"title":"Create a Project","href":"/sdk-documentation/getting-started-sdk/sdk-get-started-project"},{"title":"Add Users To Your Project","hidden":false,"href":"/sdk-documentation/getting-started-sdk/sdk-add-users"}]}]}]},{"group":"General","pages":[{"group":"Users \u0026 Workspaces","pages":[{"title":"User Groups","hidden":false,"href":"/sdk-documentation/general-sdk/sdk-user-groups"},{"title":"Workspace-Wide Actions","href":"/sdk-documentation/general-sdk/sdk-org-actions"}]},{"title":"Network Configurations","hidden":false,"href":"/sdk-documentation/general-sdk/network-configurations-sdk"},{"title":"Bulk Action Best Practices","hidden":false,"href":"/sdk-documentation/general-sdk/sdk-bulk-action-best-practices"},{"title":"Custom Embeddings","href":"/sdk-documentation/index-sdk/sdk-custom-embeddings"},{"group":"SDK Reference","pages":[{"group":"Start here","pages":[{"title":null,"href":"/sdk-documentation/sdk-references/user_client"},{"title":null,"href":"/sdk-documentation/sdk-references/client"}]},{"group":"Beta","pages":[{"title":null,"href":"/sdk-documentation/sdk-references/beta.scene.builder"},{"title":null,"href":"/sdk-documentation/sdk-references/beta.scene.intrinsics"},{"title":null,"href":"/sdk-documentation/sdk-references/beta.scene.layout"},{"title":null,"href":"/sdk-documentation/sdk-references/beta.scene.pose"},{"title":null,"href":"/sdk-documentation/sdk-references/beta.scene.reader"},{"title":null,"href":"/sdk-documentation/sdk-references/beta.scene.rotation"},{"title":null,"href":"/sdk-documentation/sdk-references/beta.scene.scene_to_upload_playload"},{"title":null,"href":"/sdk-documentation/sdk-references/beta.scene.settings"},{"title":null,"href":"/sdk-documentation/sdk-references/beta.scene.stream"}]},{"group":"Projects and Teams","pages":[{"title":null,"href":"/sdk-documentation/sdk-references/project"},{"title":null,"href":"/sdk-documentation/sdk-references/group"},{"title":null,"href":"/sdk-documentation/sdk-references/issues.issue_client"},{"title":null,"href":"/sdk-documentation/sdk-references/workflow.stages.agent"},{"title":null,"href":"/sdk-documentation/sdk-references/workflow.stages.annotation"},{"title":null,"href":"/sdk-documentation/sdk-references/workflow.stages.consensus_annotation"},{"title":null,"href":"/sdk-documentation/sdk-references/workflow.stages.consensus_review"},{"title":null,"href":"/sdk-documentation/sdk-references/workflow.stages.final"},{"title":null,"href":"/sdk-documentation/sdk-references/workflow.stages.review"},{"title":null,"href":"/sdk-documentation/sdk-references/workflow.workflow"}]},{"group":"Datasets and Storage","pages":[{"title":null,"href":"/sdk-documentation/sdk-references/dataset"},{"title":null,"href":"/sdk-documentation/sdk-references/storage"},{"title":null,"href":"/sdk-documentation/sdk-references/collection"}]},{"group":"Schemas","pages":[{"title":null,"href":"/sdk-documentation/sdk-references/client_metadata_schema"},{"title":null,"href":"/sdk-documentation/sdk-references/metadata_schema"}]},{"group":"Labels and Logs","pages":[{"title":null,"href":"/sdk-documentation/sdk-references/common.bitmask_operations.bitmask_operations"},{"title":null,"href":"/sdk-documentation/sdk-references/common.enum"},{"title":null,"href":"/sdk-documentation/sdk-references/common.integer_range_set"},{"title":null,"href":"/sdk-documentation/sdk-references/common.organisation_tags"},{"title":null,"href":"/sdk-documentation/sdk-references/common.range_manager"},{"title":null,"href":"/sdk-documentation/sdk-references/common.time_parser"},{"title":null,"href":"/sdk-documentation/sdk-references/common.utils"},{"title":null,"href":"/sdk-documentation/sdk-references/filter_preset"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.answers"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.attributes"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.bitmask"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.classification"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.classification_expansion"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.classification_instance"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.classification_ranges"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.common"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.coordinates"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.events"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.frames"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.html_node"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.interpolation"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.metadata"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.ontology_element"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.ontology_labels_impl"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.ontology_object"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.ontology_object_instance"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.ontology_structure"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.options"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.skeleton_template"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.annotation.base_annotation"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.annotation.html_annotation"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.annotation.range_annotation"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.base_space"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.html_space"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.image_space"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.mcap_spaces"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.multiframe_space.medical_space"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.multiframe_space.multiframe_space"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.multiframe_space.pdf_space"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.multiframe_space.video_space"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.range_space.audio_space"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.range_space.point_cloud_space"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.range_space.range_space"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.range_space.text_space"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.spaces.types"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.types"},{"title":null,"href":"/sdk-documentation/sdk-references/objects.utils"}]},{"group":"Ontologies","pages":[{"title":null,"href":"/sdk-documentation/sdk-references/ontology"},{"title":null,"href":"/sdk-documentation/sdk-references/project_ontology.classification_attribute"},{"title":null,"href":"/sdk-documentation/sdk-references/project_ontology.classification_option"},{"title":null,"href":"/sdk-documentation/sdk-references/project_ontology.classification_type"},{"title":null,"href":"/sdk-documentation/sdk-references/project_ontology.ontology"},{"title":null,"href":"/sdk-documentation/sdk-references/project_ontology.ontology_classification"},{"title":null,"href":"/sdk-documentation/sdk-references/project_ontology.ontology_object"}]},{"group":"Models and ML","pages":[{"title":null,"href":"/sdk-documentation/sdk-references/ml_models_client"}]},{"group":"HTTP (advanced)","pages":[{"title":null,"href":"/sdk-documentation/sdk-references/http.bundle"},{"title":null,"href":"/sdk-documentation/sdk-references/http.common"},{"title":null,"href":"/sdk-documentation/sdk-references/http.constants"},{"title":null,"href":"/sdk-documentation/sdk-references/http.error_utils"},{"title":null,"href":"/sdk-documentation/sdk-references/http.querier"},{"title":null,"href":"/sdk-documentation/sdk-references/http.request"},{"title":null,"href":"/sdk-documentation/sdk-references/http.utils"},{"title":null,"href":"/sdk-documentation/sdk-references/http.v2.api_client"},{"title":null,"href":"/sdk-documentation/sdk-references/http.v2.error_utils"}]},{"group":"ORM (advanced)","pages":[{"title":null,"href":"/sdk-documentation/sdk-references/orm.analytics"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.base_dto.base_dto_pydantic_v2"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.base_orm"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.collection"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.dataset"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.editor_log"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.group_layout"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.label_log"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.label_row"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.labeling_algorithm"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.metadata_schema"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.ontology"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.organisation_user"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.project"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.project_with_user_role"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.skeleton_template"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.storage"},{"title":null,"href":"/sdk-documentation/sdk-references/orm.workflow"}]},{"group":"Utilities","pages":[{"title":null,"href":"/sdk-documentation/sdk-references/configs"},{"title":null,"href":"/sdk-documentation/sdk-references/constants.enums"},{"title":null,"href":"/sdk-documentation/sdk-references/exceptions"},{"title":null,"href":"/sdk-documentation/sdk-references/utilities.client_utilities"},{"title":null,"href":"/sdk-documentation/sdk-references/utilities.coco.exporter"},{"title":null,"href":"/sdk-documentation/sdk-references/utilities.coco.polygon_utils"},{"title":null,"href":"/sdk-documentation/sdk-references/utilities.label_utilities"},{"title":null,"href":"/sdk-documentation/sdk-references/utilities.ontology_user"},{"title":null,"href":"/sdk-documentation/sdk-references/utilities.project_user"},{"title":null,"href":"/sdk-documentation/sdk-references/utilities.storage.cloud_data_migration"}]}]}]},{"group":"Data","pages":[{"title":"Upload \u0026 Register Data","href":"/sdk-documentation/index-sdk/sdk-upload-data"},{"title":"Files and Folders","href":"/sdk-documentation/index-sdk/sdk-files-and-folders"},{"title":"Scene SDK Workflows","href":"/sdk-documentation/index-sdk/sdk-scenes"},{"title":"Time-series Data","href":"/sdk-documentation/index-sdk/sdk-time-series"},{"group":"Custom Metadata","pages":[{"title":"Metadata Schema","href":"/sdk-documentation/index-sdk/custom-metadata/sdk-index-metadata-schema"},{"title":"Import Custom Metadata (SDK)","href":"/sdk-documentation/index-sdk/custom-metadata/sdk-import-custom-metadata"}]},{"group":"Grouping","pages":[{"title":"Data Groups","href":"/sdk-documentation/index-sdk/sdk-data-groups"},{"title":"Image Groups and Image Sequences","href":"/sdk-documentation/index-sdk/sdk-image-groups-image-sequences"}]},{"group":"Datasets","pages":[{"title":"Add Files to Datasets","hidden":false,"href":"/sdk-documentation/index-sdk/sdk-add-files-to-datasets"},{"title":"Create Datasets","href":"/sdk-documentation/datasets-sdk/sdk-create-and-view-datasets"},{"title":"Verify Where Files are Stored (Dataset)","href":"/sdk-documentation/datasets-sdk/sdk-view-dataset-files"},{"title":"Remove Data from Datasets","hidden":false,"href":"/sdk-documentation/datasets-sdk/sdk-remove-data"},{"title":"Re-encoding Videos (SDK)","hidden":false,"href":"/sdk-documentation/datasets-sdk/sdk-re-encoding"}]},{"title":"Collections for Data Curation","href":"/sdk-documentation/index-sdk/sdk-collections"}]},{"group":"Ontologies","pages":[{"title":"Ontologies Basics","href":"/sdk-documentation/ontologies-sdk/ontologies"},{"title":"Create Ontologies","href":"/sdk-documentation/ontologies-sdk/ontologies-create"},{"title":"Copy Ontologies","hidden":false,"href":"/sdk-documentation/ontologies-sdk/ontologies-copy"}]},{"group":"Projects","pages":[{"group":"Projects and Workflows","pages":[{"title":"Project Basics","href":"/sdk-documentation/projects-sdk/projects-and-workflows/sdk-project-basics"},{"title":"Workflows and Stages","href":"/sdk-documentation/projects-sdk/sdk-workflows-stages"},{"title":"Change Project Status","href":"/sdk-documentation/projects-sdk/projects-and-workflows/sdk-project-status-change-status"},{"title":"Verify Where Files are Stored (Project)","hidden":false,"href":"/sdk-documentation/projects-sdk/projects-and-workflows/sdk-view-project-files"},{"title":"Copy Projects","hidden":false,"href":"/sdk-documentation/projects-sdk/projects-and-workflows/sdk-copy-project"},{"title":"Adding Users to Projects","hidden":false,"href":"/sdk-documentation/projects-sdk/projects-and-workflows/sdk-adding-users-projects"},{"title":"Issues \u0026 Comments in Projects","href":"/sdk-documentation/projects-sdk/sdk-projects-issues-comments"},{"title":"Organization Tags","href":"/sdk-documentation/projects-sdk/sdk-organization-tags"},{"title":"Timers in Projects","href":"/sdk-documentation/projects-sdk/sdk-projects-timers"},{"title":"Automated Labeling","hidden":false,"href":"/sdk-documentation/projects-sdk/projects-and-workflows/sdk-automated-labeling-projects"}]},{"group":"Project Utilities","pages":[{"title":"Converting Ontology Shapes","hidden":false,"href":"/sdk-documentation/projects-sdk/sdk-converting-ontology-shapes"},{"title":"Split Projects","hidden":false,"href":"/sdk-documentation/projects-sdk/sdk-split-projects"},{"title":"Convert Manual QA Projects into Workflow Projects","href":"/sdk-documentation/projects-sdk/sdk-convert-manualqa-workflow"},{"title":"Merge Projects","hidden":false,"href":"/sdk-documentation/projects-sdk/sdk-merge-projects"},{"title":"Copy Labels between Projects","href":"/sdk-documentation/projects-sdk/sdk-copy-labels"}]},{"title":"Attaching and Removing Datasets","hidden":false,"href":"/sdk-documentation/projects-sdk/sdk-attaching-and-removing-datasets"},{"title":"Import CVAT","href":"/sdk-documentation/projects-sdk/sdk-import-cvat"},{"group":"Editor Logs \u0026 Task Actions","pages":[{"title":"How To","href":"/sdk-documentation/projects-sdk/sdk-editor-logs"},{"title":"Reference","href":"/sdk-documentation/projects-sdk/sdk-activity-logs"}]}]},{"group":"Labels","pages":[{"group":"Import / Create Labels","pages":[{"title":"Images \u0026 Videos","href":"/sdk-documentation/sdk-labels/sdk-import-labels-annotations-visual"},{"title":"Audio","href":"/sdk-documentation/sdk-labels/sdk-audio-classifications"},{"title":"Point Cloud (3D)","href":"/sdk-documentation/sdk-labels/sdk-labels-import-3d"},{"title":"MCAP Scene labels","href":"/sdk-documentation/sdk-labels/sdk-labels-mcap"},{"title":"Text Files","href":"/sdk-documentation/sdk-labels/sdk-labels-text-files"},{"title":"HTML","href":"/sdk-documentation/sdk-labels/sdk-labels-html"},{"title":"PDF","href":"/sdk-documentation/sdk-labels/sdk-pdf-labels-classifications"},{"title":"Data Groups \u0026 Label Spaces","href":"/sdk-documentation/sdk-labels/sdk-data-group-labels"},{"title":"Label Spaces: Code Examples","href":"/sdk-documentation/sdk-labels/sdk-label-spaces-examples"},{"title":"Import to Consensus Branches","href":"/sdk-documentation/sdk-labels/sdk-import-labels-to-consensus-branches"},{"title":"COCO Labels/Annotations","href":"/sdk-documentation/sdk-labels/sdk-import-coco-labels"}]},{"title":"Edit \u0026 Delete Labels","href":"/sdk-documentation/sdk-labels/sdk-delete-edit-labels-classifications"},{"title":"Label Versions \u0026 Branches","href":"/sdk-documentation/sdk-labels/sdk-label-versioning"},{"title":"Export Labels","href":"/sdk-documentation/sdk-labels/sdk-export"},{"group":"Label Validation","pages":[{"title":"Import Predictions","href":"/platform-documentation/Validation/active-how-to/active-import-model-predictions-cloud"},{"title":"Label Validation Collections","href":"/sdk-documentation/api-active/sdk-active-collections"}]}]},{"group":"DICOM","pages":[{"title":"SDK DICOM Basics","hidden":false,"href":"/sdk-documentation/dicom-sdk/sdk-dicom-basics"},{"title":"Reading DICOM Metadata","hidden":false,"href":"/sdk-documentation/dicom-sdk/sdk-dicom-metadata"},{"title":"De-identifying DICOM Files","hidden":false,"href":"/sdk-documentation/dicom-sdk/sdk-deidentify-dicom"}]}]},{"tab":"Modalities","pages":[{"title":"Modalities","href":"/platform-documentation/Curate/modalities-landing-page"}]},{"tab":"Solutions","pages":[{"title":"Solutions","href":"/solutions-documentation/solutions-overview"}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/release-notes/releasenotes-2026"}]}]},"basePath":"","title":"2. Authentication Basics - Encord","buildId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","deploymentId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","dynamics":["10e4515597"],"chunks":["BannerMarkdown-DV-WToSZ.js","dist-CBUH0-zX.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","clsx-CR-RHrVC.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}