Mints a key for the active organization. It acts with the caller’s role, read from their membership on every request, so it can never outrank them. The response is the only time the token is readable.
The credential itself, to send in the X-API-Key header. Only the digest is stored, so this is the only time it is readable.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Twinbay","colors":{"primary":"#57534E","light":"#FAFAF9","dark":"#292524"},"logo":"https://mintcdn.com/twinbay/cPRPaMghR8z1tiY-/logo/dark.svg?fit=max\u0026auto=format\u0026n=cPRPaMghR8z1tiY-\u0026q=85\u0026s=20e156647ecab455844ff5204078db69","favicon":"https://mintcdn.com/twinbay/cPRPaMghR8z1tiY-/favicon.svg?fit=max\u0026auto=format\u0026n=cPRPaMghR8z1tiY-\u0026q=85\u0026s=d176910ad8d6a305f2583034aab5706c","appearance":{"default":"dark","strict":true},"background":{"color":{"light":"#FAFAF9","dark":"#110F0D"}},"navbar":{"links":[{"href":"mailto:hi@twinbay.ai","label":"Support"}],"primary":{"type":"button","label":"Console","href":"https://console.twinbay.ai"}},"footer":{"socials":{"github":"https://github.com/panoratech","linkedin":"https://linkedin.com/company/panora"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"twinbay","hasAudioNarration":false,"actualSubdomain":"twinbay","customDomains":["docs.twinbay.ai"],"gitSource":{"type":"github","owner":"panoratech","repo":"twinbay","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6acebf8b83448a92e2f95934","collectionId":"84be5f09-fa60-4678-9b31-41358654c944","liveDeploymentHistoryId":"6acebf8b83448a92e2f95934","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6acebf8b83448a92e2f95934","clientVersion":"0.0.4021","searchFilterCounts":[{"language":"default","tag":"API Reference","count":64},{"language":"default","tag":"Documentation","count":27},{"language":"default","tag":"Concepts","count":22},{"language":"default","tag":"Every twin","count":20},{"language":"default","tag":"tests","count":16},{"language":"default","tag":"environments","count":9},{"language":"default","tag":"organizations","count":8},{"language":"default","tag":"twins","count":7},{"language":"default","tag":"billing","count":6},{"language":"default","tag":"scenarios","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/api-keys/create-an-api-key","slug":"/api-reference/api-keys/create-an-api-key","pageMetadata":{"title":"Create an API key","description":"Mints a key for the active organization. It acts with the caller's role, read from their membership on every request, so it can never outrank them. The response is the only time the token is readable.","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /organizations/current/api-keys","href":"/api-reference/api-keys/create-an-api-key","autogeneratedByOpenApi":true},"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: \"Mints a key for the active organization. It acts with the caller’s role, read from their membership on every request, so it can never outrank them. The response is the only time the token is readable.\"\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}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Create an API key","description":"Mints a key for the active organization. It acts with the caller's role, read from their membership on every request, so it can never outrank them. The response is the only time the token is readable.","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /organizations/current/api-keys","href":"/api-reference/api-keys/create-an-api-key","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["api-keys"],"summary":"Create an API key","description":"Mints a key for the active organization. It acts with the caller's role, read from their membership on every request, so it can never outrank them. The response is the only time the token is readable.","operationId":"create_api_key","security":["bf8427ee-adb3-4721-98c3-3f35932d616b","386bbff4-9da9-483c-9cce-e6ba7696886e"],"requestBody":"63987c9d-c855-4de3-80fa-6a0f667a1d15","responses":{"201":"92e8c399-325b-4417-aa35-6bc1edb434fc","401":"8a28813c-1de8-4d78-b4ee-d11079846325","403":"e094a02f-abaa-4b63-8764-c88b0ba90ddc","422":"1e97ec3e-54b5-4a06-9e29-a70162fc42d5"},"method":"post","type":"path","servers":["217c7a46-4f67-4fb6-89c7-ef524342a9e2"],"path":"/organizations/current/api-keys","baseUrlOptions":["https://api.twinbay.ai"],"title":"Create an API key","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"What this key is for, in the operator's words","isRequired":true,"uniqueKey":"name","typeLabel":"string"},"expires_at":{"oneOf":[{"type":"string","title":"Expires At","description":"When the key stops working on its own. Omitted or null for a key that only stops when it is revoked.","format":"date-time","uniqueKey":"expires_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","title":"Expires At","description":"When the key stops working on its own. Omitted or null for a key that only stops when it is revoked.","uniqueKey":"expires_at.oneOf.1","typeLabel":"null"}],"uniqueKey":"expires_at","typeLabel":"string\u003cdate-time> | null"}},"additionalProperties":false,"type":"object","required":["name"],"title":"CreateApiKeyRequest","uniqueKey":"","typeLabel":"CreateApiKeyRequest · object"},"examples":{"Example":{"title":"Example","value":{"name":"\u003cstring>","expires_at":"2023-11-07T05:31:56Z"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"92e8c399-325b-4417-aa35-6bc1edb434fc":{"description":"The new key, including its token","content":{"application/json":{"schema":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","isRequired":true,"uniqueKey":"id","typeLabel":"string\u003cuuid>"},"name":{"type":"string","title":"Name","isRequired":true,"uniqueKey":"name","typeLabel":"string"},"created_at":{"type":"string","format":"date-time","title":"Created At","isRequired":true,"uniqueKey":"created_at","typeLabel":"string\u003cdate-time>"},"expires_at":{"oneOf":[{"type":"string","title":"Expires At","description":"When the key stops working, or null when it never does","format":"date-time","isRequired":true,"uniqueKey":"expires_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"type":"null","title":"Expires At","description":"When the key stops working, or null when it never does","isRequired":true,"uniqueKey":"expires_at.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"expires_at","typeLabel":"string\u003cdate-time> | null"},"created_by":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","isRequired":true,"uniqueKey":"created_by.id","typeLabel":"string\u003cuuid>"},"email":{"type":"string","format":"email","title":"Email","isRequired":true,"uniqueKey":"created_by.email","typeLabel":"string\u003cemail>"},"first_name":{"type":"string","title":"First Name","isRequired":true,"uniqueKey":"created_by.first_name","typeLabel":"string"},"last_name":{"type":"string","title":"Last Name","isRequired":true,"uniqueKey":"created_by.last_name","typeLabel":"string"}},"type":"object","required":["id","email","first_name","last_name"],"title":"UserResponse","description":"The member whose role the key acts with. Demoting or removing them changes what the key can do.","isRequired":true,"uniqueKey":"created_by","typeLabel":"UserResponse · object"},"token":{"type":"string","title":"Token","description":"The credential itself, to send in the `X-API-Key` header. Only the digest is stored, so this is the only time it is readable.","isRequired":true,"uniqueKey":"token","typeLabel":"string"}},"type":"object","required":["id","name","created_at","expires_at","created_by","token"],"title":"CreatedApiKeyResponse","uniqueKey":"","typeLabel":"CreatedApiKeyResponse · object"},"examples":{"Example":{"title":"Example","value":{"id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","name":"\u003cstring>","created_at":"2023-11-07T05:31:56Z","expires_at":"2023-11-07T05:31:56Z","created_by":{"id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","email":"jsmith@example.com","first_name":"\u003cstring>","last_name":"\u003cstring>"},"token":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"8a28813c-1de8-4d78-b4ee-d11079846325":{"description":"The credential is missing, malformed, expired, or not trusted","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"e094a02f-abaa-4b63-8764-c88b0ba90ddc":{"description":"The credential does not act inside an organization, or it is an API key","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"1e97ec3e-54b5-4a06-9e29-a70162fc42d5":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"oneOf":[{"type":"string","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.1","typeLabel":"integer"}],"uniqueKey":"detail.items.[INDEX].loc.items.[INDEX]","typeLabel":"string | integer"},"type":"array","title":"Location","isRequired":true,"uniqueKey":"detail.items.[INDEX].loc","typeLabel":"(string | integer)[]"},"msg":{"type":"string","title":"Message","isRequired":true,"uniqueKey":"detail.items.[INDEX].msg","typeLabel":"string"},"type":{"type":"string","title":"Error Type","isRequired":true,"uniqueKey":"detail.items.[INDEX].type","typeLabel":"string"},"input":{"oneOf":[{"title":"Input"}],"uniqueKey":"detail.items.[INDEX].input","typeLabel":"any"},"ctx":{"type":"object","title":"Context","uniqueKey":"detail.items.[INDEX].ctx","typeLabel":"Context · object"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError","uniqueKey":"detail.items.[INDEX]","typeLabel":"ValidationError · object"},"type":"array","title":"Detail","uniqueKey":"detail","typeLabel":"ValidationError · object[]"}},"type":"object","title":"HTTPValidationError","uniqueKey":"","typeLabel":"HTTPValidationError · object"},"examples":{"Example":{"title":"Example","value":{"detail":[{"loc":["\u003cstring>"],"msg":"\u003cstring>","type":"\u003cstring>","input":"\u003cunknown>","ctx":{}}]}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"bf8427ee-adb3-4721-98c3-3f35932d616b":{"Access token":{"type":"http","description":"Access token issued by WorkOS AuthKit.","scheme":"bearer","scopes":[],"schemeName":"Access token"}},"386bbff4-9da9-483c-9cce-e6ba7696886e":{"Organization API key":{"type":"apiKey","description":"An organization API key. Create one at https://console.twinbay.ai/api-keys","in":"header","name":"X-API-Key","scopes":[],"schemeName":"Organization API key"}}},"servers":{"217c7a46-4f67-4fb6-89c7-ef524342a9e2":{"url":"https://api.twinbay.ai","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","description":"Access token issued by WorkOS AuthKit.","scheme":"bearer","scopes":[],"schemeName":"Access token"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Access token issued by WorkOS AuthKit.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"Access token","name":"Authorization"}],"title":"Access token"},{"schemes":[{"scheme":{"type":"apiKey","description":"An organization API key. Create one at https://console.twinbay.ai/api-keys","in":"header","name":"X-API-Key","scopes":[],"schemeName":"Organization API key"},"schema":{"title":"X-API-Key","type":"string","description":"An organization API key. Create one at https://console.twinbay.ai/api-keys","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"Organization API key","name":"X-API-Key"}],"title":"Organization API key"}]},"originalFileLocation":"https://api.twinbay.ai/openapi.json"},"subdomain":"twinbay","siteName":"Twinbay","title":"Create an API key - Twinbay","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-08T04:57:25.144Z","originalFileLocation":"api-reference/api-keys/create-an-api-key.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";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=\"Mints a key for the active organization. It acts with the caller\u0026#x27;s role, read from their membership on every request, so it can never outrank them. The response is the only time the token is readable.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Twinbay\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/twinbay/5-c_Iv2_jRdSq35Q/_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/twinbay/5-c_Iv2_jRdSq35Q/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/twinbay/5-c_Iv2_jRdSq35Q/_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/twinbay/5-c_Iv2_jRdSq35Q/_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/twinbay/5-c_Iv2_jRdSq35Q/_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/twinbay/5-c_Iv2_jRdSq35Q/_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/twinbay/5-c_Iv2_jRdSq35Q/_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/twinbay/5-c_Iv2_jRdSq35Q/_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/twinbay/5-c_Iv2_jRdSq35Q/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create an API key - Twinbay\">\u003cmeta data-mint-head property=\"og:description\" content=\"Mints a key for the active organization. It acts with the caller\u0026#x27;s role, read from their membership on every request, so it can never outrank them. The response is the only time the token is readable.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Twinbay\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.twinbay.ai/api-reference/api-keys/create-an-api-key\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://twinbay.mintlify.app/_mintlify/api/og/v2?division=api-keys\u0026amp;title=Create+an+API+key\u0026amp;description=Mints+a+key+for+the+active+organization.+It+acts+with+the+caller%27s+role%2C+read+from+their+membership+on+every+request%2C+so+it+can+never+outrank+them.+The+response\u0026amp;theme=c7b8565ffa5cd6908dda84ac\u0026amp;signature=aa93df90011a0562a8875f78e71c51382b66aabfe4594ce5a308cfb6ba14f16a\">\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=\"Create an API key - Twinbay\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Mints a key for the active organization. It acts with the caller\u0026#x27;s role, read from their membership on every request, so it can never outrank them. The response is the only time the token is readable.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://twinbay.mintlify.app/_mintlify/api/og/v2?division=api-keys\u0026amp;title=Create+an+API+key\u0026amp;description=Mints+a+key+for+the+active+organization.+It+acts+with+the+caller%27s+role%2C+read+from+their+membership+on+every+request%2C+so+it+can+never+outrank+them.+The+response\u0026amp;theme=c7b8565ffa5cd6908dda84ac\u0026amp;signature=aa93df90011a0562a8875f78e71c51382b66aabfe4594ce5a308cfb6ba14f16a\">\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/twinbay/5-c_Iv2_jRdSq35Q/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Twinbay\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#57534E\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.twinbay.ai/api-reference/api-keys/create-an-api-key\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/api-keys/create-an-api-key.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.twinbay.ai/#organization\",\"name\":\"Twinbay\",\"url\":\"https://docs.twinbay.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/twinbay/cPRPaMghR8z1tiY-/logo/dark.svg?fit=max\u0026auto=format\u0026n=cPRPaMghR8z1tiY-\u0026q=85\u0026s=20e156647ecab455844ff5204078db69\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.twinbay.ai#website\",\"name\":\"Twinbay\",\"url\":\"https://docs.twinbay.ai\",\"publisher\":{\"@id\":\"https://docs.twinbay.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.twinbay.ai/api-reference/api-keys/create-an-api-key#webpage\",\"url\":\"https://docs.twinbay.ai/api-reference/api-keys/create-an-api-key\",\"name\":\"Create an API key\",\"description\":\"Mints a key for the active organization. It acts with the caller's role, read from their membership on every request, so it can never outrank them. The response is the only time the token is readable.\",\"dateModified\":\"2026-10-08T04:57:25.144Z\",\"isPartOf\":{\"@id\":\"https://docs.twinbay.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.twinbay.ai/api-reference/api-keys/create-an-api-key#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.twinbay.ai/api-reference/api-keys/create-an-api-key#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"api-keys\",\"item\":\"https://docs.twinbay.ai/api-reference/api-keys/list-api-keys\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create an API key\",\"item\":\"https://docs.twinbay.ai/api-reference/api-keys/create-an-api-key\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.twinbay.ai/api-reference/api-keys/create-an-api-key#apireference\",\"headline\":\"Create an API key\",\"name\":\"Create an API key\",\"description\":\"Mints a key for the active organization. It acts with the caller's role, read from their membership on every request, so it can never outrank them. The response is the only time the token is readable.\",\"url\":\"https://docs.twinbay.ai/api-reference/api-keys/create-an-api-key\",\"mainEntityOfPage\":{\"@id\":\"https://docs.twinbay.ai/api-reference/api-keys/create-an-api-key#webpage\"},\"dateModified\":\"2026-10-08T04:57:25.144Z\",\"publisher\":{\"@id\":\"https://docs.twinbay.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.twinbay.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Twinbay\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Twinbay","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"API Reference","groups":[{"group":"users","pages":[{"title":"Read the authenticated user","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /users/me","href":"/api-reference/users/read-the-authenticated-user"}]},{"group":"organizations","pages":[{"title":"List your organizations","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /organizations","href":"/api-reference/organizations/list-your-organizations"},{"title":"Create an organization","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /organizations","href":"/api-reference/organizations/create-an-organization"},{"title":"Create your first organization","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /organizations/default","href":"/api-reference/organizations/create-your-first-organization"},{"title":"Read the active organization","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /organizations/current","href":"/api-reference/organizations/read-the-active-organization"},{"title":"Rename the active organization","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json patch /organizations/current","href":"/api-reference/organizations/rename-the-active-organization"},{"title":"List active organization members","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /organizations/current/members","href":"/api-reference/organizations/list-active-organization-members"},{"title":"List pending organization invitations","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /organizations/current/invitations","href":"/api-reference/organizations/list-pending-organization-invitations"},{"title":"Invite an organization member","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /organizations/current/invitations","href":"/api-reference/organizations/invite-an-organization-member"}]},{"group":"api-keys","pages":[{"title":"List API keys","description":"Every key of the active organization that has not been revoked, newest first. A key that has expired is still listed, so that it can be read and cleaned up rather than vanishing unexplained; `expires_at` says which. Tokens are never included. Paginated: walk the pages with `page` and `size`.","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /organizations/current/api-keys","href":"/api-reference/api-keys/list-api-keys"},{"title":"Create an API key","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /organizations/current/api-keys","href":"/api-reference/api-keys/create-an-api-key"},{"title":"Revoke an API key","description":"The key stops working immediately. Its row stays, so a key seen in a log can still be named, and its token can never be minted again.","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json delete /organizations/current/api-keys/{api_key_id}","href":"/api-reference/api-keys/revoke-an-api-key"}]},{"group":"billing","pages":[{"title":"Read the plan, credits and current usage","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /organizations/current/billing","href":"/api-reference/billing/read-the-plan-credits-and-current-usage"},{"title":"List issued invoices","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /organizations/current/billing/invoices","href":"/api-reference/billing/list-issued-invoices"},{"title":"Read the payment method","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /organizations/current/billing/payment-method","href":"/api-reference/billing/read-the-payment-method"},{"title":"Start an upgrade","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /organizations/current/billing/checkout","href":"/api-reference/billing/start-an-upgrade"},{"title":"Upgrade to pay as you go","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /organizations/current/billing/upgrade","href":"/api-reference/billing/upgrade-to-pay-as-you-go"},{"title":"Downgrade to Free","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /organizations/current/billing/downgrade","href":"/api-reference/billing/downgrade-to-free"}]},{"group":"catalog","pages":[{"title":"List available twins","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /twins/catalog","href":"/api-reference/catalog/list-available-twins"},{"title":"Retrieve a twin","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /twins/catalog/{twin_slug}","href":"/api-reference/catalog/retrieve-a-twin"}]},{"group":"environments","pages":[{"title":"List environments","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /environments","href":"/api-reference/environments/list-environments"},{"title":"Create an environment","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /environments","href":"/api-reference/environments/create-an-environment"},{"title":"Retrieve an environment","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /environments/{environment_id}","href":"/api-reference/environments/retrieve-an-environment"},{"title":"List recent environment request logs","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /environments/{environment_id}/logs","href":"/api-reference/environments/list-recent-environment-request-logs"},{"title":"Retrieve an environment request log","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /environments/{environment_id}/logs/{request_id}","href":"/api-reference/environments/retrieve-an-environment-request-log"},{"title":"List an environment's exports","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /environments/{environment_id}/exports","href":"/api-reference/environments/list-an-environments-exports"},{"title":"Export an environment's traffic","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /environments/{environment_id}/exports","href":"/api-reference/environments/export-an-environments-traffic"},{"title":"Retrieve an export","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /environments/{environment_id}/exports/{export_id}","href":"/api-reference/environments/retrieve-an-export"},{"title":"Sign a link to an exported file","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /environments/{environment_id}/exports/{export_id}/download","href":"/api-reference/environments/sign-a-link-to-an-exported-file"}]},{"group":"twins","pages":[{"title":"Retrieve a twin","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /twins/{twin_id}","href":"/api-reference/twins/retrieve-a-twin"},{"title":"Start a twin","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /twins/{twin_id}/start","href":"/api-reference/twins/start-a-twin"},{"title":"Stop a twin","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /twins/{twin_id}/stop","href":"/api-reference/twins/stop-a-twin"},{"title":"Collect the twin's API key","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /twins/{twin_id}/credential","href":"/api-reference/twins/collect-the-twins-api-key"},{"title":"List twin state","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /twins/{twin_id}/records/{resource}","href":"/api-reference/twins/list-twin-state"},{"title":"Replace a twin record","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json put /twins/{twin_id}/records/{resource}/{external_id}","href":"/api-reference/twins/replace-a-twin-record"},{"title":"Advance a deterministic twin lifecycle","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /twins/{twin_id}/advance","href":"/api-reference/twins/advance-a-deterministic-twin-lifecycle"}]},{"group":"scenarios","pages":[{"title":"List scenarios","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /scenarios","href":"/api-reference/scenarios/list-scenarios"},{"title":"Create a scenario","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /scenarios","href":"/api-reference/scenarios/create-a-scenario"},{"title":"Retrieve a scenario","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /scenarios/{scenario_id}","href":"/api-reference/scenarios/retrieve-a-scenario"},{"title":"Delete a scenario","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json delete /scenarios/{scenario_id}","href":"/api-reference/scenarios/delete-a-scenario"},{"title":"Update a scenario","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json patch /scenarios/{scenario_id}","href":"/api-reference/scenarios/update-a-scenario"}]},{"group":"seeds","pages":[{"title":"List seeds","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /seeds","href":"/api-reference/seeds/list-seeds"},{"title":"Generate a seed","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /seeds","href":"/api-reference/seeds/generate-a-seed"},{"title":"List suggested starting states","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /seeds/suggestions","href":"/api-reference/seeds/list-suggested-starting-states"},{"title":"Retrieve a seed","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /seeds/{seed_id}","href":"/api-reference/seeds/retrieve-a-seed"},{"title":"Delete a seed","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json delete /seeds/{seed_id}","href":"/api-reference/seeds/delete-a-seed"}]},{"group":"tests","pages":[{"title":"List tests","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /tests","href":"/api-reference/tests/list-tests"},{"title":"Create a test","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /tests","href":"/api-reference/tests/create-a-test"},{"title":"Retrieve a test","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /tests/{test_id}","href":"/api-reference/tests/retrieve-a-test"},{"title":"Update a test","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /tests/{test_id}","href":"/api-reference/tests/update-a-test"},{"title":"List a test's versions","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /tests/{test_id}/versions","href":"/api-reference/tests/list-a-tests-versions"},{"title":"Retrieve a test version","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /tests/{test_id}/versions/{version}","href":"/api-reference/tests/retrieve-a-test-version"},{"title":"List evaluators","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /evaluators","href":"/api-reference/tests/list-evaluators"},{"title":"Create an evaluator","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /evaluators","href":"/api-reference/tests/create-an-evaluator"},{"title":"Retrieve an evaluator","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /evaluators/{evaluator_id}","href":"/api-reference/tests/retrieve-an-evaluator"},{"title":"List test runs","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /test-runs","href":"/api-reference/tests/list-test-runs"},{"title":"Start a test run","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /test-runs","href":"/api-reference/tests/start-a-test-run"},{"title":"Retrieve a test run","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /test-runs/{test_run_id}","href":"/api-reference/tests/retrieve-a-test-run"},{"title":"Evaluate a test run","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json post /evaluations","href":"/api-reference/tests/evaluate-a-test-run"},{"title":"List a test run's evaluations","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /test-runs/{test_run_id}/evaluations","href":"/api-reference/tests/list-a-test-runs-evaluations"},{"title":"Retrieve an evaluation","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /evaluations/{evaluation_id}","href":"/api-reference/tests/retrieve-an-evaluation"},{"title":"Sign a link to a preserved capture","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /evaluation-inputs/{input_id}/download","href":"/api-reference/tests/sign-a-link-to-a-preserved-capture"}]},{"group":"healthchecks","pages":[{"title":"Read Root","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /","href":"/api-reference/healthchecks/read-root"},{"title":"Read Health","deprecated":null,"version":null,"openapi":"https://api.twinbay.ai/openapi.json get /health","href":"/api-reference/healthchecks/read-health"}]}]}]},"title":"Create an API key - Twinbay","buildId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","deploymentId":"dpl_EnxDqhjaNc9a8MVa833TGULPd9uJ","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-26-lDe7V.js","utils-CWQmgYtH.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-4-Aw3rSD.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-C2zjXYA5.js","snippetPresets-DFmpFA7C.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-FJpQavWq.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-D_GvPF7k.js","shallow-Bs2ZB0NO.js","getApiPlaygroundDisplay-DCcqJJk-.js","CodeSnippet-DzDxawVe.js","CodeSnippets-aUr7fU-7.js","Page-CT9uE8Ip.js","getPastedJson-Y1fKsj_I.js","icon-DI4zTsDr.js","MethodPill-C0nDlmSQ.js","DuplicateIcon-NUXbx2nQ.js","createIcon-BdTHrPAi.js","DynamicMarkdown-CtpgKJwj.js","SectionHeading-B3x35tOt.js","axios-vUo_bRtp.js","Markdown-3OmurJMP.js","clsx-DMKzROTp.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-1ms6tsT-.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Ke9xIMFx.js"]}