Get started with the Alt Magic API for generating AI-powered alt text
Use the Alt Magic REST API to programmatically generate descriptive, SEO-optimized alt text for images using advanced AI models with automatic fallback capabilities.
The Alt Magic API allows you to make a POST request to generate alt text for any image. You can configure parameters in the API request body or provide additional context for better results. The API automatically falls back from Gemini to OpenAI if needed, ensuring maximum reliability.
The Alt Magic API supports 200+ languages for generating alt text. You can specify the desired language using the language_code parameter in your requests.Popular Languages:
Your API endpoint is automatically assigned when you create your account:Base URL: https://api.altmagic.proAlt Text Generation: POST /v1/generate-alt-text-api - Generate AI-powered alt text for images with automatic fallback from Gemini to OpenAI.User Details: POST /v1/get-user-details-api - Retrieve user account information including subscription plan and available credits.
The Alt Magic API uses API key authentication to ensure secure access. When making requests, you must include your unique API key in the x-api-key header. This key can be generated and managed from your Alt Magic dashboard. Keep your API key confidential and never expose it in client-side code or public repositories.API Key: Include the x-api-key header in your request for authentication (recommended for server-to-server integrations).
When using image_file, ensure your base64 data URI follows the format: data:image/[type];base64,[base64-data]. Supported image types include JPEG, PNG, GIF, and WebP.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Alt Magic","colors":{"primary":"#f66e3c","light":"#f66e3c","dark":"#f66e3c"},"logo":{"light":"https://mintcdn.com/altmagic/DT6tAj7QFHlGnJub/logo/altm-logo.svg?fit=max\u0026auto=format\u0026n=DT6tAj7QFHlGnJub\u0026q=85\u0026s=b18bf24b7f96f7b540cc57361999d19e","dark":"https://mintcdn.com/altmagic/DT6tAj7QFHlGnJub/logo/altm-logo.svg?fit=max\u0026auto=format\u0026n=DT6tAj7QFHlGnJub\u0026q=85\u0026s=b18bf24b7f96f7b540cc57361999d19e"},"favicon":"/favicon.svg","navbar":{"links":[{"label":"Support","href":"mailto:[email protected]"}],"primary":{"type":"button","label":"Dashboard >","href":"https://app.altmagic.pro"}},"contextual":{"options":["copy","view"]},"navigation":{"global":{"anchors":[{"anchor":"Community","icon":"facebook","href":"https://www.facebook.com/groups/1695959361003779"},{"anchor":"Dashboard","icon":"house","href":"https://app.altmagic.pro"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"altmagic","hasAudioNarration":false,"actualSubdomain":"altmagic","customDomains":["docs.altmagic.pro"],"gitSource":{"type":"github","owner":"gopublisher","repo":"altmagic-technical-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a21e79903d4026a3ef78f8a","collectionId":"59a84aad-c7d3-4712-9af8-17f3c204453a","schemaVersion":"v2"},"entitlements":{},"buildId":"6a21e79903d4026a3ef78f8a:success","clientVersion":"0.0.3964","searchFilterCounts":[{"language":"default","tag":"API Reference","count":5},{"language":"default","tag":"API Documentation","count":3},{"language":"default","tag":"Endpoints","count":2}]},"assistantConfig":{},"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":"editor-v7-file-tree","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":"pause-universal-search-reconcile","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":"editor-nav-generations","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":"editor-agent-model-picker","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":"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}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/introduction","slug":"/api-reference/introduction","pageMetadata":{"title":"API Introduction","description":"Get started with the Alt Magic API for generating AI-powered alt text","href":"/api-reference/introduction"},"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: \"Get started with the Alt Magic API for generating AI-powered alt text\"\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`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Use the Alt Magic REST API to programmatically generate descriptive, SEO-optimized alt text for images using advanced AI models with automatic fallback capabilities.`}),`\n`,_jsx(Heading,{level:`2`,id:`introduction`,children:`Introduction`}),`\n`,_jsxs(_components.p,{children:[`The Alt Magic API allows you to make a `,_jsx(_components.code,{children:`POST`}),` request to generate alt text for any image. You can configure parameters in the API request body or provide additional context for better results. The API automatically falls back from Gemini to OpenAI if needed, ensuring maximum reliability.`]}),`\n`,_jsx(Heading,{level:`2`,id:`how-it-works`,children:`How It Works`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Create an API key`}),` in your `,_jsx(_components.a,{href:`https://app.altmagic.pro`,children:`Alt Magic dashboard`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Share your image`}),` either by:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Providing a publicly accessible URL (`,_jsx(_components.code,{children:`image_url`}),`), or`]}),`\n`,_jsxs(_components.li,{children:[`Uploading the image file directly as base64 data URI (`,_jsx(_components.code,{children:`image_file`}),`)`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Make a POST request`}),` to your personal Alt Magic endpoint`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Track the response`}),` and get your generated alt text`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`setting-up-parameters`,children:`Setting Up Parameters`}),`\n`,_jsx(Heading,{level:`3`,id:`required-parameters`,children:`Required Parameters`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`user_id`}),` - Your unique identifier (email address)`]}),`\n`,_jsxs(_components.li,{children:[`Either `,_jsx(_components.code,{children:`image_url`}),` OR `,_jsx(_components.code,{children:`image_file`}),` - You must provide one of these:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`image_url`}),` - Publicly accessible URL of the image`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`image_file`}),` - Image file in data URI format with base64 encoded image data (format: `,_jsx(_components.code,{children:`data:image/[type];base64,[base64-data]`}),`)`]}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`optional-parameters`,children:`Optional Parameters`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`blog_title`}),` - Context for better alt text generation`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`seo_keywords`}),` - Keywords for SEO optimization`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`language_code`}),` - Language for the generated text (`,_jsx(_components.a,{href:`/api-reference/language-support`,children:`All supported languages →`}),`).`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`language-support`,children:`Language Support`}),`\n`,_jsxs(_components.p,{children:[`The Alt Magic API supports `,_jsx(_components.strong,{children:`200+ languages`}),` for generating alt text. You can specify the desired language using the `,_jsx(_components.code,{children:`language_code`}),` parameter in your requests.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Popular Languages:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`English`}),` (`,_jsx(_components.code,{children:`en`}),`) - Default language (fallback)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Spanish`}),` (`,_jsx(_components.code,{children:`es`}),`) - Español`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`French`}),` (`,_jsx(_components.code,{children:`fr`}),`) - Français`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`German`}),` (`,_jsx(_components.code,{children:`de`}),`) - Deutsch`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Chinese`}),` (`,_jsx(_components.code,{children:`zh-CN`}),`, `,_jsx(_components.code,{children:`zh-TW`}),`) - 中文`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Japanese`}),` (`,_jsx(_components.code,{children:`ja`}),`) - 日本語`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Korean`}),` (`,_jsx(_components.code,{children:`ko`}),`) - 한국어`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Arabic`}),` (`,_jsx(_components.code,{children:`ar`}),`) - العربية`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Hindi`}),` (`,_jsx(_components.code,{children:`hi`}),`) - हिन्दी`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Portuguese`}),` (`,_jsx(_components.code,{children:`pt`}),`, `,_jsx(_components.code,{children:`pt-BR`}),`) - Português`]}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.a,{href:`/api-reference/language-support`,children:`View complete language list →`})}),`\n`,_jsx(Heading,{level:`2`,id:`getting-your-api-endpoint`,children:`Getting Your API Endpoint`}),`\n`,_jsx(_components.p,{children:`Your API endpoint is automatically assigned when you create your account:`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Base URL`}),`: `,_jsx(_components.code,{children:`https://api.altmagic.pro`})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Alt Text Generation`}),`: `,_jsx(_components.code,{children:`POST /v1/generate-alt-text-api`}),` - Generate AI-powered alt text for images with automatic fallback from Gemini to OpenAI.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`User Details`}),`: `,_jsx(_components.code,{children:`POST /v1/get-user-details-api`}),` - Retrieve user account information including subscription plan and available credits.`]}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsxs(_components.p,{children:[`The Alt Magic API uses API key authentication to ensure secure access. When making requests, you must include your unique API key in the `,_jsx(_components.code,{children:`x-api-key`}),` header. This key can be generated and managed from your Alt Magic dashboard. Keep your API key confidential and never expose it in client-side code or public repositories.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`API Key`}),`: Include the `,_jsx(_components.code,{children:`x-api-key`}),` header in your request for authentication (recommended for server-to-server integrations).`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`http`,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:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#569CD6`},children:`x-api-key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` YOUR_API_KEY_HERE`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`rate-limits`,children:`Rate Limits`}),`\n`,_jsx(_components.p,{children:`Rate limits are applied per user to ensure fair usage:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Standard Rate Limit`}),`: 100 requests per minute`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`error-handling`,children:`Error Handling`}),`\n`,_jsx(_components.p,{children:`The API returns standard HTTP status codes with detailed error messages:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status Code`}),_jsx(_components.th,{children:`Meaning`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.strong,{children:`200`})}),_jsx(_components.td,{children:`Success`}),_jsx(_components.td,{children:`Request was successful`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.strong,{children:`400`})}),_jsx(_components.td,{children:`Bad Request`}),_jsx(_components.td,{children:`Validation errors in the request`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.strong,{children:`401`})}),_jsx(_components.td,{children:`Unauthorized`}),_jsx(_components.td,{children:`Authentication required`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.strong,{children:`403`})}),_jsx(_components.td,{children:`Forbidden`}),_jsx(_components.td,{children:`Insufficient credits`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.strong,{children:`429`})}),_jsx(_components.td,{children:`Too Many Requests`}),_jsx(_components.td,{children:`Rate limit exceeded`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.strong,{children:`500`})}),_jsx(_components.td,{children:`Internal Server Error`}),_jsx(_components.td,{children:`An error occurred on the server`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`example-response`,children:`Example Response`}),`\n`,_jsx(_components.p,{children:`Each API request returns immediate results with your generated alt text.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,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:`5`,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:` \"altText\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"A close-up photo of a red apple on a wooden table with natural lighting\"`}),_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:` \"CreditsAvailable\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`49`}),_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:` \"plan_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"pro\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`complete-api-examples`,children:`Complete API Examples`}),`\n`,_jsx(Heading,{level:`3`,id:`option-1-using-image-url`,children:`Option 1 (using image URL)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,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:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.altmagic.pro/v1/generate-alt-text-api\"`}),_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:` \"Content-Type: application/json\"`}),_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:` \"x-api-key: YOUR_API_KEY\"`}),_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:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"image_url\": \"https://example.com/image.jpg\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"blog_title\": \"Healthy Eating Guide\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"seo_keywords\": \"healthy, food, nutrition, apples\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"language_code\": \"en\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user_id\": \"[email protected]\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`option-2-using-image-file`,children:`Option 2 (using image file)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,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:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.altmagic.pro/v1/generate-alt-text-api\"`}),_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:` \"Content-Type: application/json\"`}),_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:` \"x-api-key: YOUR_API_KEY\"`}),_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:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"image_file\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAABAAEDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAv/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAX/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwCdABmX/9k=\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"user_id\": \"user123\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"blog_title\": \"Beautiful Sunset Over Mountains\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"seo_keywords\": \"sunset, mountains, nature, landscape, photography\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"language_code\": \"en\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`When using `,_jsx(_components.code,{children:`image_file`}),`, ensure your base64 data URI follows the format: `,_jsx(_components.code,{children:`data:image/[type];base64,[base64-data]`}),`. Supported image types include JPEG, PNG, GIF, and WebP.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next Steps`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.a,{href:`/api-reference/api-key-generation`,children:`Generate your API key`})}),` - Step-by-step guide`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:_jsx(_components.a,{href:`/api-reference/alt-text-generation`,children:`Read the endpoint documentation`})}),` for detailed parameters`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Ready to get started? `,_jsx(_components.a,{href:`/api-reference/api-key-generation`,children:`Generate your first API key →`})]})]})}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":"API Introduction","description":"Get started with the Alt Magic API for generating AI-powered alt text","href":"/api-reference/introduction"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Introduction","slug":"introduction","depth":2,"children":[]},{"title":"How It Works","slug":"how-it-works","depth":2,"children":[]},{"title":"Setting Up Parameters","slug":"setting-up-parameters","depth":2,"children":[{"title":"Required Parameters","slug":"required-parameters","depth":3,"children":[]},{"title":"Optional Parameters","slug":"optional-parameters","depth":3,"children":[]}]},{"title":"Language Support","slug":"language-support","depth":2,"children":[]},{"title":"Getting Your API Endpoint","slug":"getting-your-api-endpoint","depth":2,"children":[]},{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"Rate Limits","slug":"rate-limits","depth":2,"children":[]},{"title":"Error Handling","slug":"error-handling","depth":2,"children":[]},{"title":"Example Response","slug":"example-response","depth":2,"children":[]},{"title":"Complete API Examples","slug":"complete-api-examples","depth":2,"children":[{"title":"Option 1 (using image URL)","slug":"option-1-using-image-url","depth":3,"children":[]},{"title":"Option 2 (using image file)","slug":"option-2-using-image-file","depth":3,"children":[]}]},{"title":"Next Steps","slug":"next-steps","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"altmagic","siteName":"Alt Magic","title":"API Introduction - Alt Magic","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2025-12-09T16:16:41.113Z","originalFileLocation":"api-reference/introduction.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=\"Get started with the Alt Magic API for generating AI-powered alt text\">\u003cmeta data-mint-head name=\"application-name\" content=\"Alt Magic\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/altmagic/R7SVffCMBGZJBTat/_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/altmagic/R7SVffCMBGZJBTat/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/altmagic/R7SVffCMBGZJBTat/_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/altmagic/R7SVffCMBGZJBTat/_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/altmagic/R7SVffCMBGZJBTat/_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/altmagic/R7SVffCMBGZJBTat/_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/altmagic/R7SVffCMBGZJBTat/_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/altmagic/R7SVffCMBGZJBTat/_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/altmagic/R7SVffCMBGZJBTat/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"API Introduction - Alt Magic\">\u003cmeta data-mint-head property=\"og:description\" content=\"Get started with the Alt Magic API for generating AI-powered alt text\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Alt Magic\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.altmagic.pro/api-reference/introduction\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://altmagic.mintlify.app/_mintlify/api/og/v2?division=API+Documentation\u0026amp;title=API+Introduction\u0026amp;description=Get+started+with+the+Alt+Magic+API+for+generating+AI-powered+alt+text\u0026amp;theme=a9644bb52acecb61e651d47b\u0026amp;signature=75bb303e3be1946606932132f4c4ff11c36f48473330521cd31f5d1d048e3c25\">\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=\"API Introduction - Alt Magic\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Get started with the Alt Magic API for generating AI-powered alt text\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://altmagic.mintlify.app/_mintlify/api/og/v2?division=API+Documentation\u0026amp;title=API+Introduction\u0026amp;description=Get+started+with+the+Alt+Magic+API+for+generating+AI-powered+alt+text\u0026amp;theme=a9644bb52acecb61e651d47b\u0026amp;signature=75bb303e3be1946606932132f4c4ff11c36f48473330521cd31f5d1d048e3c25\">\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/altmagic/R7SVffCMBGZJBTat/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Alt Magic\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#f66e3c\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.altmagic.pro/api-reference/introduction\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/introduction.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.altmagic.pro/#organization\",\"name\":\"Alt Magic\",\"url\":\"https://docs.altmagic.pro\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/altmagic/DT6tAj7QFHlGnJub/logo/altm-logo.svg?fit=max\u0026auto=format\u0026n=DT6tAj7QFHlGnJub\u0026q=85\u0026s=b18bf24b7f96f7b540cc57361999d19e\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.altmagic.pro#website\",\"name\":\"Alt Magic\",\"url\":\"https://docs.altmagic.pro\",\"publisher\":{\"@id\":\"https://docs.altmagic.pro/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.altmagic.pro/api-reference/introduction#webpage\",\"url\":\"https://docs.altmagic.pro/api-reference/introduction\",\"name\":\"API Introduction\",\"description\":\"Get started with the Alt Magic API for generating AI-powered alt text\",\"dateModified\":\"2025-12-09T16:16:41.113Z\",\"isPartOf\":{\"@id\":\"https://docs.altmagic.pro#website\"},\"breadcrumb\":{\"@id\":\"https://docs.altmagic.pro/api-reference/introduction#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.altmagic.pro/api-reference/introduction#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Alt Magic\",\"item\":\"https://docs.altmagic.pro\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"API Introduction\",\"item\":\"https://docs.altmagic.pro/api-reference/introduction\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.altmagic.pro/api-reference/introduction#article\",\"headline\":\"API Introduction\",\"name\":\"API Introduction\",\"description\":\"Get started with the Alt Magic API for generating AI-powered alt text\",\"url\":\"https://docs.altmagic.pro/api-reference/introduction\",\"mainEntityOfPage\":{\"@id\":\"https://docs.altmagic.pro/api-reference/introduction#webpage\"},\"dateModified\":\"2025-12-09T16:16:41.113Z\",\"publisher\":{\"@id\":\"https://docs.altmagic.pro/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.altmagic.pro#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Alt Magic\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Alt Magic","nav":{"global":{"anchors":[{"anchor":"Community","icon":"facebook","href":"https://www.facebook.com/groups/1695959361003779"},{"anchor":"Dashboard","icon":"house","href":"https://app.altmagic.pro"}]},"tabs":[{"tab":"API Reference","groups":[{"group":"API Documentation","pages":[{"title":"API Introduction","href":"/api-reference/introduction"},{"title":"API Key Generation","description":"Learn how to generate your first API key for Alt Magic API","href":"/api-reference/api-key-generation"},{"title":"Language Support","href":"/api-reference/language-support"}]},{"group":"Endpoints","pages":[{"title":"Generate Alt Text","deprecated":null,"version":null,"openapi":"api-reference/openapi.json post /v1/generate-alt-text-api","href":"/api-reference/endpoints/generate-alt-text"},{"title":"Get User Details","deprecated":null,"version":null,"openapi":"api-reference/openapi.json post /v1/get-user-details-api","href":"/api-reference/endpoints/get-user-details"}]}]}]},"title":"API Introduction - Alt Magic","buildId":"dpl_HcHmUS6i3UwswnTHJUEdcTtwfdTQ","deploymentId":"dpl_HcHmUS6i3UwswnTHJUEdcTtwfdTQ","dynamics":[],"chunks":[]}