Most API endpoints require authentication via a Bearer token in the Authorization header. Keys start with the gx_ prefix.The Messages-compatible endpoint and the MCP
server also accept the same key in the x-api-key header for client
compatibility. Both header forms use the same key validation, rate limits,
scopes, and credit accounting; send one or the other, not two different keys.The only public no-auth exceptions in this API reference are
GET /v1/models/catalog, which returns
non-sensitive generation-model metadata for pickers and pricing displays; and
GET /v1/llm/models.json, which returns the
public language-model catalog.
Seconds to wait before retrying (on 429 responses)
Use exponential backoff when retrying after a 429. If you consistently hit
limits, raise the rate on that key in the dashboard, or create separate keys
for different services.
Error responses
Status
Meaning
401
Missing, invalid, revoked, or expired API key
403
OAuth token lacks write scope for a write request
429
Rate limit exceeded
{ "error": "Invalid or expired API key.", "message": "Invalid or expired API key.", "code": "UNAUTHORIZED", "traceId": "req_..."}
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Magica","colors":{"primary":"#6366f1","light":"#818cf8","dark":"#4f46e5"},"logo":{"light":"https://mintcdn.com/galaxyai-f8150d75/DBhRDarFZNKVqMQi/logo/logo_light_theme.svg?fit=max\u0026auto=format\u0026n=DBhRDarFZNKVqMQi\u0026q=85\u0026s=6f2c433ff16ffb278918ac9ebdf0de20","dark":"https://mintcdn.com/galaxyai-f8150d75/DBhRDarFZNKVqMQi/logo/logo_dark_theme.svg?fit=max\u0026auto=format\u0026n=DBhRDarFZNKVqMQi\u0026q=85\u0026s=12e176141e9a0793a64292bb91603779"},"favicon":"https://mintcdn.com/galaxyai-f8150d75/quUbr73Mwh3x8_L4/logo/icon.png?fit=max\u0026auto=format\u0026n=quUbr73Mwh3x8_L4\u0026q=85\u0026s=6cf007f3a7707b6edab45417ca58af6b","api":{"openapi":["openapi.json"],"mdx":{"server":"https://inference.magica.com"}},"appearance":{"default":"light"},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","grok","aistudio"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"galaxyai-f8150d75","hasAudioNarration":false,"actualSubdomain":"galaxyai-f8150d75","customDomains":["magica.com"],"gitSource":{"type":"github","owner":"galaxyai-team","repo":"app.galaxy.ai","deployBranch":"main","contentDirectory":"api-docs","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6af6ceeb5955afd619ba7e54","clientVersion":"0.0.4128","searchFilterCounts":[{"language":"default","tag":"API Reference","count":21},{"language":"default","tag":"Get Started","count":6},{"language":"default","tag":"LLM Gateway","count":5},{"language":"default","tag":"Standalone Model Runs","count":5},{"language":"default","tag":"Models","count":5},{"language":"default","tag":"Introduction","count":4},{"language":"default","tag":"MCP Server","count":4},{"language":"default","tag":"Generated Media","count":3},{"language":"default","tag":"Overview","count":2},{"language":"default","tag":"Credits","count":1}]},"assistantConfig":{"enableStarterQuestions":false},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"authentication","slug":"/authentication","pageMetadata":{"title":"Authentication","description":"How to authenticate with the Magica REST API.","href":"/authentication"},"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 with the Magica REST API.\"\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`,hr:`hr`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Frame,Heading,Note,OptimizedImage,Step,Steps,Tab,Table,Tabs,Tip,Warning}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Most API endpoints require authentication via a Bearer token in the `,_jsx(_components.code,{children:`Authorization`}),` header. Keys start with the `,_jsx(_components.code,{children:`gx_`}),` prefix.`]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/api-reference/llm/messages`,children:`Messages-compatible endpoint`}),` and the MCP\nserver also accept the same key in the `,_jsx(_components.code,{children:`x-api-key`}),` header for client\ncompatibility. Both header forms use the same key validation, rate limits,\nscopes, and credit accounting; send one or the other, not two different keys.`]}),`\n`,_jsxs(_components.p,{children:[`The only public no-auth exceptions in this API reference are\n`,_jsx(_components.a,{href:`/api-reference/nodes/model-catalog`,children:_jsx(_components.code,{children:`GET /v1/models/catalog`})}),`, which returns\nnon-sensitive generation-model metadata for pickers and pricing displays; and\n`,_jsx(_components.a,{href:`/api-reference/llm/models-catalog`,children:_jsx(_components.code,{children:`GET /v1/llm/models.json`})}),`, which returns the\npublic language-model catalog.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`using-your-api-key`,children:`Using your API key`}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`cURL`,id:`curl`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://inference.magica.com/v1/models`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer gx_your_api_key\"`})]}),`\n`]})})})}),_jsx(Tab,{title:`Node.js`,id:`node-js`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` res`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://inference.magica.com/v1/models\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Authorization:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `Bearer \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`process`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`MAGICA_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})}),_jsx(Tab,{title:`Python`,id:`python`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`6`,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:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os, requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`res `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.get(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://inference.magica.com/v1/models\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'MAGICA_API_KEY'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})})})]}),`\n`,_jsxs(_components.p,{children:[`Create and manage keys from `,_jsx(_components.strong,{children:`Settings → API Keys`}),` in the `,_jsx(_components.a,{href:`https://magica.com`,children:`Magica app`}),`.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`creating-a-key`,children:`Creating a key`}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Sign in`,children:_jsxs(_components.p,{children:[`Open `,_jsx(_components.a,{href:`https://magica.com`,children:`magica.com`}),` and sign in.`]})}),_jsxs(Step,{title:`Open Settings`,children:[_jsxs(_components.p,{children:[`Select `,_jsx(_components.strong,{children:`More`}),` at the bottom of the left sidebar, then `,_jsx(_components.strong,{children:`Settings`}),`.`]}),_jsx(Frame,{caption:`Account menu — click Settings`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/settings-button.png?fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=0aa8d2b031db3ef277df4fe2c610ad85`,alt:`Account menu showing the Settings button highlighted`,\"data-og-width\":`255`,width:`255`,\"data-og-height\":`162`,height:`162`,\"data-path\":`images/api-keys/settings-button.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/settings-button.png?w=280\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=e56913798eb977ca315f525c7bb3813f 280w, https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/settings-button.png?w=560\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=acf7a19b5ced906ec3ce9db2bac8ba83 560w, https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/settings-button.png?w=840\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=f8c40a8ea6d79f23eda8f0eba352a1ec 840w, https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/settings-button.png?w=1100\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=43f588ed65003df49ba60bd6355c18e6 1100w, https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/settings-button.png?w=1650\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=51b743b9be61ecca99de15111b87f416 1650w, https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/settings-button.png?w=2500\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=6428114e8c76049f248f855e77ad6cef 2500w`})})]}),_jsxs(Step,{title:`Open API Keys`,children:[_jsxs(_components.p,{children:[`Select the `,_jsx(_components.strong,{children:`API Keys`}),` tab in the settings sidebar, then click `,_jsx(_components.strong,{children:`Manage`}),`.`]}),_jsx(Frame,{caption:`Settings sidebar — API Keys tab`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/settings-sidebar-api-keys.png?fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=cf4ca0b3479ff4490a265d9ec8d8a7c6`,alt:`Settings sidebar with the API Keys tab highlighted`,\"data-og-width\":`225`,width:`225`,\"data-og-height\":`434`,height:`434`,\"data-path\":`images/api-keys/settings-sidebar-api-keys.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/settings-sidebar-api-keys.png?w=280\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=0263ce6dace172f9cd5305e09661650e 280w, https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/settings-sidebar-api-keys.png?w=560\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=be3f55b029608bb9cb0704d0c0acebee 560w, https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/settings-sidebar-api-keys.png?w=840\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=0c2af39b0c34cdd93160d57579ff4fc4 840w, https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/settings-sidebar-api-keys.png?w=1100\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=3131bee43677cb896dd56a2087f9edd0 1100w, https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/settings-sidebar-api-keys.png?w=1650\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=8302660dca3340a89138189be786cf8a 1650w, https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/settings-sidebar-api-keys.png?w=2500\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=ff02f380d8577f6e65372c48a903913d 2500w`})}),_jsx(Frame,{caption:`API Keys panel — click Manage`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/api-keys-manage.png?fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=71ffe326b558c6c94d0a96b3b3b46206`,alt:`API Keys settings panel with the Manage button highlighted`,\"data-og-width\":`640`,width:`640`,\"data-og-height\":`172`,height:`172`,\"data-path\":`images/api-keys/api-keys-manage.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/api-keys-manage.png?w=280\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=ca973f0612fc5f5769cf1ddb9ba6e45b 280w, https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/api-keys-manage.png?w=560\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=6c28129b6d9c818cf80a81c0ffa04d08 560w, https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/api-keys-manage.png?w=840\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=dc16cea3d56aa705b44beb0a6e8dca41 840w, https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/api-keys-manage.png?w=1100\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=2d158dca9635c38d9e7ced56edbc095c 1100w, https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/api-keys-manage.png?w=1650\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=3e3fdfd8e5e889a024ab7ac7490384d1 1650w, https://mintcdn.com/galaxyai-f8150d75/qgKkKW7c60Qp9lDO/images/api-keys/api-keys-manage.png?w=2500\u0026fit=max\u0026auto=format\u0026n=qgKkKW7c60Qp9lDO\u0026q=85\u0026s=1ba059286efc0c4151af631b4bffbc5b 2500w`})})]}),_jsx(Step,{title:`Create the key`,children:_jsxs(_components.p,{children:[`Enter a label (e.g. “Production”) and click `,_jsx(_components.strong,{children:`Create key`}),`. To set request\nlimits or an expiration date first, open `,_jsx(_components.strong,{children:`Advanced options`}),`.`]})}),_jsx(Step,{title:`Copy the key`,children:_jsxs(_components.p,{children:[`Copy the full key immediately — `,_jsx(_components.strong,{children:`it’s only shown once`}),`.`]})})]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`The full API key is only displayed at creation time. Store it securely. If you\nlose it, revoke the key and create a new one.`})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`key-properties`,children:`Key properties`}),`\n`,_jsxs(_components.p,{children:[`You can create up to `,_jsx(_components.strong,{children:`10 API keys`}),` per account. Each key has its own label, rate limits, and optional expiration.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Property`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Label`})}),_jsx(_components.td,{children:`A unique name for this key (editable anytime)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Prefix`})}),_jsxs(_components.td,{children:[`The visible `,_jsx(_components.code,{children:`gx_...`}),` prefix shown in the dashboard`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Rate limit (per minute)`})}),_jsx(_components.td,{children:`Max requests per minute for this key (default: 100)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Rate limit (per day)`})}),_jsx(_components.td,{children:`Max requests per day for this key (default: 10,000)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Expires at`})}),_jsx(_components.td,{children:`Optional expiration date — key stops working after this date`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Created at`})}),_jsx(_components.td,{children:`When the key was created`})]})]})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`managing-keys`,children:`Managing keys`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Edit a key`,icon:`pen`,children:_jsxs(_components.p,{children:[`Update label or rate limits from `,_jsx(_components.strong,{children:`Settings → API Keys`}),`. Click the pencil\nicon next to any key.`]})}),_jsx(Card,{title:`Revoke a key`,icon:`ban`,children:_jsxs(_components.p,{children:[`Click the revoke button next to any key. Revocation is immediate — requests\nusing that key start returning `,_jsx(_components.code,{children:`401`}),`.`]})})]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Revoking a key does not affect other keys on your account. Your other keys\ncontinue working normally.`})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`key-expiration`,children:`Key expiration`}),`\n`,_jsx(_components.p,{children:`You can optionally set an expiration date when creating a key. After it passes:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`The key is automatically invalidated by the system`}),`\n`,_jsxs(_components.li,{children:[`API requests using the key return `,_jsx(_components.code,{children:`401 Unauthorized`})]}),`\n`,_jsx(_components.li,{children:`The key shows an “Expired” badge in the dashboard`}),`\n`,_jsx(_components.li,{children:`You can revoke expired keys to clean up your list`}),`\n`]}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`Use expiration dates for temporary integrations, CI/CD pipelines, or\ncontractor access. For long-lived production keys, leave the expiration empty.`})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`rate-limits`,children:`Rate limits`}),`\n`,_jsx(_components.p,{children:`Each API key has its own rate limits that you can configure:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Limit`}),_jsx(_components.th,{children:`Default`}),_jsx(_components.th,{children:`Range`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Per minute`})}),_jsx(_components.td,{children:`100 requests`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1 – 100`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Per day`})}),_jsx(_components.td,{children:`10,000 requests`}),_jsx(_components.td,{children:`1 – 1,440 × the per-minute limit (up to 144,000 at 100/min)`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`When you exceed a rate limit, the API returns a `,_jsx(_components.code,{children:`429 Too Many Requests`}),` response with a `,_jsx(_components.code,{children:`Retry-After`}),` header:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Rate limit exceeded. Please try again later.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Rate limit exceeded. Please try again later.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"RATE_LIMITED\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"traceId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"req_...\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Rate-limit info is included in response headers:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Header`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`X-RateLimit-Remaining`})}),_jsx(_components.td,{children:`Requests remaining in the current window`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`X-RateLimit-Reset`})}),_jsx(_components.td,{children:`Timestamp (ms) when the rate limit resets`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Retry-After`})}),_jsx(_components.td,{children:`Seconds to wait before retrying (on 429 responses)`})]})]})]}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`Use exponential backoff when retrying after a 429. If you consistently hit\nlimits, raise the rate on that key in the dashboard, or create separate keys\nfor different services.`})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`error-responses`,children:`Error responses`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`401`})}),_jsx(_components.td,{children:`Missing, invalid, revoked, or expired API key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`403`})}),_jsx(_components.td,{children:`OAuth token lacks write scope for a write request`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`429`})}),_jsx(_components.td,{children:`Rate limit exceeded`})]})]})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Invalid or expired API key.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Invalid or expired API key.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"UNAUTHORIZED\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"traceId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"req_...\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Authentication","description":"How to authenticate with the Magica REST API.","href":"/authentication"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Using your API key","slug":"using-your-api-key","depth":2,"children":[]},{"title":"Creating a key","slug":"creating-a-key","depth":2,"children":[]},{"title":"Key properties","slug":"key-properties","depth":2,"children":[]},{"title":"Managing keys","slug":"managing-keys","depth":2,"children":[]},{"title":"Key expiration","slug":"key-expiration","depth":2,"children":[]},{"title":"Rate limits","slug":"rate-limits","depth":2,"children":[]},{"title":"Error responses","slug":"error-responses","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"galaxyai-f8150d75","siteName":"Magica","title":"Authentication - Magica","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-13T08:41:48.638Z","originalFileLocation":"authentication.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=\"light\"}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 with the Magica REST API.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Magica\">\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/galaxyai-f8150d75/YAaK7oqNGFqz20z7/_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/galaxyai-f8150d75/YAaK7oqNGFqz20z7/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/galaxyai-f8150d75/YAaK7oqNGFqz20z7/_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/galaxyai-f8150d75/YAaK7oqNGFqz20z7/_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/galaxyai-f8150d75/YAaK7oqNGFqz20z7/_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/galaxyai-f8150d75/YAaK7oqNGFqz20z7/_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/galaxyai-f8150d75/YAaK7oqNGFqz20z7/_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/galaxyai-f8150d75/YAaK7oqNGFqz20z7/_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/galaxyai-f8150d75/YAaK7oqNGFqz20z7/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Authentication - Magica\">\u003cmeta data-mint-head property=\"og:description\" content=\"How to authenticate with the Magica REST API.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Magica\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://magica.com/docs/authentication\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://galaxyai-f8150d75.mintlify.site/docs/_mintlify/api/og/v2?division=Overview\u0026amp;title=Authentication\u0026amp;description=How+to+authenticate+with+the+Magica+REST+API.\u0026amp;theme=6ffc046dec82632af34e4ff6\u0026amp;signature=922c9a7bd605d98fc670cfcfc465826d00a1e38e1294f258592b4d78212734cc\">\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=\"Authentication - Magica\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How to authenticate with the Magica REST API.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://galaxyai-f8150d75.mintlify.site/docs/_mintlify/api/og/v2?division=Overview\u0026amp;title=Authentication\u0026amp;description=How+to+authenticate+with+the+Magica+REST+API.\u0026amp;theme=6ffc046dec82632af34e4ff6\u0026amp;signature=922c9a7bd605d98fc670cfcfc465826d00a1e38e1294f258592b4d78212734cc\">\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/galaxyai-f8150d75/YAaK7oqNGFqz20z7/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Magica\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6366f1\">\u003clink data-mint-head rel=\"canonical\" href=\"https://magica.com/docs/authentication\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/authentication.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://magica.com/#organization\",\"name\":\"Magica\",\"url\":\"https://magica.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/galaxyai-f8150d75/DBhRDarFZNKVqMQi/logo/logo_light_theme.svg?fit=max\u0026auto=format\u0026n=DBhRDarFZNKVqMQi\u0026q=85\u0026s=6f2c433ff16ffb278918ac9ebdf0de20\"}},{\"@type\":\"WebSite\",\"@id\":\"https://magica.com/docs#website\",\"name\":\"Magica\",\"url\":\"https://magica.com/docs\",\"publisher\":{\"@id\":\"https://magica.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://magica.com/docs/authentication#webpage\",\"url\":\"https://magica.com/docs/authentication\",\"name\":\"Authentication\",\"description\":\"How to authenticate with the Magica REST API.\",\"dateModified\":\"2026-11-13T08:41:48.638Z\",\"isPartOf\":{\"@id\":\"https://magica.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://magica.com/docs/authentication#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://magica.com/docs/authentication#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Magica\",\"item\":\"https://magica.com/docs\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Authentication\",\"item\":\"https://magica.com/docs/authentication\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://magica.com/docs/authentication#article\",\"headline\":\"Authentication\",\"name\":\"Authentication\",\"description\":\"How to authenticate with the Magica REST API.\",\"url\":\"https://magica.com/docs/authentication\",\"mainEntityOfPage\":{\"@id\":\"https://magica.com/docs/authentication#webpage\"},\"dateModified\":\"2026-11-13T08:41:48.638Z\",\"publisher\":{\"@id\":\"https://magica.com/#organization\"},\"isPartOf\":{\"@id\":\"https://magica.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Magica\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Magica\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/authentication.md","siteName":"Magica","nav":{"global":null,"tabs":[{"tab":"Introduction","pages":[{"title":"Introduction","href":"/introduction/overview"}]},{"tab":"API Reference","groups":[{"group":"Overview","pages":[{"title":"Authentication","href":"/authentication"},{"title":"Webhooks","description":"Receive and verify asynchronous standalone model run notifications.","href":"/webhooks"}]},{"group":"Models","pages":[{"title":"List all models","api":"GET /v1/models","href":"/api-reference/nodes/list-models"},{"title":"Get public model catalog","openapi":"GET /v1/models/catalog","href":"/api-reference/nodes/model-catalog"},{"title":"Search models","api":"GET /v1/models/search","href":"/api-reference/nodes/search"},{"title":"Get model input schema","api":"GET /v1/models/{modelId}/schema","href":"/api-reference/nodes/model-schema"},{"title":"Get model pricing","openapi":"GET /v1/models/{modelId}/pricing","href":"/api-reference/nodes/model-pricing"}]},{"group":"Standalone Model Runs","pages":[{"title":"Run a model","openapi":"POST /v1/nodes/{nodeType}/run","href":"/api-reference/nodes/run"},{"title":"Estimate node credits","api":"POST /v1/nodes/estimate-credits","href":"/api-reference/nodes/estimate-credits"},{"title":"Get model run","openapi":"GET /v1/nodes/runs/{runId}","href":"/api-reference/nodes/get-model-run"},{"title":"List deprecated models","openapi":"GET /v1/nodes/deprecated-models","href":"/api-reference/nodes/deprecated-models"},{"title":"Get deprecated model runs","openapi":"GET /v1/nodes/deprecated-models/{nodeType}/runs","href":"/api-reference/nodes/deprecated-model-runs"}]},{"group":"LLM Gateway","pages":[{"title":"LLM Gateway","href":"/api-reference/llm/overview"},{"title":"Create a chat completion","api":"POST /v1/chat/completions","href":"/api-reference/llm/chat-completions"},{"title":"Create a Messages response","api":"POST /v1/messages","href":"/api-reference/llm/messages"},{"title":"Create a response","api":"POST /v1/responses","href":"/api-reference/llm/responses"},{"title":"List language models","api":"GET /v1/llm/models.json","href":"/api-reference/llm/models-catalog"}]},{"group":"Credits","pages":[{"title":"Get credit balance","api":"GET /v1/credits/balance","href":"/api-reference/credits/balance"}]},{"group":"Generated Media","pages":[{"title":"Upload media","openapi":"POST /v1/uploads","href":"/api-reference/media-library/upload"},{"title":"List media generations","openapi":"GET /v1/media-library/list","href":"/api-reference/media-library/list"},{"title":"Get media library stats","openapi":"GET /v1/media-library/stats","href":"/api-reference/media-library/stats"}]}]},{"tab":"MCP Server","pages":[{"title":"MCP Server","href":"/mcp-server/overview"}]}]},"basePath":"","title":"Authentication - Magica","buildId":"dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ","deploymentId":"dpl_4UDxC3erAcBDHX8QT9FjyxxnLZSQ","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-B97cnG_I.js","DynamicMarkdown-B7gJlzwx.js","zoom-image-lightbox-Dg9C7AQr.js","lightbox-handle-r17bVUz3.js"]}