For initial Prime access and onboarding, contact Kraken support at prime_trading@kraken.com or your Account Manager.After your Prime account is onboarded, you can create and manage API keys self-service from the Prime UI API settings. Sign in with your standard Kraken Pro credentials.You will need separate API keys for the sandbox and production environments.
There is no limit to how many concurrent websocket connections you’re allowed, though this may change in the future. If you expect to have more than ~10 active connections, please contact prime_trading@kraken.com.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Kraken Developers","colors":{"primary":"#101114","light":"#FFFFFF","dark":"#101114"},"logo":{"light":"https://mintcdn.com/kraken/opwCJHYUnRFWd1O3/logo/light.svg?fit=max\u0026auto=format\u0026n=opwCJHYUnRFWd1O3\u0026q=85\u0026s=6be2f97a23f9a7aa6ef071ae334cc89c","dark":"https://mintcdn.com/kraken/opwCJHYUnRFWd1O3/logo/dark.svg?fit=max\u0026auto=format\u0026n=opwCJHYUnRFWd1O3\u0026q=85\u0026s=97e079a88bc1e9f156ed533a5f9d5d05"},"favicon":"https://mintcdn.com/kraken/qRZxIUN3tXcpjqG0/favicon.svg?fit=max\u0026auto=format\u0026n=qRZxIUN3tXcpjqG0\u0026q=85\u0026s=1215f433d712b5e667fd4e7599391422","api":{"examples":{"languages":["curl","python","javascript","go"]}},"appearance":{"default":"dark","strict":false},"navbar":{"primary":{"type":"button","label":"Get API key","href":"https://pro.kraken.com/app/settings/api"}},"footer":{"socials":{"x":"https://x.com/krakenfx","github":"https://github.com/krakenfx","linkedin":"https://linkedin.com/company/kraken-exchange"}},"contextual":{"options":["copy","view","download-spec","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"kraken","hasAudioNarration":false,"actualSubdomain":"kraken","customDomains":["docs.kraken.com"],"gitSource":{"type":"gitlab","owner":"eng-devs","repo":"kraken-api-docs","hostUrl":"https://roshi-korin.honeycrypt.com","projectId":28500,"deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae4bbf6af0623d0054ded3b","collectionId":"3ffb37e4-eb87-46ff-9b51-527afc5cb033","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae4bbf6af0623d0054ded3b"},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae4bbf6af0623d0054ded3b","clientVersion":"0.0.4043","searchFilterCounts":[{"language":"default","tag":"API Reference","count":366},{"language":"default","tag":"Exchange","count":309},{"language":"default","tag":"Institutional","count":96},{"language":"default","tag":"Spot REST","count":81},{"language":"default","tag":"Derivatives REST","count":71},{"language":"default","tag":"Guides","count":45},{"language":"default","tag":"Market Data","count":39},{"language":"default","tag":"Session","count":31},{"language":"default","tag":"Trading","count":29},{"language":"default","tag":"Custody REST","count":25}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":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":"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":"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":"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":"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":"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}],"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","content":"@import url(https://assets.kraken.com/fonts/kraken.css);@import url(https://assets.kraken.com/fonts/celias.css);body,body *,html{font-family:var(--kp-font-sans)!important;-webkit-font-smoothing:antialiased}h1,h2,h3,h4{font-family:var(--kp-font-brand)!important}.prose h1,.prose h2,.prose h3,.prose h4,.prose h5,.prose h6{font-family:var(--kp-font-brand)!important;font-weight:500!important}.kp-mono,.kp-mono *,body [class*=Code],body [class*=code],body code,body code *,body kbd,body pre,body pre *,body samp{font-family:var(--kp-font-mono)!important}:root{--kp-primary:#101114;--kp-primary-hover:#2a2c33;--kp-brand:#7132f5;--kp-font-sans:'Kraken-Product', system-ui, -apple-system, sans-serif;--kp-font-mono:'Kraken-Mono', ui-monospace, monospace;--kp-font-brand:'Kraken-Brand', 'Celias', system-ui, sans-serif;--kp-bg-page:#f6f5f9;--kp-bg-card:#ffffff;--kp-bg-subtle:rgba(104, 107, 130, 0.12);--kp-text-heading:#101114;--kp-text-body:#686b82;--kp-text-placeholder:#9497a9;--kp-text-accent:#101114;--kp-text-meta:#9497a9;--kp-border:rgba(104, 107, 130, 0.16);--kp-terminal-bg:transparent;--kp-terminal-text:var(--kp-text-body);--kp-terminal-heading:var(--kp-text-heading);--kp-terminal-muted:var(--kp-text-placeholder)}html.dark{--kp-primary:#ffffff;--kp-primary-hover:#e7e7e7;--kp-brand:#8a61ff;--kp-bg-page:#0b0611;--kp-bg-card:#16121f;--kp-bg-subtle:rgba(255, 255, 255, 0.07);--kp-text-heading:#ffffff;--kp-text-body:#c6c7d2;--kp-text-placeholder:#9497a9;--kp-text-accent:#ffffff;--kp-text-meta:rgba(255, 255, 255, 0.45);--kp-border:rgba(255, 255, 255, 0.1)}@media (prefers-reduced-motion:reduce){.kp-terminal *,.kp-welcome-hero *{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}body,body #almond-background-color{background-color:var(--kp-bg-page)!important}.prose{--tw-prose-body:var(--kp-text-body)!important;--tw-prose-headings:var(--kp-text-heading)!important;--tw-prose-links:var(--kp-text-accent)!important;--tw-prose-bold:var(--kp-text-heading)!important;--tw-prose-code:var(--kp-text-heading)!important;--tw-prose-counters:var(--kp-text-body)!important;--tw-prose-bullets:var(--kp-text-placeholder)!important;--tw-prose-hr:var(--kp-border)!important;--tw-prose-quotes:var(--kp-text-body)!important;--tw-prose-quote-borders:var(--kp-border)!important;--tw-prose-th-borders:var(--kp-border)!important;--tw-prose-td-borders:var(--kp-border)!important}nav a,nav button{color:var(--kp-text-body)}nav a:hover,nav button:hover{color:var(--kp-text-heading)}.nav-logo{width:150px!important;height:auto!important}[data-component-part=field-root]{border-color:var(--kp-border)!important}[role=tablist] button[data-state=active]{color:var(--kp-text-heading)!important;border-color:var(--kp-primary)!important}[role=tablist] button[data-state=inactive]{color:var(--kp-text-placeholder)!important}body:has(.kp-welcome-hero) #header{display:none!important}@media (min-width:1024px){.kp-welcome-hero{display:grid;grid-template-columns:1fr 1fr;gap:2rem;align-items:start;margin-bottom:2.5rem}}.prose .kp-welcome-title{font-size:36px!important;line-height:1.15!important;letter-spacing:-.01em;margin:0 0 1rem!important}.kp-welcome-hero-code .code-group{margin-top:0!important;margin-bottom:0!important}.prose a.kp-hero-btn-primary{text-decoration:none!important;border:1px solid var(--kp-primary)!important;background-color:var(--kp-primary);color:var(--kp-bg-card)!important}.prose a.kp-hero-btn-primary:hover{background-color:var(--kp-primary-hover);border-color:var(--kp-primary-hover)!important}html.dark .prose a.kp-hero-btn-primary{color:var(--kp-bg-page)!important}.kp-terminal{background:var(--kp-terminal-bg)!important;border-color:var(--kp-border)!important}.kp-terminal.kp-terminal-card{background:var(--kp-bg-card)!important}.kp-terminal .kp-term-output{color:var(--kp-terminal-text)}.kp-terminal .kp-term-prompt-text{color:var(--kp-terminal-heading)!important}.kp-terminal .kp-term-cursor{background:var(--kp-terminal-heading)!important}.kp-terminal span[aria-hidden=true]:first-child{color:var(--kp-terminal-muted)!important}.kp-term-output,pre code{scrollbar-width:none}.kp-cli-install::-webkit-scrollbar,.kp-term-output::-webkit-scrollbar,pre code::-webkit-scrollbar{display:none}@media (max-width:480px){.kp-term-output{font-size:11px!important;padding:12px 14px!important}}.kp-cli-install{scrollbar-width:none}.kp-cli-copy-btn{transition:color .15s ease}.kp-cli-install:hover .kp-cli-copy-btn{color:var(--kp-text-heading)!important}.kp-cli-install:focus-visible{outline:2px solid var(--kp-brand);outline-offset:-2px}.kp-cli-copy-btn svg{transition:transform .15s ease}.kp-cli-install:hover .kp-cli-copy-btn svg{transform:scale(1.15)}.login-link{display:none!important}"},{"filePath":"global.css","content":"hr{margin-top:1rem!important;margin-bottom:1rem!important}[data-component-part=field-content]{margin-top:.25rem!important}.api-banner{display:flex;align-items:center;gap:.5rem;border:1px solid light-dark(#e5e6ec,#353746);box-shadow:0 0 0 5px light-dark(#fff,#0b0611),0 0 0 6px light-dark(#e5e6ec,#353746);border-radius:1rem;padding:.4rem;margin-bottom:.8rem}.api-banner .api-protocol{color:#fff;font-weight:800;font-size:12px;padding:.1rem .5rem;border-radius:1rem;text-transform:uppercase}.api-banner .api-protocol.ws{background:light-dark(#0079b4,#004e75)}.api-banner .api-protocol.fix{background:light-dark(#a67c1d,#6f5000)}.api-banner .api-detail,.api-banner .api-tag{font-family:var(--kp-font-mono);font-size:14px;color:light-dark(#484b5e,#9497a9)}.api-banner .api-tag{margin-left:auto;font-weight:600;font-size:12px;background:light-dark(#eeeff3,#292b38);color:light-dark(#484b5e,#c6c7d2);padding:.1rem 1.5rem;border-radius:.7rem}div:has(>.nav-tag-pill){order:-1;margin-left:0!important;margin-right:.9rem!important}.prose code:not(pre *){padding-inline:.15em}pre code{font-size:12px!important}[data-component-part=code-block-root],[data-component-part=code-group-tab-content]{line-height:1.25rem!important}#content-side-layout{position:relative!important;top:auto!important;height:auto!important;max-height:none!important}#header .prose{font-size:16px}.field-attr{font-weight:600;font-size:12px;line-height:16px;color:light-dark(#686b82,#9497a9)}"}],"page":{"pagePath":"institutional/guides/prime-websocket-auth","slug":"/institutional/guides/prime-websocket-auth","pageMetadata":{"title":"Prime WebSocket Authentication","description":"How to authenticate WebSocket connections to the Kraken Prime API using HMAC-SHA256 signed headers.","href":"/institutional/guides/prime-websocket-auth"},"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: \"How to authenticate WebSocket connections to the Kraken Prime API using HMAC-SHA256 signed headers.\"\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,Note,Tab,Table,Tabs}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);return _jsxs(_Fragment,{children:[_jsxs(Note,{children:[`Authenticated connection. Connect to: `,_jsx(_components.code,{children:`wss://wss.prime.kraken.com/ws/v1`})]}),`\n`,_jsx(_components.p,{children:`WebSocket connections must be authenticated by signing the request and sending the signature in HTTP headers.`}),`\n`,_jsx(Heading,{level:`2`,id:`connection-headers`,children:`Connection Headers`}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`Header Schema`,id:`header-schema`,children:_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Header`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`ApiKey`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Your Kraken API key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`ApiSign`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`base64-encoded signature`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`ApiTimestamp`})}),_jsx(_components.td,{children:`string`}),_jsxs(_components.td,{children:[`An ISO-8601 UTC string of the form `,_jsx(_components.code,{children:`2019-02-13T05:17:32.000000Z`})]})]})]})]})}),_jsxs(Tab,{title:`Signature Generation`,id:`signature-generation`,children:[_jsx(_components.p,{children:`The signature is a base64 encoded sha256 HMAC using the API secret of the following:`}),_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET\\\\n\u003cApiTimestamp>\\\\n\u003chost>\\\\n\u003cpath>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsx(_components.p,{children:`For example:`}),_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET\\\\n2019-02-13T05:17:32.000000Z\\\\nwss.sandbox.prime.kraken.com\\\\n/ws/v1`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),_jsx(Tab,{title:`Python Example`,id:`python-example`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`40`,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:`40`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# to install websocket lib:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# $ pip install websocket-client`})}),`\n`,_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:` websocket `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` create_connection`})]}),`\n`,_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:` datetime`})]}),`\n`,_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:` hmac`})]}),`\n`,_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:` hashlib`})]}),`\n`,_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:` base64`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`api_key `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\u003capikey>\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`api_secret `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\u003capisecret>\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`utc_now `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` datetime.datetime.utcnow()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`utc_datetime `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` utc_now.strftime(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"%Y-%m-`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`%d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`T%H:%M:%S.000000Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`host `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\u003cwebsocket host>\"`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # wss.sandbox.prime.kraken.com, for example`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`path `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"/ws/v1\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`params `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.join([`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"GET\"`}),_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:` utc_datetime,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` host,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` path,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`hash`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` hmac.new(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` api_secret.encode(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'ascii'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), params.encode(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'ascii'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), hashlib.sha256)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`hash`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.hexdigest()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`signature `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` base64.urlsafe_b64encode(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`hash`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.digest()).decode()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`header `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"ApiKey\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: api_key,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"ApiSign\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: signature,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"ApiTimestamp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: utc_datetime,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ws `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` create_connection(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"wss://\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` host `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`+`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` path, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`header`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`header)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\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:`(ws.recv())`})]}),`\n`]})})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`environments`,children:`Environments`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Environment`}),_jsx(_components.th,{children:`WebSocket Endpoint`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Sandbox`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`wss://wss.sandbox.prime.kraken.com/ws/v1`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Production`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`wss://wss.prime.kraken.com/ws/v1`})})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`api-keys`,children:`API Keys`}),`\n`,_jsxs(_components.p,{children:[`For initial Prime access and onboarding, contact Kraken support at `,_jsx(_components.a,{href:`mailto:prime_trading@kraken.com`,children:`prime_trading@kraken.com`}),` or your Account Manager.`]}),`\n`,_jsxs(_components.p,{children:[`After your Prime account is onboarded, you can create and manage API keys self-service from the `,_jsx(_components.a,{href:`https://pro.kraken.com/app/prime/api-settings`,children:`Prime UI API settings`}),`. Sign in with your standard Kraken Pro credentials.`]}),`\n`,_jsx(_components.p,{children:`You will need separate API keys for the sandbox and production environments.`}),`\n`,_jsx(Heading,{level:`2`,id:`rate-limits`,children:`Rate Limits`}),`\n`,_jsxs(_components.p,{children:[`There is no limit to how many concurrent websocket connections you’re allowed, though this may change in the future. If you expect to have more than ~10 active connections, please contact `,_jsx(_components.a,{href:`mailto:prime_trading@kraken.com`,children:`prime_trading@kraken.com`}),`.`]})]})}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":"Prime WebSocket Authentication","description":"How to authenticate WebSocket connections to the Kraken Prime API using HMAC-SHA256 signed headers.","href":"/institutional/guides/prime-websocket-auth"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Connection Headers","slug":"connection-headers","depth":2,"children":[]},{"title":"Environments","slug":"environments","depth":2,"children":[]},{"title":"API Keys","slug":"api-keys","depth":2,"children":[]},{"title":"Rate Limits","slug":"rate-limits","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"kraken","siteName":"Kraken Developers","title":"Prime WebSocket Authentication - Kraken Developers","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-13T14:25:35.037Z","originalFileLocation":"institutional/guides/prime-websocket-auth.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=\"How to authenticate WebSocket connections to the Kraken Prime API using HMAC-SHA256 signed headers.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Kraken Developers\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/kraken/WtiP_7MUCtGxw5vL/_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/kraken/WtiP_7MUCtGxw5vL/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/kraken/WtiP_7MUCtGxw5vL/_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/kraken/WtiP_7MUCtGxw5vL/_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/kraken/WtiP_7MUCtGxw5vL/_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/kraken/WtiP_7MUCtGxw5vL/_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/kraken/WtiP_7MUCtGxw5vL/_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/kraken/WtiP_7MUCtGxw5vL/_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/kraken/WtiP_7MUCtGxw5vL/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Prime WebSocket Authentication - Kraken Developers\">\u003cmeta data-mint-head property=\"og:description\" content=\"How to authenticate WebSocket connections to the Kraken Prime API using HMAC-SHA256 signed headers.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Kraken Developers\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.kraken.com/institutional/guides/prime-websocket-auth\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://kraken.mintlify.app/_mintlify/api/og/v2?division=Authentication\u0026amp;title=Prime+WebSocket+Authentication\u0026amp;description=How+to+authenticate+WebSocket+connections+to+the+Kraken+Prime+API+using+HMAC-SHA256+signed+headers.\u0026amp;theme=5c8759ca94ea0060c63352cf\u0026amp;signature=06e2b2a304bf673721601f0e455ed076649bf693a2f628fbd6e9c6b00eb24892\">\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=\"Prime WebSocket Authentication - Kraken Developers\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How to authenticate WebSocket connections to the Kraken Prime API using HMAC-SHA256 signed headers.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://kraken.mintlify.app/_mintlify/api/og/v2?division=Authentication\u0026amp;title=Prime+WebSocket+Authentication\u0026amp;description=How+to+authenticate+WebSocket+connections+to+the+Kraken+Prime+API+using+HMAC-SHA256+signed+headers.\u0026amp;theme=5c8759ca94ea0060c63352cf\u0026amp;signature=06e2b2a304bf673721601f0e455ed076649bf693a2f628fbd6e9c6b00eb24892\">\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/kraken/WtiP_7MUCtGxw5vL/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Kraken Developers\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#101114\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.kraken.com/institutional/guides/prime-websocket-auth\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/institutional/guides/prime-websocket-auth.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.kraken.com/#organization\",\"name\":\"Kraken Developers\",\"url\":\"https://docs.kraken.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/kraken/opwCJHYUnRFWd1O3/logo/light.svg?fit=max\u0026auto=format\u0026n=opwCJHYUnRFWd1O3\u0026q=85\u0026s=6be2f97a23f9a7aa6ef071ae334cc89c\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.kraken.com#website\",\"name\":\"Kraken Developers\",\"url\":\"https://docs.kraken.com\",\"publisher\":{\"@id\":\"https://docs.kraken.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.kraken.com/institutional/guides/prime-websocket-auth#webpage\",\"url\":\"https://docs.kraken.com/institutional/guides/prime-websocket-auth\",\"name\":\"Prime WebSocket Authentication\",\"description\":\"How to authenticate WebSocket connections to the Kraken Prime API using HMAC-SHA256 signed headers.\",\"dateModified\":\"2026-07-13T14:25:35.037Z\",\"isPartOf\":{\"@id\":\"https://docs.kraken.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.kraken.com/institutional/guides/prime-websocket-auth#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.kraken.com/institutional/guides/prime-websocket-auth#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Authentication\",\"item\":\"https://docs.kraken.com/institutional/guides/custody-rest-auth\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Prime WebSocket Authentication\",\"item\":\"https://docs.kraken.com/institutional/guides/prime-websocket-auth\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.kraken.com/institutional/guides/prime-websocket-auth#article\",\"headline\":\"Prime WebSocket Authentication\",\"name\":\"Prime WebSocket Authentication\",\"description\":\"How to authenticate WebSocket connections to the Kraken Prime API using HMAC-SHA256 signed headers.\",\"url\":\"https://docs.kraken.com/institutional/guides/prime-websocket-auth\",\"mainEntityOfPage\":{\"@id\":\"https://docs.kraken.com/institutional/guides/prime-websocket-auth#webpage\"},\"dateModified\":\"2026-07-13T14:25:35.037Z\",\"publisher\":{\"@id\":\"https://docs.kraken.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.kraken.com#website\"}}]}\u003c/script>","siteName":"Kraken Developers","nav":{"global":{},"products":[{"product":"Home","pages":[{"title":"Home","href":""}]},{"product":"Exchange","pages":[{"title":"Exchange","href":"/exchange/guides/overview"}]},{"product":"Institutional","tabs":[{"tab":"Guides","groups":[{"group":"Getting started","public":true,"pages":[{"title":"Institutional overview","href":"/institutional/guides/overview"}]},{"group":"Authentication","public":true,"pages":[{"title":"Custody REST Authentication","description":"How to authenticate API requests to the Custody REST API using API keys, signatures, and nonces.","href":"/institutional/guides/custody-rest-auth"},{"title":"Prime WebSocket Authentication","href":"/institutional/guides/prime-websocket-auth"}]}]},{"tab":"API Reference","dropdowns":[{"dropdown":"Overview","icon":"compass","pages":[{"title":"Institutional API reference","sidebarTitle":"Overview","description":"OTC, Custody, and Prime — pick the service and protocol for your workflow","href":"/institutional/api-reference/overview"}]},{"dropdown":"Custody REST","icon":"code","pages":[{"title":"Custody REST overview","sidebarTitle":"Overview","href":"/institutional/api-reference/custody-rest"},{"group":"Portfolios","public":true,"hidden":true,"pages":[{"title":"List vaults","deprecated":null,"version":null,"openapi":"/openapi/custody-rest.yaml post /0/private/ListCustodyVaults","href":"/api-reference/portfolios/list-vaults"},{"title":"Get vault information by id","deprecated":null,"version":null,"openapi":"/openapi/custody-rest.yaml post /0/private/GetCustodyVault","href":"/api-reference/portfolios/get-vault-information-by-id"},{"title":"Get deposit methods","deprecated":null,"version":null,"openapi":"/openapi/custody-rest.yaml post /0/private/DepositMethods","href":"/api-reference/portfolios/get-deposit-methods"},{"title":"Get deposit addresses","deprecated":null,"version":null,"openapi":"/openapi/custody-rest.yaml post /0/private/DepositAddresses","href":"/api-reference/portfolios/get-deposit-addresses"},{"title":"Get custody balance","deprecated":null,"version":null,"openapi":"/openapi/custody-rest.yaml post /0/private/GetCustodyBalance","href":"/api-reference/portfolios/get-custody-balance"},{"title":"List custody transactions","deprecated":null,"version":null,"openapi":"/openapi/custody-rest.yaml post /0/private/ListCustodyTransactions","href":"/api-reference/portfolios/list-custody-transactions"},{"title":"Get transaction by id","deprecated":null,"version":null,"openapi":"/openapi/custody-rest.yaml post /0/private/GetCustodyTransaction","href":"/api-reference/portfolios/get-transaction-by-id"}]},{"group":"Transfers","public":true,"hidden":true,"pages":[{"title":"Get withdraw methods","deprecated":null,"version":null,"openapi":"/openapi/custody-rest.yaml post /0/private/WithdrawMethods","href":"/api-reference/transfers/get-withdraw-methods"},{"title":"Get withdraw addresses","deprecated":null,"version":null,"openapi":"/openapi/custody-rest.yaml post /0/private/WithdrawAddresses","href":"/api-reference/transfers/get-withdraw-addresses"}]},{"group":"Tasks","public":true,"hidden":true,"pages":[{"title":"List tasks","deprecated":null,"version":null,"openapi":"/openapi/custody-rest.yaml post /0/private/ListCustodyTasks","href":"/api-reference/tasks/list-tasks"},{"title":"Get task by id","deprecated":null,"version":null,"openapi":"/openapi/custody-rest.yaml post /0/private/GetCustodyTask","href":"/api-reference/tasks/get-task-by-id"},{"title":"List activities","deprecated":null,"version":null,"openapi":"/openapi/custody-rest.yaml post /0/private/ListCustodyActivities","href":"/api-reference/tasks/list-activities"},{"title":"Get activity by id","deprecated":null,"version":null,"openapi":"/openapi/custody-rest.yaml post /0/private/GetCustodyActivity","href":"/api-reference/tasks/get-activity-by-id"}]},{"group":"Assets (v0)","public":true,"pages":[{"title":"List assets","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/assets","href":"/api-reference/custody-external-api/list-assets"}]},{"group":"Organizations (v0)","public":true,"pages":[{"title":"List organizations","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/organizations","href":"/api-reference/custody-external-api/list-organizations"},{"title":"List balances","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/organizations/{org_iiban}/balances","href":"/api-reference/custody-external-api/list-balances"}]},{"group":"Vaults (v0)","public":true,"pages":[{"title":"List vaults","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/vaults","href":"/api-reference/custody-external-api/list-vaults"},{"title":"Get vault","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/vaults/{vault_id}","href":"/api-reference/custody-external-api/get-vault"},{"title":"Get vault balance","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/vaults/{vault_id}/balances","href":"/api-reference/custody-external-api/get-vault-balance"},{"title":"List vault asset balances","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/vaults/{vault_id}/assets/balances","href":"/api-reference/custody-external-api/list-vault-asset-balances"},{"title":"List vault policies","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/vaults/{vault_id}/policies","href":"/api-reference/custody-external-api/list-vault-policies"}]},{"group":"Deposits (v0)","public":true,"pages":[{"title":"List deposit methods","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/vaults/{vault_id}/deposit-methods","href":"/api-reference/custody-external-api/list-deposit-methods"},{"title":"List deposit addresses","deprecated":null,"version":null,"sidebarTitle":"List deposit addresses","openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/vaults/{vault_id}/deposit-methods/{method_id}/addresses","href":"/api-reference/custody-external-api/list-deposit-addresses"},{"title":"Create address","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml post /v0/insto/custody/vaults/{vault_id}/deposit-methods/{method_id}/addresses","href":"/api-reference/custody-external-api/create-address"},{"title":"Get deposit info","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/vaults/{vault_id}/deposits/info","href":"/api-reference/custody-external-api/get-deposit-info"}]},{"group":"Withdrawals (v0)","public":true,"pages":[{"title":"List whitelist addresses","deprecated":null,"version":null,"sidebarTitle":"List whitelist addresses","openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/vaults/{vault_id}/whitelist/addresses","href":"/api-reference/custody-external-api/list-whitelist-addresses"},{"title":"List withdrawal methods","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/vaults/{vault_id}/withdrawal-methods","href":"/api-reference/custody-external-api/list-withdrawal-methods"},{"title":"Get withdrawal info","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/vaults/{vault_id}/withdrawals/info","href":"/api-reference/custody-external-api/get-withdrawal-info"},{"title":"Create withdrawal fee quote","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml post /v0/insto/custody/vaults/{vault_id}/withdrawals/fee-quotes","href":"/api-reference/custody-external-api/create-withdrawal-fee-quote"}]},{"group":"Tasks (v0)","public":true,"pages":[{"title":"List tasks","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/tasks","href":"/api-reference/custody-external-api/list-tasks"},{"title":"Create task","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml post /v0/insto/custody/tasks","href":"/api-reference/custody-external-api/create-task"},{"title":"List task activities","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/tasks/activities","href":"/api-reference/custody-external-api/list-task-activities"},{"title":"Get task by id","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/tasks/{task_id}","href":"/api-reference/custody-external-api/get-task-by-id"},{"title":"Get task activity by id","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/tasks/activities/{activity_id}","href":"/api-reference/custody-external-api/get-task-activity-by-id"},{"title":"Review task","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml post /v0/insto/custody/tasks/{task_id}/review","href":"/api-reference/custody-external-api/review-task"}]},{"group":"Transactions (v0)","public":true,"pages":[{"title":"List transactions","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/vaults/{vault_id}/transactions","href":"/api-reference/custody-external-api/list-transactions"},{"title":"Get transaction","deprecated":null,"version":null,"openapi":"/openapi/insto-custody-rest.yaml get /v0/insto/custody/vaults/{vault_id}/transactions/{transaction_id}","href":"/api-reference/custody-external-api/get-transaction"}]}]},{"dropdown":"OTC REST","icon":"code","pages":[{"title":"OTC REST","href":"/institutional/api-reference/otc-rest"},{"group":"Quotes","public":true,"pages":[{"title":"Create OTC Quote","deprecated":null,"version":null,"openapi":"/openapi/otc-rest.yaml post /private/CreateOtcQuoteRequest","href":"/api-reference/quotes/create-otc-quote"},{"title":"Update OTC Quote","deprecated":null,"version":null,"openapi":"/openapi/otc-rest.yaml post /private/UpdateOtcQuote","href":"/api-reference/quotes/update-otc-quote"},{"title":"Get OTC Pairs","deprecated":null,"version":null,"openapi":"/openapi/otc-rest.yaml post /private/GetOtcPairs","href":"/api-reference/quotes/get-otc-pairs"},{"title":"Get OTC Active Quotes","deprecated":null,"version":null,"openapi":"/openapi/otc-rest.yaml post /private/GetOtcActiveQuotes","href":"/api-reference/quotes/get-otc-active-quotes"},{"title":"Get OTC Historical Quotes","deprecated":null,"version":null,"openapi":"/openapi/otc-rest.yaml post /private/GetOtcHistoricalQuotes","href":"/api-reference/quotes/get-otc-historical-quotes"},{"title":"Get OTC Exposures","deprecated":null,"version":null,"openapi":"/openapi/otc-rest.yaml post /private/GetOtcExposures","href":"/api-reference/quotes/get-otc-exposures"},{"title":"Check OTC Eligibility","deprecated":null,"version":null,"openapi":"/openapi/otc-rest.yaml post /private/CheckOtcClient","href":"/api-reference/quotes/check-otc-eligibility"}]},{"group":"Trades","public":true,"pages":[{"title":"Get OTC Spot Trade History","deprecated":null,"version":null,"openapi":"/openapi/otc-rest.yaml post /private/GetOtcSpotTradeHistory","href":"/api-reference/trades/get-otc-spot-trade-history"},{"title":"Get OTC Options Trade History","deprecated":null,"version":null,"openapi":"/openapi/otc-rest.yaml post /private/GetOtcOptionsTradeHistory","href":"/api-reference/trades/get-otc-options-trade-history"}]}]},{"dropdown":"Prime REST","icon":"code","pages":[{"title":"Prime REST","sidebarTitle":"Prime REST","href":"/institutional/api-reference/prime-rest"},{"group":"API Users","public":true,"pages":[{"title":"Create Prime API User","deprecated":null,"version":null,"openapi":"/openapi/prime-rest.yaml post /0/private/CreatePrimeApiUser","href":"/api-reference/api-users/create-prime-api-user"},{"title":"Get Prime API User","deprecated":null,"version":null,"openapi":"/openapi/prime-rest.yaml post /0/private/GetPrimeApiUser","href":"/api-reference/api-users/get-prime-api-user"},{"title":"List Prime API Users","deprecated":null,"version":null,"openapi":"/openapi/prime-rest.yaml post /0/private/ListPrimeApiUsers","href":"/api-reference/api-users/list-prime-api-users"},{"title":"Update Prime API User","deprecated":null,"version":null,"openapi":"/openapi/prime-rest.yaml post /0/private/UpdatePrimeApiUser","href":"/api-reference/api-users/update-prime-api-user"},{"title":"Update Prime API User Roles","deprecated":null,"version":null,"openapi":"/openapi/prime-rest.yaml post /0/private/UpdatePrimeApiUserRoles","href":"/api-reference/api-users/update-prime-api-user-roles"}]},{"group":"API User Keys","public":true,"pages":[{"title":"Create Prime API User Key","deprecated":null,"version":null,"openapi":"/openapi/prime-rest.yaml post /0/private/CreatePrimeApiUserKey","href":"/api-reference/api-user-keys/create-prime-api-user-key"},{"title":"List Prime API User Keys","deprecated":null,"version":null,"openapi":"/openapi/prime-rest.yaml post /0/private/ListPrimeApiUserKeys","href":"/api-reference/api-user-keys/list-prime-api-user-keys"},{"title":"Update Prime API User Key","deprecated":null,"version":null,"openapi":"/openapi/prime-rest.yaml post /0/private/UpdatePrimeApiUserKey","href":"/api-reference/api-user-keys/update-prime-api-user-key"},{"title":"Delete Prime API User Key","deprecated":null,"version":null,"openapi":"/openapi/prime-rest.yaml post /0/private/DeletePrimeApiUserKey","href":"/api-reference/api-user-keys/delete-prime-api-user-key"}]},{"group":"Settlement","public":true,"pages":[{"title":"Create Prime Settlement Batch","deprecated":null,"version":null,"openapi":"/openapi/prime-rest.yaml post /0/private/CreatePrimeSettlementBatch","href":"/api-reference/settlement/create-prime-settlement-batch"},{"title":"Get Prime Settlement Batch","deprecated":null,"version":null,"openapi":"/openapi/prime-rest.yaml post /0/private/GetPrimeSettlementBatch","href":"/api-reference/settlement/get-prime-settlement-batch"},{"title":"List Prime Settlement Batches","deprecated":null,"version":null,"openapi":"/openapi/prime-rest.yaml post /0/private/ListPrimeSettlementBatches","href":"/api-reference/settlement/list-prime-settlement-batches"},{"title":"Settle Prime Settlement Batch Asset","deprecated":null,"version":null,"openapi":"/openapi/prime-rest.yaml post /0/private/SettlePrimeSettlementBatchAsset","href":"/api-reference/settlement/settle-prime-settlement-batch-asset"}]}]},{"dropdown":"Prime FIX","icon":"terminal","groups":[{"group":"Session","public":true,"pages":[{"title":"Logon","href":"/institutional/api-reference/prime-fix/logon"},{"title":"Logout","href":"/institutional/api-reference/prime-fix/logout"},{"title":"Header \u0026 Trailer","sidebarTitle":"Header \u0026 Trailer","href":"/institutional/api-reference/prime-fix/header-trailer"},{"title":"Heartbeat","href":"/institutional/api-reference/prime-fix/heartbeat"},{"title":"Test Request","href":"/institutional/api-reference/prime-fix/test-request"},{"title":"Resend Request","href":"/institutional/api-reference/prime-fix/resend-request"},{"title":"Sequence Reset","href":"/institutional/api-reference/prime-fix/sequence-reset"},{"title":"Session Reject","href":"/institutional/api-reference/prime-fix/session-reject"}]},{"group":"Order Management","public":true,"pages":[{"title":"New Order Single","href":"/institutional/api-reference/prime-fix/nos"},{"title":"Order Cancel Request","href":"/institutional/api-reference/prime-fix/ocr"},{"title":"Order Cancel Replace Request","sidebarTitle":"Order Cancel Replace","href":"/institutional/api-reference/prime-fix/ocrr"},{"title":"Order Cancel Reject","sidebarTitle":"Order Cancel Reject","href":"/institutional/api-reference/prime-fix/ocrej"},{"title":"Execution Report","href":"/institutional/api-reference/prime-fix/er"}]},{"group":"Security List","public":true,"pages":[{"title":"Security List","href":"/institutional/api-reference/prime-fix/sl"},{"title":"Security List Request","href":"/institutional/api-reference/prime-fix/slr"}]},{"group":"Market Data","public":true,"pages":[{"title":"Market Data Request","href":"/institutional/api-reference/prime-fix/mdr"},{"title":"Market Data Request Reject","sidebarTitle":"Market Data Request Reject","href":"/institutional/api-reference/prime-fix/mdrr"},{"title":"Market Data Snapshot Full Refresh","sidebarTitle":"Market Data Snapshot","href":"/institutional/api-reference/prime-fix/mdsfr"}]}]},{"dropdown":"Prime WebSocket","icon":"bolt","groups":[{"group":"Connection","public":true,"pages":[{"title":"Authentication","href":"/institutional/api-reference/prime-websocket/authentication"},{"title":"Hello","href":"/institutional/api-reference/prime-websocket/hello"},{"title":"Ping","href":"/institutional/api-reference/prime-websocket/ping"}]},{"group":"Subscription Management","public":true,"pages":[{"title":"Subscribe","href":"/institutional/api-reference/prime-websocket/subscribe"},{"title":"Continue Paged Stream","href":"/institutional/api-reference/prime-websocket/page"},{"title":"Cancel Stream","href":"/institutional/api-reference/prime-websocket/cancel"}]},{"group":"Order Management","public":true,"pages":[{"title":"New Order Single","sidebarTitle":"New Order Single","href":"/institutional/api-reference/prime-websocket/new-order-single"},{"title":"Order Cancel Request","sidebarTitle":"Order Cancel Request","href":"/institutional/api-reference/prime-websocket/order-cancel-request"},{"title":"Order Cancel Replace Request","sidebarTitle":"Order Cancel Replace","href":"/institutional/api-reference/prime-websocket/order-cancel-replace-request"},{"title":"Order Control Request","sidebarTitle":"Order Control Request","href":"/institutional/api-reference/prime-websocket/order-control-request"},{"title":"Order Updates","sidebarTitle":"Order Updates","href":"/institutional/api-reference/prime-websocket/order"},{"title":"Execution Report","sidebarTitle":"Execution Report","href":"/institutional/api-reference/prime-websocket/execution-report"}]},{"group":"Market Data","public":true,"pages":[{"title":"Security","href":"/institutional/api-reference/prime-websocket/security"},{"title":"Market Data Snapshot","sidebarTitle":"Market Data Snapshot","href":"/institutional/api-reference/prime-websocket/market-data-snapshot"}]},{"group":"Account","public":true,"pages":[{"title":"Balance","href":"/institutional/api-reference/prime-websocket/balance"},{"title":"Trade","href":"/institutional/api-reference/prime-websocket/trade"},{"title":"Exposure","href":"/institutional/api-reference/prime-websocket/exposure"},{"title":"User","href":"/institutional/api-reference/prime-websocket/user"},{"title":"User Config","sidebarTitle":"User Config","href":"/institutional/api-reference/prime-websocket/user-config"}]},{"group":"RFQ","public":true,"pages":[{"title":"Quote Request","sidebarTitle":"Quote Request","href":"/institutional/api-reference/prime-websocket/quote-request"},{"title":"Quote Updates","sidebarTitle":"Quote Updates","href":"/institutional/api-reference/prime-websocket/quote"},{"title":"Quote Cancel Request","sidebarTitle":"Quote Cancel Request","href":"/institutional/api-reference/prime-websocket/quote-cancel-request"}]},{"group":"Reference Data","public":true,"pages":[{"title":"Currency","href":"/institutional/api-reference/prime-websocket/currency"},{"title":"Currency Conversion","sidebarTitle":"Currency Conversion","href":"/institutional/api-reference/prime-websocket/currency-conversion"}]}]}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/institutional/changelog"}]}]},{"product":"Pay","pages":[{"title":"Pay","href":"/pay/guides/pay-webhook"}]},{"product":"Nodes","hidden":true,"pages":[{"title":"Nodes","href":"/nodes/guides/introduction"}]}]},"basePath":"","title":"Prime WebSocket Authentication - Kraken Developers","buildId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","deploymentId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","dynamics":[],"chunks":[]}