Create a service token for machine-to-machine authentication. Accepts API key or bearer token. Optionally apply restrictions.
POST
/
tokens
JavaScript
import Smithery from '@smithery/api';const client = new Smithery({ apiKey: process.env['SMITHERY_API_KEY'], // This is the default and can be omitted});const createTokenResponse = await client.tokens.create();console.log(createTokenResponse.token);
Optional organization ID to scope the token to. When provided, the token is minted with org context. The authenticated user must be an admin or owner of the organization.
import Smithery from '@smithery/api';const client = new Smithery({ apiKey: process.env['SMITHERY_API_KEY'], // This is the default and can be omitted});const createTokenResponse = await client.tokens.create();console.log(createTokenResponse.token);
{
"error": "unauthorized",
"message": "Invalid API key"
}
{
"error": "unauthorized",
"message": "Invalid API key"
}
{
"error": "unauthorized",
"message": "Invalid API key"
}
{"docsConfig":{"theme":"maple","$schema":"https://mintlify.com/docs.json","name":"Smithery Documentation","colors":{"primary":"#FF5601","light":"#FFDC4A","dark":"#7B1707"},"logo":{"light":"https://mintcdn.com/smithery/qpxDbsoRMODKTkrQ/logo/logo.svg?fit=max\u0026auto=format\u0026n=qpxDbsoRMODKTkrQ\u0026q=85\u0026s=e8c976cbfecac3c8ad51112af8b9f38d","dark":"https://mintcdn.com/smithery/qpxDbsoRMODKTkrQ/logo/logo.svg?fit=max\u0026auto=format\u0026n=qpxDbsoRMODKTkrQ\u0026q=85\u0026s=e8c976cbfecac3c8ad51112af8b9f38d","href":"https://smithery.ai"},"favicon":"https://mintcdn.com/smithery/qpxDbsoRMODKTkrQ/logo/icon.svg?fit=max\u0026auto=format\u0026n=qpxDbsoRMODKTkrQ\u0026q=85\u0026s=836aad536f240178d960fed81ede4a8d","navbar":{"links":[{"href":"mailto:support@smithery.ai","label":"Support"}],"primary":{"type":"button","label":"Discord","href":"https://discord.gg/Afd38S5p9A"}},"footer":{"socials":{"github":"https://github.com/smithery-ai","twitter":"https://twitter.com/SmitheryDotAI","discord":"https://discord.gg/Afd38S5p9A"}},"fonts":{"family":"GT Pantheon Micro","weight":400,"source":"fonts/gt-pantheon-micro-regular.woff2","format":"woff2"},"icons":{"library":"lucide"},"banner":{"content":"🎉 **Smithery is now a part of Arcade.dev!** [Read more in our announcement here](https://arcade.dev/blog/smithery-joins-arcade)","dismissible":true},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"smithery","hasAudioNarration":false,"actualSubdomain":"smithery","customDomains":["smithery.ai"],"gitSource":{"type":"github","owner":"arcadeai-labs","repo":"smithery-mono","deployBranch":"main","contentDirectory":"apps/docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a76096fb499ebc0f194db5e","collectionId":"cd9dbb4c-4659-4f2e-bcab-0a05ad508b99","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6a76096fb499ebc0f194db5e"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ad3bfa99a71b22abf7c9243:failure","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"default","tag":"API Reference","count":46},{"language":"default","tag":"servers","count":17},{"language":"default","tag":"connect","count":13},{"language":"default","tag":"Connect","count":5},{"language":"default","tag":"namespaces","count":5},{"language":"default","tag":"skills","count":5},{"language":"default","tag":"Publish","count":3},{"language":"default","tag":"Concepts","count":3},{"language":"default","tag":"organizations","count":3},{"language":"default","tag":"Cookbooks","count":1}]},"assistantConfig":{},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"public/styles/typography.css","content":":root{--track-display:-0.02em;--track-head:0em;--track-subhead:0em;--track-body:0em;--track-cta:0em;--lh-display:0.90;--lh-head:1.00;--lh-subhead:1.10;--lh-body:1.30;--lh-cta:1.40}.text-body,.text-cta,.text-display,.text-footnote,.text-h1,.text-h2,.text-subhead,body,html{font-family:\"GT Pantheon Micro\",ui-sans-serif,system-ui,-apple-system,\"Segoe UI\",Roboto,Arial,sans-serif}h1,h2{font-weight:500}li,p{font-weight:400;letter-spacing:var(--track-body);line-height:var(--lh-body)}.text-body,.text-cta,.text-display,.text-footnote,.text-h1,.text-h2,.text-subhead{font-weight:500;letter-spacing:var(--track-display);line-height:var(--lh-display)}.text-body,.text-cta,.text-footnote,.text-h1,.text-h2,.text-subhead,h1,h2{letter-spacing:var(--track-head);line-height:var(--lh-head)}.text-body,.text-cta,.text-footnote,.text-subhead{letter-spacing:var(--track-subhead);line-height:var(--lh-subhead)}.text-body,.text-cta,.text-footnote{font-weight:400;letter-spacing:var(--track-body);line-height:var(--lh-body)}.text-cta,.text-footnote{letter-spacing:var(--track-cta);line-height:var(--lh-cta)}"}],"page":{"pagePath":"api-reference/tokens/create-a-service-token","slug":"/api-reference/tokens/create-a-service-token","pageMetadata":{"title":"Create a service token","description":"Create a service token for machine-to-machine authentication. Accepts API key or bearer token. Optionally apply restrictions.","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml post /tokens","href":"/api-reference/tokens/create-a-service-token","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: \"Create a service token for machine-to-machine authentication. Accepts API key or bearer token. Optionally apply restrictions.\"\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 a service token","description":"Create a service token for machine-to-machine authentication. Accepts API key or bearer token. Optionally apply restrictions.","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml post /tokens","href":"/api-reference/tokens/create-a-service-token","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"postTokens","requestBody":"3772e09d-e458-44ce-8b5e-3a2896e8b475","tags":["tokens"],"summary":"Create a service token","description":"Create a service token for machine-to-machine authentication. Accepts API key or bearer token. Optionally apply restrictions.","responses":{"200":"4863923a-4c48-422c-a528-0dd2efde9668","400":"ffc79f43-27dd-48a9-b32e-407093e40bbe","401":"a2a2ffdd-1189-476a-9d11-c0a0b10b6717","403":"db2d45af-3e96-47f5-a06b-14c9cccea559"},"x-codeSamples":[{"lang":"JavaScript","source":"import Smithery from '@smithery/api';\n\nconst client = new Smithery({\n apiKey: process.env['SMITHERY_API_KEY'], // This is the default and can be omitted\n});\n\nconst createTokenResponse = await client.tokens.create();\n\nconsole.log(createTokenResponse.token);"}],"method":"post","type":"path","servers":["c22e62b4-0f25-4893-8f19-49bdcc2be319"],"security":["d1ca844b-7c64-4192-8e74-87fd445ced9f"],"path":"/tokens","baseUrlOptions":["https://api.smithery.ai"],"title":"Create a service token","codeSamples":[{"lang":"JavaScript","source":"import Smithery from '@smithery/api';\n\nconst client = new Smithery({\n apiKey: process.env['SMITHERY_API_KEY'], // This is the default and can be omitted\n});\n\nconst createTokenResponse = await client.tokens.create();\n\nconsole.log(createTokenResponse.token);"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"policy":{"description":"Constraint objects to restrict the token. Each constraint may include a `ttl` field (max 24 hours). Default TTL is 1 hour. Maximum is 24 hours.","minItems":1,"type":"array","items":{"type":"object","properties":{"namespaces":{"oneOf":[{"type":"string","description":"Namespace(s) the token is scoped to. Accepts a single slug or an array.","example":["my-app"],"uniqueKey":"policy.items.[INDEX].namespaces.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"string","uniqueKey":"policy.items.[INDEX].namespaces.oneOf.1.items.[INDEX]","typeLabel":"string"},"description":"Namespace(s) the token is scoped to. Accepts a single slug or an array.","example":["my-app"],"uniqueKey":"policy.items.[INDEX].namespaces.oneOf.1","typeLabel":"string[]"}],"uniqueKey":"policy.items.[INDEX].namespaces","typeLabel":"string | string[]"},"resources":{"oneOf":[{"type":"string","description":"Resource type(s) the token may access: connections, servers, namespaces, or skills.","enum":["connections","servers","namespaces","skills"],"example":["connections"],"uniqueKey":"policy.items.[INDEX].resources.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"array","items":{"type":"string","enum":["connections","servers","namespaces","skills"],"uniqueKey":"policy.items.[INDEX].resources.oneOf.1.items.[INDEX]","typeLabel":"enum\u003cstring>"},"description":"Resource type(s) the token may access: connections, servers, namespaces, or skills.","example":["connections"],"uniqueKey":"policy.items.[INDEX].resources.oneOf.1","typeLabel":"enum\u003cstring>[]"}],"uniqueKey":"policy.items.[INDEX].resources","typeLabel":"enum\u003cstring> | enum\u003cstring>[]"},"operations":{"oneOf":[{"type":"string","description":"Operation(s) the token may perform: read, write, or execute.","enum":["read","write","execute"],"example":["read"],"uniqueKey":"policy.items.[INDEX].operations.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"array","items":{"type":"string","enum":["read","write","execute"],"uniqueKey":"policy.items.[INDEX].operations.oneOf.1.items.[INDEX]","typeLabel":"enum\u003cstring>"},"description":"Operation(s) the token may perform: read, write, or execute.","example":["read"],"uniqueKey":"policy.items.[INDEX].operations.oneOf.1","typeLabel":"enum\u003cstring>[]"}],"uniqueKey":"policy.items.[INDEX].operations","typeLabel":"enum\u003cstring> | enum\u003cstring>[]"},"metadata":{"oneOf":[{"type":"object","description":"Key-value metadata for fine-grained filtering. A single object requires all pairs to match (AND). An array of objects requires any one to match (OR-of-AND), e.g. [{\"userId\":\"alice\"},{\"team\":\"backend\"}] grants access when either condition is met.","example":[{"userId":"alice"}],"additionalProperties":{"type":"string","uniqueKey":"policy.items.[INDEX].metadata.oneOf.0.additionalProperties","typeLabel":"string"},"uniqueKey":"policy.items.[INDEX].metadata.oneOf.0","typeLabel":"object"},{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","uniqueKey":"policy.items.[INDEX].metadata.oneOf.1.items.[INDEX].additionalProperties","typeLabel":"string"},"uniqueKey":"policy.items.[INDEX].metadata.oneOf.1.items.[INDEX]","typeLabel":"object"},"description":"Key-value metadata for fine-grained filtering. A single object requires all pairs to match (AND). An array of objects requires any one to match (OR-of-AND), e.g. [{\"userId\":\"alice\"},{\"team\":\"backend\"}] grants access when either condition is met.","example":[{"userId":"alice"}],"uniqueKey":"policy.items.[INDEX].metadata.oneOf.1","typeLabel":"object[]"}],"uniqueKey":"policy.items.[INDEX].metadata","typeLabel":"object | object[]"},"ttl":{"oneOf":[{"type":"string","description":"Time-to-live for the constraint. Accepts seconds (number) or a duration string such as \"1h\", \"30m\", or \"20s\".","example":"1h","uniqueKey":"policy.items.[INDEX].ttl.oneOf.0","typeLabel":"string"},{"type":"number","description":"Time-to-live for the constraint. Accepts seconds (number) or a duration string such as \"1h\", \"30m\", or \"20s\".","example":"1h","uniqueKey":"policy.items.[INDEX].ttl.oneOf.1","typeLabel":"number"}],"uniqueKey":"policy.items.[INDEX].ttl","typeLabel":"string | number"},"rpcReqMatch":{"description":"MCP JSON-RPC request matching rules. Keys are dot-paths into the request body (e.g. \"params.name\", \"method\"). Values are regex patterns. All entries must match (AND).","example":{"params.name":"^(create_issue|search_issues)$"},"type":"object","propertyNames":{"type":"string","maxLength":200},"additionalProperties":{"type":"string","maxLength":500,"uniqueKey":"policy.items.[INDEX].rpcReqMatch.additionalProperties","typeLabel":"string"},"uniqueKey":"policy.items.[INDEX].rpcReqMatch","typeLabel":"object"}},"additionalProperties":false,"description":"A policy constraint that restricts a token's scope. All specified fields within a single constraint are AND'd together. When multiple constraints are passed in the policy array, each is applied as an independent attenuation block.","uniqueKey":"policy.items.[INDEX]","typeLabel":"object"},"uniqueKey":"policy","typeLabel":"object[]"},"organizationId":{"description":"Optional organization ID to scope the token to. When provided, the token is minted with org context. The authenticated user must be an admin or owner of the organization.","example":"org_01H1234567890","type":"string","uniqueKey":"organizationId","typeLabel":"string"}},"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"policy":[{"namespaces":["my-app"],"resources":["connections"],"operations":["read"],"metadata":[{"userId":"alice"}],"ttl":"1h","rpcReqMatch":{"params.name":"^(create_issue|search_issues)$"}}],"organizationId":"org_01H1234567890"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"4863923a-4c48-422c-a528-0dd2efde9668":{"description":"Token created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","description":"The signed service token.","isRequired":true,"uniqueKey":"token","typeLabel":"string"},"expiresAt":{"type":"string","description":"ISO 8601 timestamp when the token expires.","example":"2024-01-01T01:00:00.000Z","isRequired":true,"uniqueKey":"expiresAt","typeLabel":"string"}},"required":["token","expiresAt"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"token":"\u003cstring>","expiresAt":"2024-01-01T01:00:00.000Z"}}},"exampleType":"generated"}},"exampleType":"generated"},"ffc79f43-27dd-48a9-b32e-407093e40bbe":{"description":"Bad request (invalid parameters)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"unauthorized","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"message":{"example":"Invalid API key","type":"string","uniqueKey":"message","typeLabel":"string"}},"required":["error"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"unauthorized","message":"Invalid API key"}}},"exampleType":"generated"}},"exampleType":"generated"},"a2a2ffdd-1189-476a-9d11-c0a0b10b6717":{"description":"Unauthorized (missing or invalid credentials)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"unauthorized","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"message":{"example":"Invalid API key","type":"string","uniqueKey":"message","typeLabel":"string"}},"required":["error"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"unauthorized","message":"Invalid API key"}}},"exampleType":"generated"}},"exampleType":"generated"},"db2d45af-3e96-47f5-a06b-14c9cccea559":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"unauthorized","isRequired":true,"uniqueKey":"error","typeLabel":"string"},"message":{"example":"Invalid API key","type":"string","uniqueKey":"message","typeLabel":"string"}},"required":["error"],"additionalProperties":false,"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"unauthorized","message":"Invalid API key"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"d1ca844b-7c64-4192-8e74-87fd445ced9f":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Smithery API key as Bearer token","scopes":[]}}},"servers":{"c22e62b4-0f25-4893-8f19-49bdcc2be319":{"url":"https://api.smithery.ai"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"Smithery API key as Bearer token","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Smithery API key as Bearer token","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml"},"subdomain":"smithery","siteName":"Smithery Documentation","title":"Create a service token - Smithery Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-07T20:12:53.957Z","originalFileLocation":"api-reference/tokens/create-a-service-token.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Create a service token for machine-to-machine authentication. Accepts API key or bearer token. Optionally apply restrictions.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Smithery Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/smithery/yFtJsqaDvcX22mCZ/_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=\"/docs/mintlify-assets/_mintlify/favicons/smithery/yFtJsqaDvcX22mCZ/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/smithery/yFtJsqaDvcX22mCZ/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/smithery/yFtJsqaDvcX22mCZ/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/smithery/yFtJsqaDvcX22mCZ/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/smithery/yFtJsqaDvcX22mCZ/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/smithery/yFtJsqaDvcX22mCZ/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/smithery/yFtJsqaDvcX22mCZ/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/smithery/yFtJsqaDvcX22mCZ/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Create a service token - Smithery Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create a service token for machine-to-machine authentication. Accepts API key or bearer token. Optionally apply restrictions.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Smithery Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://smithery.ai/docs/api-reference/tokens/create-a-service-token\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://smithery.mintlify.app/_mintlify/api/og/v2?division=tokens\u0026amp;title=Create+a+service+token\u0026amp;description=Create+a+service+token+for+machine-to-machine+authentication.+Accepts+API+key+or+bearer+token.+Optionally+apply+restrictions.\u0026amp;theme=8a962c1c73c1b4e105c29161\u0026amp;signature=077352a2335f8064a43f035bb1d886ae57ea0d5bc9b606fbf741c25b0859d8a7\">\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 a service token - Smithery Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create a service token for machine-to-machine authentication. Accepts API key or bearer token. Optionally apply restrictions.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://smithery.mintlify.app/_mintlify/api/og/v2?division=tokens\u0026amp;title=Create+a+service+token\u0026amp;description=Create+a+service+token+for+machine-to-machine+authentication.+Accepts+API+key+or+bearer+token.+Optionally+apply+restrictions.\u0026amp;theme=8a962c1c73c1b4e105c29161\u0026amp;signature=077352a2335f8064a43f035bb1d886ae57ea0d5bc9b606fbf741c25b0859d8a7\">\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=\"/docs/mintlify-assets/_mintlify/favicons/smithery/yFtJsqaDvcX22mCZ/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Smithery Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF5601\">\u003clink data-mint-head rel=\"canonical\" href=\"https://smithery.ai/docs/api-reference/tokens/create-a-service-token\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api-reference/tokens/create-a-service-token.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://smithery.ai/#organization\",\"name\":\"Smithery Documentation\",\"url\":\"https://smithery.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/smithery/qpxDbsoRMODKTkrQ/logo/logo.svg?fit=max\u0026auto=format\u0026n=qpxDbsoRMODKTkrQ\u0026q=85\u0026s=e8c976cbfecac3c8ad51112af8b9f38d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://smithery.ai/docs#website\",\"name\":\"Smithery Documentation\",\"url\":\"https://smithery.ai/docs\",\"publisher\":{\"@id\":\"https://smithery.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://smithery.ai/docs/api-reference/tokens/create-a-service-token#webpage\",\"url\":\"https://smithery.ai/docs/api-reference/tokens/create-a-service-token\",\"name\":\"Create a service token\",\"description\":\"Create a service token for machine-to-machine authentication. Accepts API key or bearer token. Optionally apply restrictions.\",\"dateModified\":\"2026-06-07T20:12:53.957Z\",\"isPartOf\":{\"@id\":\"https://smithery.ai/docs#website\"},\"breadcrumb\":{\"@id\":\"https://smithery.ai/docs/api-reference/tokens/create-a-service-token#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://smithery.ai/docs/api-reference/tokens/create-a-service-token#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://smithery.ai/docs/api-reference/health-check\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create a service token\",\"item\":\"https://smithery.ai/docs/api-reference/tokens/create-a-service-token\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://smithery.ai/docs/api-reference/tokens/create-a-service-token#apireference\",\"headline\":\"Create a service token\",\"name\":\"Create a service token\",\"description\":\"Create a service token for machine-to-machine authentication. Accepts API key or bearer token. Optionally apply restrictions.\",\"url\":\"https://smithery.ai/docs/api-reference/tokens/create-a-service-token\",\"mainEntityOfPage\":{\"@id\":\"https://smithery.ai/docs/api-reference/tokens/create-a-service-token#webpage\"},\"dateModified\":\"2026-06-07T20:12:53.957Z\",\"publisher\":{\"@id\":\"https://smithery.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://smithery.ai/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Smithery Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Smithery Documentation","nav":{"global":null,"groups":[{"group":"Welcome","pages":[{"title":"Introduction","icon":"book-open","href":"/index"}]},{"group":"Connect","pages":[{"title":"Connect to MCPs","icon":"plug-zap","href":"/use/connect"},{"title":"Uplink","icon":"cable","href":"/use/uplink"},{"title":"Token Scoping","icon":"shield","href":"/use/token-scoping"},{"title":"Deep Linking","icon":"link","href":"/use/deep-linking"},{"title":"Listing Your Client","icon":"list","href":"/use/listing_your_client"}]},{"group":"Publish","pages":[{"title":"Overview","icon":"binoculars","href":"/build/index"},{"title":"Publish","icon":"rocket","href":"/build/publish"},{"title":"Triggers","icon":"radio","href":"/build/triggers"}]},{"group":"Integrations","pages":[{"title":"Vercel AI SDK Integration","href":"/integrations/vercel_ai_sdk"}]},{"group":"Concepts","pages":[{"title":"What is MCP?","href":"/concepts/what_is_mcp"},{"title":"Namespaces","href":"/concepts/namespaces"},{"title":"Smithery CLI","href":"/concepts/cli"}]},{"group":"Cookbooks","pages":[{"title":"Build an OAuth-compatible client","href":"/cookbooks/typescript_oauth_client"}]},{"group":"API Reference","pages":[{"group":"API Reference","pages":[{"title":"Health check","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /health","href":"/api-reference/health-check"}]},{"group":"servers","pages":[{"title":"Get a server","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /servers/{qualifiedName}","href":"/api-reference/servers/get-a-server"},{"title":"Create a server","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml put /servers/{qualifiedName}","href":"/api-reference/servers/create-a-server"},{"title":"Delete a server","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml delete /servers/{qualifiedName}","href":"/api-reference/servers/delete-a-server"},{"title":"Update a server","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml patch /servers/{qualifiedName}","href":"/api-reference/servers/update-a-server"},{"title":"Transfer a server","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml post /servers/{qualifiedName}/transfer","href":"/api-reference/servers/transfer-a-server"},{"title":"Download server bundle","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /servers/{qualifiedName}/download","href":"/api-reference/servers/download-server-bundle"},{"title":"List releases","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /servers/{qualifiedName}/releases","href":"/api-reference/servers/list-releases"},{"title":"Publish a server","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml put /servers/{qualifiedName}/releases","href":"/api-reference/servers/publish-a-server"},{"title":"Get a release","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /servers/{qualifiedName}/releases/{id}","href":"/api-reference/servers/get-a-release"},{"title":"Stream release logs","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /servers/{qualifiedName}/releases/{id}/stream","href":"/api-reference/servers/stream-release-logs"},{"title":"Resume a release","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml post /servers/{qualifiedName}/releases/{id}/resume","href":"/api-reference/servers/resume-a-release"},{"title":"List runtime logs","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /servers/{qualifiedName}/logs","href":"/api-reference/servers/list-runtime-logs"},{"title":"Get server icon","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /servers/{qualifiedName}/icon","href":"/api-reference/servers/get-server-icon"},{"title":"Upload server icon","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml put /servers/{qualifiedName}/icon","href":"/api-reference/servers/upload-server-icon"},{"title":"Delete server icon","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml delete /servers/{qualifiedName}/icon","href":"/api-reference/servers/delete-server-icon"},{"title":"Infer a tool output schema","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /servers/{qualifiedName}/experimental/tools/{toolName}/output-schema","href":"/api-reference/servers/infer-a-tool-output-schema"},{"title":"List all servers","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /servers","href":"/api-reference/servers/list-all-servers"}]},{"group":"domains","pages":[]},{"group":"skills","pages":[{"title":"List or search skills","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /skills","href":"/api-reference/skills/list-or-search-skills"},{"title":"Create a new skill (deprecated)","deprecated":true,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml post /skills","href":"/api-reference/skills/create-a-new-skill-deprecated"},{"title":"Get a skill","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /skills/{namespace}/{slug}","href":"/api-reference/skills/get-a-skill"},{"title":"Create or update a skill","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml put /skills/{namespace}/{slug}","href":"/api-reference/skills/create-or-update-a-skill"},{"title":"Delete a skill","description":"Delete a skill by namespace and slug. Requires ownership of the namespace.","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml delete /skills/{namespace}/{slug}","href":"/api-reference/skills/delete-a-skill"}]},{"group":"tokens","pages":[{"title":"Create a service token","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml post /tokens","href":"/api-reference/tokens/create-a-service-token"}]},{"group":"namespaces","pages":[{"title":"Get user's namespaces or search namespaces","description":"When called without query params, returns the authenticated user's namespaces (backwards compatible). When query params are provided, searches public namespaces with pagination. Use ownerId to filter by owner, hasServers/hasSkills to filter by content, q for text search.","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /namespaces","href":"/api-reference/namespaces/get-users-namespaces-or-search-namespaces"},{"title":"Create a new namespace with generated name","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml post /namespaces","href":"/api-reference/namespaces/create-a-new-namespace-with-generated-name"},{"title":"Create a new namespace","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml put /namespaces/{name}","href":"/api-reference/namespaces/create-a-new-namespace"},{"title":"Delete a namespace","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml delete /namespaces/{name}","href":"/api-reference/namespaces/delete-a-namespace"},{"title":"Create a server under a namespace (deprecated)","deprecated":true,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml put /namespaces/{namespace}/servers/{server}","href":"/api-reference/namespaces/create-a-server-under-a-namespace-deprecated"}]},{"group":"organizations","pages":[{"title":"List team API keys","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /organizations/{orgId}/api-keys","href":"/api-reference/organizations/list-team-api-keys"},{"title":"Create a team API key","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml post /organizations/{orgId}/api-keys","href":"/api-reference/organizations/create-a-team-api-key"},{"title":"Revoke a team API key","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml delete /organizations/{orgId}/api-keys/{keyId}","href":"/api-reference/organizations/revoke-a-team-api-key"}]},{"group":"connect","pages":[{"title":"List connections","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /connect/{namespace}","href":"/api-reference/connect/list-connections"},{"title":"Create connection","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml post /connect/{namespace}","href":"/api-reference/connect/create-connection"},{"title":"List triggers","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /connect/{namespace}/{connectionId}/.triggers","href":"/api-reference/connect/list-triggers"},{"title":"Get trigger","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /connect/{namespace}/{connectionId}/.triggers/{triggerName}","href":"/api-reference/connect/get-trigger"},{"title":"Subscribe to trigger","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml post /connect/{namespace}/{connectionId}/.triggers/{triggerName}","href":"/api-reference/connect/subscribe-to-trigger"},{"title":"Unsubscribe from trigger","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml delete /connect/{namespace}/{connectionId}/.triggers/{triggerName}","href":"/api-reference/connect/unsubscribe-from-trigger"},{"title":"Get connection","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /connect/{namespace}/{connectionId}","href":"/api-reference/connect/get-connection"},{"title":"Create or update connection","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml put /connect/{namespace}/{connectionId}","href":"/api-reference/connect/create-or-update-connection"},{"title":"Delete connection","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml delete /connect/{namespace}/{connectionId}","href":"/api-reference/connect/delete-connection"},{"title":"List tools across a namespace","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /connect/{namespace}/.tools","href":"/api-reference/connect/list-tools-across-a-namespace"},{"title":"List tools","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /connect/{namespace}/{connectionId}/.tools","href":"/api-reference/connect/list-tools"},{"title":"Get tool","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml get /connect/{namespace}/{connectionId}/.tools/{toolPath}","href":"/api-reference/connect/get-tool"},{"title":"Call tool","deprecated":null,"version":null,"openapi":"https://app.stainless.com/api/spec/documented/smithery/openapi.documented.yml post /connect/{namespace}/{connectionId}/.tools/{toolPath}","href":"/api-reference/connect/call-tool"}]}]}]},"title":"Create a service token - Smithery Documentation","buildId":"dpl_3rfzHPCtRhDFBbetXZ3oLkN5tjmA","deploymentId":"dpl_3rfzHPCtRhDFBbetXZ3oLkN5tjmA","dynamics":["10e4515597","c2aa737661","b0f84f53ff","a9bb46feb3","2b790eda92"],"chunks":["BannerMarkdown-3zwwRfY7.js","dist-DMuJXOAm.js","lib--scc4DXi.js","lib-B8HbPgcC.js","clsx-eUAxaTXI.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","OpenApiReferenceProvider-DBvOZtde.js","utils-BMzGkvGb.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-BYhgN8Gl.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-qDMltnin.js","snippetPresets-CABPPIq4.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","Page-B-qdInYQ.js","ApiExamples-Bx9dgvF5.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-EwWVpM4w.js","shallow-vGbuQTai.js","getApiPlaygroundDisplay-DP2addym.js","CodeSnippet-BG6rB_-H.js","CodeSnippets-CFVdLBFC.js","getPastedJson-JGlMoKBJ.js","icon-BK_uyWxF.js","MethodPill-Du3sAVkF.js","DuplicateIcon-CMq42UID.js","createIcon-RdBrtBmo.js","DynamicMarkdown-B3juXLG8.js","SectionHeading-B--QsSCa.js","axios-vUo_bRtp.js","Markdown-B_bWWeh0.js","AssistantPageLink-DeDUMY0v.js"]}