DGrid’s x402 API lets developers pay per inference call using the x402 micropayment protocol — no API keys or accounts required.
DGrid x402 API is DGrid’s pay-per-inference access mode for api payments. Instead of creating an account, pre-funding a balance, or managing separate billing flows, developers and autonomous agents can pay LLM inference costs directly through the x402 payment protocol as part of the API request lifecycle.This makes x402 especially useful for:
Agents and autonomous workflows that need to call an LLM and settle payment immediately
Server-side tools and scripts that should avoid account provisioning and manual top-ups
On-demand integrations where the simplest path is “request inference, authorize payment, receive the result”
Funding a prepaid balance or attaching a billing method
Managing API keys, quotas, and billing dashboards
With x402 on DGrid, the flow becomes much more direct:
Request inference → receive payment requirements → sign once → submit payment and inference together
For agentic systems, this is a major simplification. The same runtime that decides to use a model can also authorize and settle the cost of that inference call, without switching into a separate account-management workflow.
long-running product integrations with standard billing workflows
Use x402 when you want:
direct per-request payment
no pre-funded account balance
agent-friendly inference plus payment in one flow
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"DGrid AI Docs","description":"Documentation for DGrid AI: The Decentralized Smart Network of AI","colors":{"primary":"#65A30D","light":"#A3E635","dark":"#4D7C0F"},"logo":{"light":"https://mintcdn.com/dgridai/eFrQx07adP_MQw0i/logo/dgrid-horizontal-black.png?fit=max\u0026auto=format\u0026n=eFrQx07adP_MQw0i\u0026q=85\u0026s=aa7da302786ec058e3c91526a127736d","dark":"https://mintcdn.com/dgridai/eFrQx07adP_MQw0i/logo/dgrid-horizontal-white.png?fit=max\u0026auto=format\u0026n=eFrQx07adP_MQw0i\u0026q=85\u0026s=62aa06e50e86ab2394beada6a4814623"},"favicon":"https://mintcdn.com/dgridai/eFrQx07adP_MQw0i/favicon.png?fit=max\u0026auto=format\u0026n=eFrQx07adP_MQw0i\u0026q=85\u0026s=75fcb6ffc8e30d1e2be00c994cc0372e","api":{"openapi":"api-reference/openapi.json","playground":{"display":"interactive"},"examples":{"languages":["curl","python","javascript","go","java"]}},"appearance":{"default":"system"},"navbar":{"links":[{"href":"https://blog.dgrid.ai/","label":"Blog"},{"href":"https://telegram.me/dgrid_ai","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://dgrid.ai/overview"}},"footer":{"socials":{"x":"https://x.com/dgrid_ai","telegram":"https://telegram.me/dgrid_ai","github":"https://github.com/dgridai"}},"icons":{"library":"lucide"},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"languages":[{"language":"en","default":true,"href":""},{"language":"zh-Hant","navbar":{"links":[{"href":"https://blog.dgrid.ai/","label":"部落格"},{"href":"https://telegram.me/dgrid_ai","label":"支援"}],"primary":{"type":"button","label":"儀表板","href":"https://dgrid.ai/overview"}},"href":"zh-Hant"},{"language":"ko","navbar":{"links":[{"href":"https://blog.dgrid.ai/","label":"블로그"},{"href":"https://telegram.me/dgrid_ai","label":"지원"}],"primary":{"type":"button","label":"대시보드","href":"https://dgrid.ai/overview"}},"href":"ko"},{"language":"fr","navbar":{"links":[{"href":"https://blog.dgrid.ai/","label":"Blog"},{"href":"https://telegram.me/dgrid_ai","label":"Assistance"}],"primary":{"type":"button","label":"Tableau de bord","href":"https://dgrid.ai/overview"}},"href":"fr"},{"language":"es","navbar":{"links":[{"href":"https://blog.dgrid.ai/","label":"Blog"},{"href":"https://telegram.me/dgrid_ai","label":"Soporte"}],"primary":{"type":"button","label":"Panel","href":"https://dgrid.ai/overview"}},"href":"es"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"dgridai","hasAudioNarration":false,"actualSubdomain":"dgridai","customDomains":["docs.dgrid.ai"],"gitSource":{"type":"github","owner":"ethanclarkeio","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"collectionId":"146373a5-1310-4927-bf4d-bc5f1b23b737","liveDeploymentHistoryId":"6adb04f0a28cf93daee93294","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adb04f0a28cf93daee93294"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6adb04f0a28cf93daee93294","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"en","tag":"Documentation","count":36},{"language":"es","tag":"Documentación","count":36},{"language":"fr","tag":"Documentation","count":36},{"language":"ko","tag":"문서","count":36},{"language":"zh-Hant","tag":"文件","count":36},{"language":"en","tag":"API Reference","count":28},{"language":"es","tag":"Referencia de la API","count":28},{"language":"fr","tag":"Référence API","count":28},{"language":"ko","tag":"API 참조","count":28},{"language":"zh-Hant","tag":"API 參考","count":28},{"language":"en","tag":"MODEL API","count":22},{"language":"es","tag":"API DE MODELOS","count":22},{"language":"fr","tag":"API DE MODÈLES","count":22},{"language":"ko","tag":"모델 API","count":22},{"language":"zh-Hant","tag":"模型 API","count":22},{"language":"en","tag":"AI GATEWAY","count":13},{"language":"es","tag":"PUERTA DE ENLACE IA","count":13},{"language":"fr","tag":"PASSERELLE IA","count":13},{"language":"ko","tag":"AI 게이트웨이","count":13},{"language":"zh-Hant","tag":"AI 閘道","count":13},{"language":"en","tag":"Integration Tutorials","count":7},{"language":"es","tag":"Tutoriales de integración","count":7},{"language":"fr","tag":"Tutoriels d'intégration","count":7},{"language":"ko","tag":"통합 가이드","count":7},{"language":"zh-Hant","tag":"整合教學","count":7},{"language":"en","tag":"Images","count":6},{"language":"en","tag":"GENESIS PREMIUM","count":6},{"language":"es","tag":"Imágenes","count":6},{"language":"es","tag":"GENESIS PREMIUM","count":6},{"language":"fr","tag":"Images","count":6},{"language":"fr","tag":"GENESIS PREMIUM","count":6},{"language":"ko","tag":"이미지","count":6},{"language":"ko","tag":"GENESIS PREMIUM","count":6},{"language":"zh-Hant","tag":"圖像","count":6},{"language":"zh-Hant","tag":"GENESIS PREMIUM","count":6},{"language":"en","tag":"Chat","count":5},{"language":"es","tag":"Chat","count":5},{"language":"fr","tag":"Chat","count":5},{"language":"ko","tag":"채팅","count":5},{"language":"zh-Hant","tag":"對話","count":5},{"language":"en","tag":"Audio","count":4},{"language":"en","tag":"CORE CONCEPTS","count":4},{"language":"es","tag":"Audio","count":4},{"language":"es","tag":"CONCEPTOS CLAVE","count":4},{"language":"fr","tag":"Audio","count":4},{"language":"fr","tag":"CONCEPTS CLÉS","count":4},{"language":"ko","tag":"오디오","count":4},{"language":"ko","tag":"핵심 개념","count":4},{"language":"zh-Hant","tag":"音訊","count":4},{"language":"zh-Hant","tag":"核心概念","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"x402/overview","slug":"/x402/overview","pageMetadata":{"title":"x402 API","sidebarTitle":"Overview","description":"DGrid's x402 API lets developers pay per inference call using the x402 micropayment protocol — no API keys or accounts required.","href":"/x402/overview"},"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: \"DGrid’s x402 API lets developers pay per inference call using the x402 micropayment protocol — no API keys or accounts required.\"\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={code:`code`,li:`li`,ol:`ol`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Tip}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`DGrid x402 API`}),` is DGrid’s pay-per-inference access mode for api payments. Instead of creating an account, pre-funding a balance, or managing separate billing flows, developers and autonomous agents can pay LLM inference costs directly through the `,_jsx(_components.strong,{children:`x402 payment protocol`}),` as part of the API request lifecycle.`]}),`\n`,_jsx(_components.p,{children:`This makes x402 especially useful for:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Agents and autonomous workflows`}),` that need to call an LLM and settle payment immediately`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Server-side tools and scripts`}),` that should avoid account provisioning and manual top-ups`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`On-demand integrations`}),` where the simplest path is “request inference, authorize payment, receive the result”`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`why-x402-api-matters`,children:`Why x402 API Matters`}),`\n`,_jsx(_components.p,{children:`Traditional AI billing usually requires:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Creating an account with the provider`}),`\n`,_jsx(_components.li,{children:`Funding a prepaid balance or attaching a billing method`}),`\n`,_jsx(_components.li,{children:`Managing API keys, quotas, and billing dashboards`}),`\n`]}),`\n`,_jsx(_components.p,{children:`With x402 on DGrid, the flow becomes much more direct:`}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`Request inference → receive payment requirements → sign once → submit payment and inference together`})}),`\n`,_jsx(_components.p,{children:`For agentic systems, this is a major simplification. The same runtime that decides to use a model can also authorize and settle the cost of that inference call, without switching into a separate account-management workflow.`}),`\n`,_jsx(Heading,{level:`2`,id:`primary-use-case-agents-paying-for-inference`,children:`Primary Use Case: Agents Paying for Inference`}),`\n`,_jsxs(_components.p,{children:[`x402 is designed for the case where an `,_jsx(_components.strong,{children:`agent`}),` needs to:`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Choose a model`}),`\n`,_jsx(_components.li,{children:`Call the model API`}),`\n`,_jsx(_components.li,{children:`Pay the inference fee`}),`\n`,_jsx(_components.li,{children:`Continue execution with the result`}),`\n`]}),`\n`,_jsx(_components.p,{children:`This is valuable for:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`AI agents operating in backend workflows`}),`\n`,_jsx(_components.li,{children:`Web3 agents or protocols that want payment-aware inference`}),`\n`,_jsx(_components.li,{children:`Multi-step automations that should treat inference as a directly payable resource`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`how-the-flow-works`,children:`How the Flow Works`}),`\n`,_jsxs(_components.p,{children:[`x402 on DGrid uses a `,_jsx(_components.strong,{children:`two-step request flow`}),`:`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Initial request without `,_jsx(_components.code,{children:`x-payment`})]}),`\nThe server returns `,_jsx(_components.code,{children:`402 Payment Required`}),` plus signable payment requirements.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Client signs and retries`}),`\nThe client generates the `,_jsx(_components.code,{children:`x-payment`}),` payload and sends the same inference request again with the payment header.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`This pattern keeps payment authorization explicit while still letting the inference call remain simple and automatable.`}),`\n`,_jsx(Heading,{level:`2`,id:`supported-payment-asset`,children:`Supported Payment Asset`}),`\n`,_jsx(_components.p,{children:`The current x402 endpoint uses:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Protocol`}),`: x402`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Network`}),`: `,_jsx(_components.code,{children:`eip155:56`}),` (BSC)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Payment token`}),`: `,_jsx(_components.code,{children:`USD1`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Asset contract`}),`: `,_jsx(_components.code,{children:`0x8d0D000Ee44948FC98c9B98A4FA4921476f08B0d`})]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`operational-notes`,children:`Operational Notes`}),`\n`,_jsxs(_components.p,{children:[`After successful settlement, the service records payment logs into the `,_jsx(_components.code,{children:`x402_payment_logs`}),` table on the backend.`]}),`\n`,_jsx(Heading,{level:`2`,id:`when-to-use-x402-vs-ai-gateway`,children:`When to Use x402 vs AI Gateway`}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.strong,{children:`AI Gateway`}),` when you want:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`classic API-key access`}),`\n`,_jsx(_components.li,{children:`unified account-based model routing`}),`\n`,_jsx(_components.li,{children:`long-running product integrations with standard billing workflows`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.strong,{children:`x402`}),` when you want:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`direct per-request payment`}),`\n`,_jsx(_components.li,{children:`no pre-funded account balance`}),`\n`,_jsx(_components.li,{children:`agent-friendly inference plus payment in one flow`}),`\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":"x402 API","sidebarTitle":"Overview","description":"DGrid's x402 API lets developers pay per inference call using the x402 micropayment protocol — no API keys or accounts required.","href":"/x402/overview"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Why x402 API Matters","slug":"why-x402-api-matters","depth":2,"children":[]},{"title":"Primary Use Case: Agents Paying for Inference","slug":"primary-use-case-agents-paying-for-inference","depth":2,"children":[]},{"title":"How the Flow Works","slug":"how-the-flow-works","depth":2,"children":[]},{"title":"Supported Payment Asset","slug":"supported-payment-asset","depth":2,"children":[]},{"title":"Operational Notes","slug":"operational-notes","depth":2,"children":[]},{"title":"When to Use x402 vs AI Gateway","slug":"when-to-use-x402-vs-ai-gateway","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"dgridai","siteName":"DGrid AI Docs","title":"x402 API - DGrid AI Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/x402/overview","matchLevel":0},"zh-Hant":{"href":"/zh-Hant/x402/overview","matchLevel":1},"ko":{"href":"/ko/x402/overview","matchLevel":1},"fr":{"href":"/fr/x402/overview","matchLevel":1},"es":{"href":"/es/x402/overview","matchLevel":1}}},"lastModified":"2026-07-02T09:33:57.301Z","originalFileLocation":"x402/overview.mdx","locale":"en"},"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=\"DGrid\u0026#x27;s x402 API lets developers pay per inference call using the x402 micropayment protocol — no API keys or accounts required.\">\u003cmeta data-mint-head name=\"application-name\" content=\"DGrid AI Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dgridai/TU6mO6G1dAMh6LGG/_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/dgridai/TU6mO6G1dAMh6LGG/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dgridai/TU6mO6G1dAMh6LGG/_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/dgridai/TU6mO6G1dAMh6LGG/_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/dgridai/TU6mO6G1dAMh6LGG/_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/dgridai/TU6mO6G1dAMh6LGG/_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/dgridai/TU6mO6G1dAMh6LGG/_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/dgridai/TU6mO6G1dAMh6LGG/_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/dgridai/TU6mO6G1dAMh6LGG/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"x402 API - DGrid AI Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"DGrid\u0026#x27;s x402 API lets developers pay per inference call using the x402 micropayment protocol — no API keys or accounts required.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"DGrid AI Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.dgrid.ai/x402/overview\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://dgridai.mintlify.app/_mintlify/api/og/v2?division=X402+API\u0026amp;title=x402+API\u0026amp;description=DGrid%27s+x402+API+lets+developers+pay+per+inference+call+using+the+x402+micropayment+protocol+%E2%80%94+no+API+keys+or+accounts+required.\u0026amp;theme=f10c407df10598d9a9a44a09\u0026amp;signature=a12c5f861152586847ed71764cd1f198c8acbdb0e7cf35bc2126f294e1ed0b93\">\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=\"x402 API - DGrid AI Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"DGrid\u0026#x27;s x402 API lets developers pay per inference call using the x402 micropayment protocol — no API keys or accounts required.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://dgridai.mintlify.app/_mintlify/api/og/v2?division=X402+API\u0026amp;title=x402+API\u0026amp;description=DGrid%27s+x402+API+lets+developers+pay+per+inference+call+using+the+x402+micropayment+protocol+%E2%80%94+no+API+keys+or+accounts+required.\u0026amp;theme=f10c407df10598d9a9a44a09\u0026amp;signature=a12c5f861152586847ed71764cd1f198c8acbdb0e7cf35bc2126f294e1ed0b93\">\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/dgridai/TU6mO6G1dAMh6LGG/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"DGrid AI Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#65A30D\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.dgrid.ai/x402/overview\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/x402/overview.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.dgrid.ai/x402/overview\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hant\" href=\"https://docs.dgrid.ai/zh-Hant/x402/overview\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ko\" href=\"https://docs.dgrid.ai/ko/x402/overview\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"fr\" href=\"https://docs.dgrid.ai/fr/x402/overview\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"es\" href=\"https://docs.dgrid.ai/es/x402/overview\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.dgrid.ai/x402/overview\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.dgrid.ai/#organization\",\"name\":\"DGrid AI Docs\",\"url\":\"https://docs.dgrid.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/dgridai/eFrQx07adP_MQw0i/logo/dgrid-horizontal-black.png?fit=max\u0026auto=format\u0026n=eFrQx07adP_MQw0i\u0026q=85\u0026s=aa7da302786ec058e3c91526a127736d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.dgrid.ai#website\",\"name\":\"DGrid AI Docs\",\"url\":\"https://docs.dgrid.ai\",\"publisher\":{\"@id\":\"https://docs.dgrid.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.dgrid.ai/x402/overview#webpage\",\"url\":\"https://docs.dgrid.ai/x402/overview\",\"name\":\"x402 API\",\"description\":\"DGrid's x402 API lets developers pay per inference call using the x402 micropayment protocol — no API keys or accounts required.\",\"dateModified\":\"2026-07-02T09:33:57.301Z\",\"isPartOf\":{\"@id\":\"https://docs.dgrid.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.dgrid.ai/x402/overview#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.dgrid.ai/x402/overview#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"DGrid AI Docs\",\"item\":\"https://docs.dgrid.ai\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"x402 API\",\"item\":\"https://docs.dgrid.ai/x402/overview\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.dgrid.ai/x402/overview#article\",\"headline\":\"x402 API\",\"name\":\"x402 API\",\"description\":\"DGrid's x402 API lets developers pay per inference call using the x402 micropayment protocol — no API keys or accounts required.\",\"url\":\"https://docs.dgrid.ai/x402/overview\",\"mainEntityOfPage\":{\"@id\":\"https://docs.dgrid.ai/x402/overview#webpage\"},\"dateModified\":\"2026-07-02T09:33:57.301Z\",\"publisher\":{\"@id\":\"https://docs.dgrid.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.dgrid.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"DGrid AI Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"DGrid AI Docs","nav":{"global":null,"languages":[{"language":"en","default":true,"tabs":[{"tab":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":""}]},{"tab":"API Reference","icon":"code","groups":[{"group":"GETTING STARTED","pages":[{"title":"Introduction","href":"/api-reference/introduction"}]},{"group":"MODEL API","pages":[{"group":"Chat","pages":[{"title":"Create chat completion","openapi":"api-reference/openapi.json POST /v1/chat/completions","href":"/api-reference/chat/create-chat-completion"},{"title":"Create response","openapi":"api-reference/openapi.json POST /v1/responses","href":"/api-reference/chat/create-response"},{"title":"Create message (Claude)","openapi":"api-reference/openapi.json POST /v1/messages","href":"/api-reference/chat/create-message"},{"title":"Generate content (Gemini)","openapi":"api-reference/openapi.json POST /v1/models/{model}:generateContent","href":"/api-reference/chat/generate-content"},{"title":"Gemini Media Recognition","openapi":"api-reference/openapi.json POST /v1/models/{model}:generateContent","href":"/api-reference/chat/gemini-media-recognition"}]},{"group":"Completions","pages":[{"title":"Create completion","openapi":"api-reference/openapi.json POST /v1/completions","href":"/api-reference/completions/create-completion"}]},{"group":"Embeddings","pages":[{"title":"Create embeddings","openapi":"api-reference/openapi.json POST /v1/embeddings","href":"/api-reference/embeddings/create-embedding"},{"title":"Create embeddings (legacy engines)","openapi":"api-reference/openapi.json POST /v1/engines/{engine}/embeddings","href":"/api-reference/embeddings/create-engine-embedding"}]},{"group":"Images","pages":[{"title":"Gemini Native Format","openapi":"api-reference/openapi.json POST /v1/models/{model}:generateContent","href":"/api-reference/images/gemini-native-format"},{"title":"OpenAI Chat Format","openapi":"api-reference/openapi.json POST /v1/chat/completions","href":"/api-reference/images/openai-chat-format"},{"title":"Create image","openapi":"api-reference/openapi.json POST /v1/images/generations","href":"/api-reference/images/create-image"},{"title":"Qwen Image Generations","openapi":"api-reference/openapi.json POST /v1/images/generations","href":"/api-reference/images/qwen-image-generations"},{"title":"Edit image","openapi":"api-reference/openapi.json POST /v1/images/edits","href":"/api-reference/images/edit-image"},{"title":"Qwen Image Edits","openapi":"api-reference/openapi.json POST /v1/images/edits","href":"/api-reference/images/qwen-image-edits"}]},{"group":"Audio","pages":[{"title":"Native Gemini Format","openapi":"api-reference/openapi.json POST /v1/models/{model}:generateContent","href":"/api-reference/audio/native-gemini-format"},{"title":"Create speech","openapi":"api-reference/openapi.json POST /v1/audio/speech","href":"/api-reference/audio/create-speech"},{"title":"Create transcription","openapi":"api-reference/openapi.json POST /v1/audio/transcriptions","href":"/api-reference/audio/create-transcription"},{"title":"Create translation","openapi":"api-reference/openapi.json POST /v1/audio/translations","href":"/api-reference/audio/create-translation"}]},{"group":"Moderations","pages":[{"title":"Create moderation","openapi":"api-reference/openapi.json POST /v1/moderations","href":"/api-reference/moderations/create-moderation"}]},{"group":"Models","pages":[{"title":"List models","openapi":"api-reference/openapi.json GET /v1/models","href":"/api-reference/models/list-models"}]},{"group":"Usage \u0026 Billing","pages":[{"title":"Get request billing details","href":"/api-reference/usage-and-billing/get-request-billing-details"}]},{"group":"Realtime","pages":[{"title":"Realtime","href":"/ai-gateway/model-api/realtime"}]}]},{"group":"MANAGEMENT API","pages":[{"title":"Management API Keys","href":"/management-api-keys"},{"title":"Get account balance","sidebarTitle":"Get account balance","href":"/api-reference/management/get-account-balance"}]},{"group":"WEBHOOKS","pages":[{"title":"Webhook guide","sidebarTitle":"Webhook guide","description":"Receive DGrid events with a custom HTTPS endpoint, verify signatures, and handle tests, retries, and duplicate deliveries.","href":"/api-reference/webhooks/overview"}]},{"group":"X402 API","pages":[{"title":"x402 API","sidebarTitle":"Overview","href":"/x402/overview"},{"title":"API Reference","description":"Endpoint reference for DGrid's x402 API, including request format, payment headers, response codes, and pay-per-inference billing details.","href":"/x402/api-reference"}]}]}]},{"language":"zh-Hant","navbar":{"links":[{"href":"https://blog.dgrid.ai/","label":"部落格"},{"href":"https://telegram.me/dgrid_ai","label":"支援"}],"primary":{"type":"button","label":"儀表板","href":"https://dgrid.ai/overview"}},"pages":[{"title":"zh-Hant","href":"/zh-Hant/x402/overview"}]},{"language":"ko","navbar":{"links":[{"href":"https://blog.dgrid.ai/","label":"블로그"},{"href":"https://telegram.me/dgrid_ai","label":"지원"}],"primary":{"type":"button","label":"대시보드","href":"https://dgrid.ai/overview"}},"pages":[{"title":"ko","href":"/ko/x402/overview"}]},{"language":"fr","navbar":{"links":[{"href":"https://blog.dgrid.ai/","label":"Blog"},{"href":"https://telegram.me/dgrid_ai","label":"Assistance"}],"primary":{"type":"button","label":"Tableau de bord","href":"https://dgrid.ai/overview"}},"pages":[{"title":"fr","href":"/fr/x402/overview"}]},{"language":"es","navbar":{"links":[{"href":"https://blog.dgrid.ai/","label":"Blog"},{"href":"https://telegram.me/dgrid_ai","label":"Soporte"}],"primary":{"type":"button","label":"Panel","href":"https://dgrid.ai/overview"}},"pages":[{"title":"es","href":"/es/x402/overview"}]}]},"title":"x402 API - DGrid AI Docs","buildId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","deploymentId":"dpl_2xiSHD9XEvLsPGPcfoMtkLTB3dy9","dynamics":[],"chunks":[]}