{ "success": false, "error": { "code": "range_too_large", "message": "Time range must not exceed 31 days.", "type": "usage_query_error" }}
Use an API Key to query spending within a specified time range, filter by model, and group by model, calendar day, or both. This endpoint returns aggregated results directly; no task creation or task-status polling is required.
Authenticate with the same API Key used for model calls, using a Bearer Token. Get a key from the API Key management page.
Authorization: Bearer YOUR_API_KEY
Queries are available even with a zero balance. This endpoint does not check the balance, but still checks API Key status, expiration, IP allowlists, and account status.
Inclusive start time. Accepts a Unix timestamp in seconds or an RFC3339 string with a timezone, such as 2026-09-01T00:00:00+08:00.Defaults to 24 hours before end when omitted. Timestamps use seconds, not milliseconds.
Exclusive end time. Uses the same formats as start and defaults to the current time when omitted.Must be later than start, and end - start must not exceed 31 days.
Model names; all models are included when omitted. Separate multiple models with commas, up to 50 models.Exact, case-insensitive matching. Wildcards are not supported.Example: gpt-5.6-luna,sora-2
IANA timezone name; defaults to Asia/Shanghai.Only affects calendar-day boundaries when group_by includes date; it does not change the query start or end instants. RFC3339 times are still parsed using their own timezone offsets.
account: all API Keys belonging to the account of the current API Key
The query interval is [start, end): inclusive start, exclusive end. Using the same boundary as one query’s end and the next query’s start avoids counting that boundary twice.When building URLs manually, encode the + in RFC3339 as %2B. The examples use cURL --data-urlencode, Python params, and JavaScript URLSearchParams to handle encoding automatically.
Returned for usage-query errors, with code, message, and type; type is usage_query_error. Authentication errors with HTTP 401 / 403 are returned by the authentication layer.
Uses successfully billed call records, the same data as the website dashboard
Failed calls and tasks refunded after failure are excluded; no manual offset is needed. Partially successful image batches are billed for the images actually delivered
Spending is attributed to the billing posting time. Asynchronous image/video tasks are posted at completion, not submission; tasks crossing midnight belong to the completion day
Deleting and recreating an API Key creates a new Key; querying scope=key with the new Key does not include the old Key’s history
Manual balance adjustments are not call spending and are excluded
Range exceeds 31 days; split it into multiple queries
400
invalid_tz
Unknown IANA timezone
400
invalid_group_by
Invalid grouping option
400
invalid_scope
Invalid query scope
400
too_many_models
More than 50 models
401 / 403
—
Invalid or expired API Key, IP not allowed, or disabled account
429
—
Exceeds 60 queries per Key per minute, or a global API rate limit
503
usage_unavailable
Usage data is temporarily unavailable; retry later
A 503 usage_unavailable response returns no amounts. It means the query is unavailable, not that spending is zero. Do not convert failed responses into zero amounts or overwrite a previous successful result.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"APIMart","colors":{"primary":"#2563EB","light":"#3B82F6","dark":"#1D4ED8"},"favicon":"https://mintcdn.com/apicore/1GnRrmOhqkTFCvFb/logo/logo.png?fit=max\u0026auto=format\u0026n=1GnRrmOhqkTFCvFb\u0026q=85\u0026s=609be15c3f1f4e4b765c5945c2871ae9","navbar":{"links":[{"icon":"x-twitter","href":"https://x.com/APIMart_","label":""},{"icon":"discord","href":"https://discord.gg/V8zqssyZ5c","label":""},{"icon":"weixin","href":"https://cdn.apimart.ai/social-media/wechat.jpg","label":""}],"primary":{"type":"button","label":"Dashboard","href":"https://apimart.ai"}},"footer":{"socials":{"x":"https://x.com/APIMart_","website":"https://apimart.ai","discord":"https://discord.gg/V8zqssyZ5c"}},"seo":{"metatags":{"og:site_name":"APIMart","og:type":"website","keywords":"OpenAI compatible, API gateway, GPT-5, Claude, Gemini, multi-provider, transparent pricing, SLA","twitter:card":"summary_large_image","twitter:site":"@APIMart_","twitter:creator":"@APIMart_"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"languages":[{"language":"en","href":"en"},{"language":"zh-Hans","href":"cn"},{"language":"ja","href":"ja"},{"language":"ko","href":"ko"},{"language":"ru","href":"ru"},{"language":"de","href":"de"},{"language":"fr","href":"fr"},{"language":"pt","href":"pt"},{"language":"id","href":"id"},{"language":"es","href":"es"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"apicore","hasAudioNarration":false,"actualSubdomain":"apicore","customDomains":["docs.apimart.ai"],"gitSource":{"type":"github","owner":"zhihong-apimart","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adb20ce09adb9872106f089","collectionId":"301329eb-6159-43e8-b9f0-94082f867850","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adb20ce09adb9872106f089"},"entitlements":{},"buildId":"6adb20ce09adb9872106f089","clientVersion":"0.0.3964","searchFilterCounts":[{"language":"zh-Hans","tag":"API 手册","count":160},{"language":"de","tag":"API-Handbuch","count":160},{"language":"en","tag":"API Manual","count":160},{"language":"es","tag":"Manual de la API","count":160},{"language":"fr","tag":"Manuel API","count":160},{"language":"id","tag":"Panduan API","count":160},{"language":"ja","tag":"APIマニュアル","count":160},{"language":"ko","tag":"API 매뉴얼","count":160},{"language":"pt","tag":"Manual da API","count":160},{"language":"ru","tag":"Руководство API","count":160},{"language":"zh-Hans","tag":"音频系列","count":51},{"language":"de","tag":"Audioserie","count":51},{"language":"en","tag":"Audio Series","count":51},{"language":"es","tag":"Serie de audio","count":51},{"language":"fr","tag":"Série Audio","count":51},{"language":"id","tag":"Seri Audio","count":51},{"language":"ja","tag":"オーディオシリーズ","count":51},{"language":"ko","tag":"오디오 시리즈","count":51},{"language":"pt","tag":"Série de Áudio","count":51},{"language":"ru","tag":"Аудиосерия","count":51},{"language":"zh-Hans","tag":"图像系列","count":49},{"language":"de","tag":"Bildserie","count":49},{"language":"en","tag":"Image Series","count":49},{"language":"es","tag":"Serie de imágenes","count":49},{"language":"fr","tag":"Série Image","count":49},{"language":"id","tag":"Seri Gambar","count":49},{"language":"ja","tag":"画像シリーズ","count":49},{"language":"ko","tag":"이미지 시리즈","count":49},{"language":"pt","tag":"Série de Imagem","count":49},{"language":"ru","tag":"Серия изображений","count":49},{"language":"zh-Hans","tag":"视频系列","count":42},{"language":"de","tag":"Videoserie","count":42},{"language":"en","tag":"Video Series","count":42},{"language":"es","tag":"Serie de video","count":42},{"language":"fr","tag":"Série Vidéo","count":42},{"language":"id","tag":"Seri Video","count":42},{"language":"ja","tag":"動画シリーズ","count":42},{"language":"ko","tag":"비디오 시리즈","count":42},{"language":"pt","tag":"Série de Vídeo","count":42},{"language":"ru","tag":"Видеосерия","count":42},{"language":"zh-Hans","tag":"Suno","count":35},{"language":"de","tag":"Suno","count":35},{"language":"en","tag":"Suno","count":35},{"language":"es","tag":"Suno","count":35},{"language":"fr","tag":"Suno","count":35},{"language":"id","tag":"Suno","count":35},{"language":"ja","tag":"Suno","count":35},{"language":"ko","tag":"Suno","count":35},{"language":"pt","tag":"Suno","count":35},{"language":"ru","tag":"Suno","count":35},{"language":"zh-Hans","tag":"Midjourney","count":19},{"language":"de","tag":"Midjourney","count":19},{"language":"en","tag":"Midjourney","count":19},{"language":"es","tag":"Midjourney","count":19},{"language":"fr","tag":"Midjourney","count":19},{"language":"id","tag":"Midjourney","count":19},{"language":"ja","tag":"Midjourney","count":19},{"language":"ko","tag":"Midjourney","count":19},{"language":"pt","tag":"Midjourney","count":19},{"language":"ru","tag":"Midjourney","count":19},{"language":"zh-Hans","tag":"Flow Music","count":14},{"language":"de","tag":"Flow Music","count":14},{"language":"en","tag":"Flow Music","count":14},{"language":"es","tag":"Flow Music","count":14},{"language":"fr","tag":"Flow Music","count":14},{"language":"id","tag":"Flow Music","count":14},{"language":"ja","tag":"Flow Music","count":14},{"language":"ko","tag":"Flow Music","count":14},{"language":"pt","tag":"Flow Music","count":14},{"language":"ru","tag":"Flow Music","count":14},{"language":"ja","tag":"よくある質問","count":12},{"language":"ko","tag":"자주 묻는 질문","count":12},{"language":"zh-Hans","tag":"集成指南","count":11},{"language":"de","tag":"Integrationen","count":11},{"language":"en","tag":"Integrations","count":11},{"language":"es","tag":"Integraciones","count":11},{"language":"fr","tag":"Intégrations","count":11},{"language":"id","tag":"Integrasi","count":11},{"language":"ja","tag":"統合ガイド","count":11},{"language":"ko","tag":"통합 가이드","count":11},{"language":"pt","tag":"Integrações","count":11},{"language":"ru","tag":"Интеграции","count":11},{"language":"zh-Hans","tag":"文字系列","count":9},{"language":"de","tag":"Textserie","count":9},{"language":"en","tag":"Text Series","count":9},{"language":"es","tag":"Serie de texto","count":9},{"language":"fr","tag":"Série Texte","count":9},{"language":"id","tag":"Seri Teks","count":9},{"language":"ja","tag":"テキストシリーズ","count":9},{"language":"ko","tag":"텍스트 시리즈","count":9},{"language":"pt","tag":"Série de Texto","count":9},{"language":"ru","tag":"Текстовая серия","count":9},{"language":"zh-Hans","tag":"概览","count":7},{"language":"de","tag":"Übersicht","count":7},{"language":"en","tag":"Overview","count":7},{"language":"es","tag":"Visión general","count":7},{"language":"fr","tag":"Aperçu","count":7},{"language":"id","tag":"Ikhtisar","count":7},{"language":"pt","tag":"Visão Geral","count":7},{"language":"ru","tag":"Обзор","count":7}]},"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":[{"filePath":"style.css","content":"[id^=param-] a[href^=\"#param-\"]{display:none}[id^=param-] button[data-component-part=field-name]{display:inline-flex;align-items:center;gap:6px;margin:-2px -4px;padding:2px 4px;border-radius:6px;cursor:copy;user-select:text;transition:background-color 150ms ease}[id^=param-] button[data-component-part=field-name]:hover{background:rgb(37 99 235/8%)}[id^=param-] button[data-component-part=field-name]:not([data-copy-state])::after{content:\"\";display:inline-block;flex:0 0 auto;width:16px;height:16px;background-color:rgb(100 116 139);-webkit-mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E\") center/contain no-repeat;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E\") center/contain no-repeat;transition:background-color 150ms ease}[id^=param-] button[data-component-part=field-name]:hover::after{background-color:rgb(37 99 235)}[id^=param-] button[data-component-part=field-name][data-copy-state=copied]::after{content:\"\";display:inline-block;flex:0 0 auto;width:16px;height:16px;background-color:rgb(5 150 105);-webkit-mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3C/svg%3E\") center/contain no-repeat;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3C/svg%3E\") center/contain no-repeat}[id^=param-] button[data-component-part=field-name][data-copy-state=failed]::after{content:\"\";display:inline-block;flex:0 0 auto;width:16px;height:16px;background-color:rgb(220 38 38);-webkit-mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E\") center/contain no-repeat;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E\") center/contain no-repeat}html.dark [id^=param-] button[data-component-part=field-name]:not([data-copy-state])::after{background-color:rgb(203 213 225)}"}],"page":{"pagePath":"en/api-reference/account/usage","slug":"/en/api-reference/account/usage","pageMetadata":{"title":"Query Usage and Spending","description":" - Query spending and request statistics for a specified time range\n- Filter by model and group by model or calendar day\n- Query usage for the current API Key or the entire account\n- Returns USD amounts, credits, request counts, and token usage ","api":"GET https://api.apimart.ai/v1/usage","href":"/en/api-reference/account/usage"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n li: \"li\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.ul, {\n children: [\"\\n\", _jsx(_components.li, {\n children: \"Query spending and request statistics for a specified time range\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"Filter by model and group by model or calendar day\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"Query usage for the current API Key or the entire account\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"Returns USD amounts, credits, request counts, and token usage\"\n }), \"\\n\"]\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`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Info,Note,ParamField,ResponseField,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Use an API Key to query spending within a specified time range, filter by model, and group by model, calendar day, or both. This endpoint returns aggregated results directly; no task creation or task-status polling is required.`}),`\n`,`\n`,`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsxs(ParamField,{header:`Authorization`,type:`string`,required:true,id:`param-authorization`,children:[_jsxs(_components.p,{children:[`Authenticate with the same API Key used for model calls, using a Bearer Token. Get a key from the `,_jsx(_components.a,{href:`https://apimart.ai/keys`,children:`API Key management page`}),`.`]}),_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Authorization: Bearer YOUR_API_KEY`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),`\n`,_jsx(Info,{children:_jsx(_components.p,{children:`Queries are available even with a zero balance. This endpoint does not check the balance, but still checks API Key status, expiration, IP allowlists, and account status.`})}),`\n`,_jsx(Heading,{level:`2`,id:`endpoints`,children:`Endpoints`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /v1/usage`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /usage`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Both endpoints provide the same functionality and support CORS. Keep your API Key private; do not expose it in public frontend code.`}),`\n`,_jsx(Heading,{level:`2`,id:`request-parameters`,children:`Request parameters`}),`\n`,_jsx(_components.p,{children:`All parameters are passed as URL query parameters.`}),`\n`,_jsxs(ParamField,{query:`start`,type:`integer | string`,id:`param-start`,children:[_jsxs(_components.p,{children:[`Inclusive start time. Accepts a Unix timestamp in seconds or an RFC3339 string with a timezone, such as `,_jsx(_components.code,{children:`2026-09-01T00:00:00+08:00`}),`.`]}),_jsxs(_components.p,{children:[`Defaults to 24 hours before `,_jsx(_components.code,{children:`end`}),` when omitted. Timestamps use seconds, not milliseconds.`]})]}),`\n`,_jsxs(ParamField,{query:`end`,type:`integer | string`,id:`param-end`,children:[_jsxs(_components.p,{children:[`Exclusive end time. Uses the same formats as `,_jsx(_components.code,{children:`start`}),` and defaults to the current time when omitted.`]}),_jsxs(_components.p,{children:[`Must be later than `,_jsx(_components.code,{children:`start`}),`, and `,_jsx(_components.code,{children:`end - start`}),` must not exceed 31 days.`]})]}),`\n`,_jsxs(ParamField,{query:`model`,type:`string`,id:`param-model`,children:[_jsxs(_components.p,{children:[`Model names; all models are included when omitted. Separate multiple models with commas, up to `,_jsx(_components.code,{children:`50`}),` models.`]}),_jsx(_components.p,{children:`Exact, case-insensitive matching. Wildcards are not supported.`}),_jsxs(_components.p,{children:[`Example: `,_jsx(_components.code,{children:`gpt-5.6-luna,sora-2`})]})]}),`\n`,_jsxs(ParamField,{query:`group_by`,type:`string`,default:`none`,id:`param-group-by`,children:[_jsx(_components.p,{children:`Grouping options:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`none`}),`: totals only; `,_jsx(_components.code,{children:`items`}),` is an empty array`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`model`}),`: group by model`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`date`}),`: group by calendar day`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`model,date`}),`: group by both model and calendar day`]}),`\n`]})]}),`\n`,_jsxs(ParamField,{query:`tz`,type:`string`,default:`Asia/Shanghai`,id:`param-tz`,children:[_jsxs(_components.p,{children:[`IANA timezone name; defaults to `,_jsx(_components.code,{children:`Asia/Shanghai`}),`.`]}),_jsxs(_components.p,{children:[`Only affects calendar-day boundaries when `,_jsx(_components.code,{children:`group_by`}),` includes `,_jsx(_components.code,{children:`date`}),`; it does not change the query start or end instants. RFC3339 times are still parsed using their own timezone offsets.`]})]}),`\n`,_jsxs(ParamField,{query:`scope`,type:`string`,default:`key`,id:`param-scope`,children:[_jsx(_components.p,{children:`Query scope:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`key`}),`: only the current API Key (default)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`account`}),`: all API Keys belonging to the account of the current API Key`]}),`\n`]})]}),`\n`,_jsxs(Note,{children:[_jsxs(_components.p,{children:[`The query interval is `,_jsx(_components.code,{children:`[start, end)`}),`: inclusive start, exclusive end. Using the same boundary as one query’s `,_jsx(_components.code,{children:`end`}),` and the next query’s `,_jsx(_components.code,{children:`start`}),` avoids counting that boundary twice.`]}),_jsxs(_components.p,{children:[`When building URLs manually, encode the `,_jsx(_components.code,{children:`+`}),` in RFC3339 as `,_jsx(_components.code,{children:`%2B`}),`. The examples use cURL `,_jsx(_components.code,{children:`--data-urlencode`}),`, Python `,_jsx(_components.code,{children:`params`}),`, and JavaScript `,_jsx(_components.code,{children:`URLSearchParams`}),` to handle encoding automatically.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`request-examples`,children:`Request examples`}),`\n`,_jsx(Heading,{level:`3`,id:`total-spending-for-the-current-api-key-over-the-last-24-hours`,children:`Total spending for the current API Key over the last 24 hours`}),`\n`,_jsx(_components.p,{children:`Omit query parameters to use the default time range, scope, and grouping:`}),`\n`,_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://api.apimart.ai/v1/usage'`}),_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:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003ctoken>'`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`daily-spending-for-a-specified-model-across-the-account`,children:`Daily spending for a specified model across the account`}),`\n`,_jsx(_components.p,{children:`Query spending from September 11 to September 18, 2026, in Beijing time, excluding September 18:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,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:`8`,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:` --get`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.apimart.ai/v1/usage'`}),_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:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003ctoken>'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'start=1789056000'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'end=1789660800'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'model=gpt-5.6-luna'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'group_by=date'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'scope=account'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'tz=Asia/Shanghai'`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`group-by-model-and-calendar-day`,children:`Group by model and calendar day`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,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:`7`,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:` --get`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.apimart.ai/v1/usage'`}),_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:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003ctoken>'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'start=2026-09-01T00:00:00+08:00'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'end=2026-09-08T00:00:00+08:00'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'model=gpt-5.6-luna,sora-2'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'group_by=model,date'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'tz=Asia/Shanghai'`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`With this grouping, each `,_jsx(_components.code,{children:`items`}),` entry contains both `,_jsx(_components.code,{children:`model`}),` and `,_jsx(_components.code,{children:`date`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`response-fields`,children:`Response fields`}),`\n`,_jsx(ResponseField,{name:`success`,type:`boolean`,id:`param-success`,children:_jsxs(_components.p,{children:[`Whether the query succeeded: `,_jsx(_components.code,{children:`true`}),` on success, `,_jsx(_components.code,{children:`false`}),` for usage-query errors.`]})}),`\n`,_jsxs(ResponseField,{name:`data`,type:`object`,id:`param-data`,children:[_jsx(_components.p,{children:`On success, contains the query range, totals, and grouped details.`}),_jsxs(Expandable,{title:`data properties`,children:[_jsx(ResponseField,{name:`scope`,type:`string`,id:`param-scope-1`,children:_jsxs(_components.p,{children:[`Query scope: `,_jsx(_components.code,{children:`key`}),` or `,_jsx(_components.code,{children:`account`}),`.`]})}),_jsx(ResponseField,{name:`start`,type:`integer`,id:`param-start-1`,children:_jsx(_components.p,{children:`Actual query start time as a Unix timestamp in seconds, inclusive.`})}),_jsx(ResponseField,{name:`end`,type:`integer`,id:`param-end-1`,children:_jsx(_components.p,{children:`Actual query end time as a Unix timestamp in seconds, exclusive.`})}),_jsx(ResponseField,{name:`tz`,type:`string`,id:`param-tz-1`,children:_jsx(_components.p,{children:`Timezone used for calendar-day grouping.`})}),_jsx(ResponseField,{name:`group_by`,type:`string`,id:`param-group-by-1`,children:_jsxs(_components.p,{children:[`Grouping: `,_jsx(_components.code,{children:`none`}),`, `,_jsx(_components.code,{children:`model`}),`, `,_jsx(_components.code,{children:`date`}),`, or `,_jsx(_components.code,{children:`model,date`}),`.`]})}),_jsx(ResponseField,{name:`total`,type:`object`,id:`param-total`,children:_jsx(_components.p,{children:`Totals within the query range; see the statistics below.`})}),_jsxs(ResponseField,{name:`items`,type:`object[]`,id:`param-items`,children:[_jsxs(_components.p,{children:[`Grouped details, sorted by `,_jsx(_components.code,{children:`amount_usd`}),` in descending order. Empty when `,_jsx(_components.code,{children:`group_by=none`}),`. Each entry includes the statistics below.`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Entries include `,_jsx(_components.code,{children:`model`}),` when `,_jsx(_components.code,{children:`group_by`}),` includes `,_jsx(_components.code,{children:`model`})]}),`\n`,_jsxs(_components.li,{children:[`Entries include `,_jsx(_components.code,{children:`date`}),` when `,_jsx(_components.code,{children:`group_by`}),` includes `,_jsx(_components.code,{children:`date`}),`, formatted as `,_jsx(_components.code,{children:`YYYY-MM-DD`}),` with calendar days determined by `,_jsx(_components.code,{children:`tz`})]}),`\n`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`data.total`}),` and `,_jsx(_components.code,{children:`data.items[]`}),` share these statistics:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`amount_usd`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`USD amount, rounded to 6 decimal places`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`credits`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[`Platform credits, equal to `,_jsx(_components.code,{children:`amount_usd × 10`}),`, matching the units displayed on the website`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`requests`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Number of successfully billed calls`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`prompt_tokens`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Input tokens; usually 0 for image/video models billed per request or per second`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`completion_tokens`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Output tokens; usually 0 for image/video models billed per request or per second`})]})]})]}),`\n`,_jsx(ResponseField,{name:`error`,type:`object`,id:`param-error`,children:_jsxs(_components.p,{children:[`Returned for usage-query errors, with `,_jsx(_components.code,{children:`code`}),`, `,_jsx(_components.code,{children:`message`}),`, and `,_jsx(_components.code,{children:`type`}),`; `,_jsx(_components.code,{children:`type`}),` is `,_jsx(_components.code,{children:`usage_query_error`}),`. Authentication errors with HTTP 401 / 403 are returned by the authentication layer.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`rate-limits-and-caching`,children:`Rate limits and caching`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Up to `,_jsx(_components.code,{children:`60`}),` queries per API Key per minute; global API rate limits also apply`]}),`\n`,_jsxs(_components.li,{children:[`Results with identical parameters are cached for `,_jsx(_components.code,{children:`60`}),` seconds; the `,_jsx(_components.code,{children:`X-Usage-Cache`}),` response header is `,_jsx(_components.code,{children:`hit`}),` or `,_jsx(_components.code,{children:`miss`})]}),`\n`,_jsx(_components.li,{children:`Usage records are typically available within 1 second, but the last minute of data may be incomplete, with additional cache delay`}),`\n`,_jsx(_components.li,{children:`Poll no more frequently than once a minute; do not use this endpoint as a real-time billing notification`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`accounting-rules`,children:`Accounting rules`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Uses successfully billed call records, the same data as the website dashboard`}),`\n`,_jsx(_components.li,{children:`Failed calls and tasks refunded after failure are excluded; no manual offset is needed. Partially successful image batches are billed for the images actually delivered`}),`\n`,_jsx(_components.li,{children:`Spending is attributed to the billing posting time. Asynchronous image/video tasks are posted at completion, not submission; tasks crossing midnight belong to the completion day`}),`\n`,_jsxs(_components.li,{children:[`Deleting and recreating an API Key creates a new Key; querying `,_jsx(_components.code,{children:`scope=key`}),` with the new Key does not include the old Key’s history`]}),`\n`,_jsx(_components.li,{children:`Manual balance adjustments are not call spending and are excluded`}),`\n`,_jsx(_components.li,{children:`Data after April 27, 2026, is available`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`error-handling`,children:`Error handling`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`HTTP status`}),_jsx(_components.th,{children:_jsx(_components.code,{children:`error.code`})}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`invalid_start`}),` / `,_jsx(_components.code,{children:`invalid_end`})]}),_jsx(_components.td,{children:`Invalid start or end time format`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_range`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`end`}),` is not later than `,_jsx(_components.code,{children:`start`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`range_too_large`})}),_jsx(_components.td,{children:`Range exceeds 31 days; split it into multiple queries`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_tz`})}),_jsx(_components.td,{children:`Unknown IANA timezone`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_group_by`})}),_jsx(_components.td,{children:`Invalid grouping option`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_scope`})}),_jsx(_components.td,{children:`Invalid query scope`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`too_many_models`})}),_jsx(_components.td,{children:`More than 50 models`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401 / 403`}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`Invalid or expired API Key, IP not allowed, or disabled account`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`429`}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`Exceeds 60 queries per Key per minute, or a global API rate limit`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`503`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`usage_unavailable`})}),_jsx(_components.td,{children:`Usage data is temporarily unavailable; retry later`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`A `,_jsx(_components.code,{children:`503 usage_unavailable`}),` response returns no amounts. It means the query is unavailable, not that spending is zero. Do not convert failed responses into zero amounts or overwrite a previous successful result.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`comparison-with-other-endpoints`,children:`Comparison with other endpoints`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Endpoint`}),_jsx(_components.th,{children:`Capability`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`GET /v1/dashboard/billing/usage`})}),_jsx(_components.td,{children:`Cumulative spending only; no model or time filters`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`POST /v1/logs/export`})}),_jsx(_components.td,{children:`Asynchronous export of call details (CSV / XLSX); aggregate them yourself`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`GET /v1/usage`})}),_jsx(_components.td,{children:`Query by time and model; directly returns totals and grouped spending`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`For remaining quota, use `,_jsx(_components.a,{href:`/en/api-reference/account/token-balance`,children:`Query Token Balance`}),` or `,_jsx(_components.a,{href:`/en/api-reference/account/user-balance`,children:`Query User Balance`}),`.`]})]})}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":"Query Usage and Spending","description":" - Query spending and request statistics for a specified time range\n- Filter by model and group by model or calendar day\n- Query usage for the current API Key or the entire account\n- Returns USD amounts, credits, request counts, and token usage ","api":"GET https://api.apimart.ai/v1/usage","href":"/en/api-reference/account/usage"}}},"mdxSourceWithNoJs":{"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`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Info,Note,ParamField,RequestExample,ResponseExample,ResponseField,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Use an API Key to query spending within a specified time range, filter by model, and group by model, calendar day, or both. This endpoint returns aggregated results directly; no task creation or task-status polling is required.`}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`5`,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:`5`,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:` --get`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.apimart.ai/v1/usage'`}),_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:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003ctoken>'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'start=2026-09-01T00:00:00+08:00'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'end=2026-09-08T00:00:00+08:00'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'group_by=model'`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`20`,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:`20`,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:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_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://api.apimart.ai/v1/usage\"`}),_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:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer \u003ctoken>\"`}),_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:` params`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"start\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-09-01T00:00:00+08:00\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"end\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-09-08T00:00:00+08:00\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"group_by\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"model\"`}),_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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`30`}),_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(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`payload `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` not`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.ok `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`or`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` not`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` payload.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"success\"`}),_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\":`#D4D4D4`},children:` message `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` payload.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {}).get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Usage query failed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` raise`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` RuntimeError`}),_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:`\"HTTP `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response.status_code`}),_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:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`message`}),_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`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(payload[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"total\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(payload[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`][`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"items\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`20`,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:`20`,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:` url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.apimart.ai/v1/usage\"`}),_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:`url`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`search`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` URLSearchParams`}),_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:` start:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"2026-09-01T00:00:00+08:00\"`}),_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:` end:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"2026-09-08T00:00:00+08:00\"`}),_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:` group_by:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\"`}),_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\":`#D4D4D4`},children:`}).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toString`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_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:` response`}),_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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`url`}),_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 \u003ctoken>\"`}),_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`,_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:` payload`}),_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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ||`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`payload`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`success`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `HTTP \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`response`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_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:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`payload`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`?.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ??`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Usage query failed\"`}),_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(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`payload`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`total`}),_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:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`payload`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`items`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})})]}),`\n`,_jsxs(ResponseExample,{children:[_jsx(CodeBlock,{filename:`200`,numberOfLines:`35`,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:`35`,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:` \"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_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:` \"data\"`}),_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:` \"scope\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"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:` \"start\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1788192000`}),_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:` \"end\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1788796800`}),_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:` \"tz\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Asia/Shanghai\"`}),_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:` \"group_by\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"model\"`}),_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:` \"total\"`}),_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:` \"amount_usd\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`12.3456`}),_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:` \"credits\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`123.456`}),_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:` \"requests\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1834`}),_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:` \"prompt_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`902311`}),_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:` \"completion_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`215044`})]}),`\n`,_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:` \"items\"`}),_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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gpt-5.6-luna\"`}),_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:` \"amount_usd\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`9.1271`}),_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:` \"credits\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`91.271`}),_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:` \"requests\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1520`}),_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:` \"prompt_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`880120`}),_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:` \"completion_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`201300`})]}),`\n`,_jsx(_components.span,{className:`line`,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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sora-2\"`}),_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:` \"amount_usd\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3.2185`}),_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:` \"credits\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`32.185`}),_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:` \"requests\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`314`}),_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:` \"prompt_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`22191`}),_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:` \"completion_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`13744`})]}),`\n`,_jsx(_components.span,{className:`line`,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(_components.span,{className:`line`,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(CodeBlock,{filename:`400`,numberOfLines:`8`,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:`8`,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:` \"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_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:`: {`})]}),`\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:`\"range_too_large\"`}),_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:`\"Time range must not exceed 31 days.\"`}),_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:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"usage_query_error\"`})]}),`\n`,_jsx(_components.span,{className:`line`,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`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsxs(ParamField,{header:`Authorization`,type:`string`,required:true,id:`param-authorization`,children:[_jsxs(_components.p,{children:[`Authenticate with the same API Key used for model calls, using a Bearer Token. Get a key from the `,_jsx(_components.a,{href:`https://apimart.ai/keys`,children:`API Key management page`}),`.`]}),_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Authorization: Bearer YOUR_API_KEY`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]}),`\n`,_jsx(Info,{children:_jsx(_components.p,{children:`Queries are available even with a zero balance. This endpoint does not check the balance, but still checks API Key status, expiration, IP allowlists, and account status.`})}),`\n`,_jsx(Heading,{level:`2`,id:`endpoints`,children:`Endpoints`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /v1/usage`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`GET /usage`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Both endpoints provide the same functionality and support CORS. Keep your API Key private; do not expose it in public frontend code.`}),`\n`,_jsx(Heading,{level:`2`,id:`request-parameters`,children:`Request parameters`}),`\n`,_jsx(_components.p,{children:`All parameters are passed as URL query parameters.`}),`\n`,_jsxs(ParamField,{query:`start`,type:`integer | string`,id:`param-start`,children:[_jsxs(_components.p,{children:[`Inclusive start time. Accepts a Unix timestamp in seconds or an RFC3339 string with a timezone, such as `,_jsx(_components.code,{children:`2026-09-01T00:00:00+08:00`}),`.`]}),_jsxs(_components.p,{children:[`Defaults to 24 hours before `,_jsx(_components.code,{children:`end`}),` when omitted. Timestamps use seconds, not milliseconds.`]})]}),`\n`,_jsxs(ParamField,{query:`end`,type:`integer | string`,id:`param-end`,children:[_jsxs(_components.p,{children:[`Exclusive end time. Uses the same formats as `,_jsx(_components.code,{children:`start`}),` and defaults to the current time when omitted.`]}),_jsxs(_components.p,{children:[`Must be later than `,_jsx(_components.code,{children:`start`}),`, and `,_jsx(_components.code,{children:`end - start`}),` must not exceed 31 days.`]})]}),`\n`,_jsxs(ParamField,{query:`model`,type:`string`,id:`param-model`,children:[_jsxs(_components.p,{children:[`Model names; all models are included when omitted. Separate multiple models with commas, up to `,_jsx(_components.code,{children:`50`}),` models.`]}),_jsx(_components.p,{children:`Exact, case-insensitive matching. Wildcards are not supported.`}),_jsxs(_components.p,{children:[`Example: `,_jsx(_components.code,{children:`gpt-5.6-luna,sora-2`})]})]}),`\n`,_jsxs(ParamField,{query:`group_by`,type:`string`,default:`none`,id:`param-group-by`,children:[_jsx(_components.p,{children:`Grouping options:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`none`}),`: totals only; `,_jsx(_components.code,{children:`items`}),` is an empty array`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`model`}),`: group by model`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`date`}),`: group by calendar day`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`model,date`}),`: group by both model and calendar day`]}),`\n`]})]}),`\n`,_jsxs(ParamField,{query:`tz`,type:`string`,default:`Asia/Shanghai`,id:`param-tz`,children:[_jsxs(_components.p,{children:[`IANA timezone name; defaults to `,_jsx(_components.code,{children:`Asia/Shanghai`}),`.`]}),_jsxs(_components.p,{children:[`Only affects calendar-day boundaries when `,_jsx(_components.code,{children:`group_by`}),` includes `,_jsx(_components.code,{children:`date`}),`; it does not change the query start or end instants. RFC3339 times are still parsed using their own timezone offsets.`]})]}),`\n`,_jsxs(ParamField,{query:`scope`,type:`string`,default:`key`,id:`param-scope`,children:[_jsx(_components.p,{children:`Query scope:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`key`}),`: only the current API Key (default)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`account`}),`: all API Keys belonging to the account of the current API Key`]}),`\n`]})]}),`\n`,_jsxs(Note,{children:[_jsxs(_components.p,{children:[`The query interval is `,_jsx(_components.code,{children:`[start, end)`}),`: inclusive start, exclusive end. Using the same boundary as one query’s `,_jsx(_components.code,{children:`end`}),` and the next query’s `,_jsx(_components.code,{children:`start`}),` avoids counting that boundary twice.`]}),_jsxs(_components.p,{children:[`When building URLs manually, encode the `,_jsx(_components.code,{children:`+`}),` in RFC3339 as `,_jsx(_components.code,{children:`%2B`}),`. The examples use cURL `,_jsx(_components.code,{children:`--data-urlencode`}),`, Python `,_jsx(_components.code,{children:`params`}),`, and JavaScript `,_jsx(_components.code,{children:`URLSearchParams`}),` to handle encoding automatically.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`request-examples`,children:`Request examples`}),`\n`,_jsx(Heading,{level:`3`,id:`total-spending-for-the-current-api-key-over-the-last-24-hours`,children:`Total spending for the current API Key over the last 24 hours`}),`\n`,_jsx(_components.p,{children:`Omit query parameters to use the default time range, scope, and grouping:`}),`\n`,_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://api.apimart.ai/v1/usage'`}),_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:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003ctoken>'`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`daily-spending-for-a-specified-model-across-the-account`,children:`Daily spending for a specified model across the account`}),`\n`,_jsx(_components.p,{children:`Query spending from September 11 to September 18, 2026, in Beijing time, excluding September 18:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,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:`8`,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:` --get`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.apimart.ai/v1/usage'`}),_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:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003ctoken>'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'start=1789056000'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'end=1789660800'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'model=gpt-5.6-luna'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'group_by=date'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'scope=account'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'tz=Asia/Shanghai'`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`group-by-model-and-calendar-day`,children:`Group by model and calendar day`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,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:`7`,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:` --get`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.apimart.ai/v1/usage'`}),_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:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization: Bearer \u003ctoken>'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'start=2026-09-01T00:00:00+08:00'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'end=2026-09-08T00:00:00+08:00'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'model=gpt-5.6-luna,sora-2'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'group_by=model,date'`}),_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:` --data-urlencode`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'tz=Asia/Shanghai'`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`With this grouping, each `,_jsx(_components.code,{children:`items`}),` entry contains both `,_jsx(_components.code,{children:`model`}),` and `,_jsx(_components.code,{children:`date`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`response-fields`,children:`Response fields`}),`\n`,_jsx(ResponseField,{name:`success`,type:`boolean`,id:`param-success`,children:_jsxs(_components.p,{children:[`Whether the query succeeded: `,_jsx(_components.code,{children:`true`}),` on success, `,_jsx(_components.code,{children:`false`}),` for usage-query errors.`]})}),`\n`,_jsxs(ResponseField,{name:`data`,type:`object`,id:`param-data`,children:[_jsx(_components.p,{children:`On success, contains the query range, totals, and grouped details.`}),_jsxs(Expandable,{title:`data properties`,children:[_jsx(ResponseField,{name:`scope`,type:`string`,id:`param-scope-1`,children:_jsxs(_components.p,{children:[`Query scope: `,_jsx(_components.code,{children:`key`}),` or `,_jsx(_components.code,{children:`account`}),`.`]})}),_jsx(ResponseField,{name:`start`,type:`integer`,id:`param-start-1`,children:_jsx(_components.p,{children:`Actual query start time as a Unix timestamp in seconds, inclusive.`})}),_jsx(ResponseField,{name:`end`,type:`integer`,id:`param-end-1`,children:_jsx(_components.p,{children:`Actual query end time as a Unix timestamp in seconds, exclusive.`})}),_jsx(ResponseField,{name:`tz`,type:`string`,id:`param-tz-1`,children:_jsx(_components.p,{children:`Timezone used for calendar-day grouping.`})}),_jsx(ResponseField,{name:`group_by`,type:`string`,id:`param-group-by-1`,children:_jsxs(_components.p,{children:[`Grouping: `,_jsx(_components.code,{children:`none`}),`, `,_jsx(_components.code,{children:`model`}),`, `,_jsx(_components.code,{children:`date`}),`, or `,_jsx(_components.code,{children:`model,date`}),`.`]})}),_jsx(ResponseField,{name:`total`,type:`object`,id:`param-total`,children:_jsx(_components.p,{children:`Totals within the query range; see the statistics below.`})}),_jsxs(ResponseField,{name:`items`,type:`object[]`,id:`param-items`,children:[_jsxs(_components.p,{children:[`Grouped details, sorted by `,_jsx(_components.code,{children:`amount_usd`}),` in descending order. Empty when `,_jsx(_components.code,{children:`group_by=none`}),`. Each entry includes the statistics below.`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Entries include `,_jsx(_components.code,{children:`model`}),` when `,_jsx(_components.code,{children:`group_by`}),` includes `,_jsx(_components.code,{children:`model`})]}),`\n`,_jsxs(_components.li,{children:[`Entries include `,_jsx(_components.code,{children:`date`}),` when `,_jsx(_components.code,{children:`group_by`}),` includes `,_jsx(_components.code,{children:`date`}),`, formatted as `,_jsx(_components.code,{children:`YYYY-MM-DD`}),` with calendar days determined by `,_jsx(_components.code,{children:`tz`})]}),`\n`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`data.total`}),` and `,_jsx(_components.code,{children:`data.items[]`}),` share these statistics:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`amount_usd`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{children:`USD amount, rounded to 6 decimal places`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`credits`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[`Platform credits, equal to `,_jsx(_components.code,{children:`amount_usd × 10`}),`, matching the units displayed on the website`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`requests`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Number of successfully billed calls`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`prompt_tokens`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Input tokens; usually 0 for image/video models billed per request or per second`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`completion_tokens`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Output tokens; usually 0 for image/video models billed per request or per second`})]})]})]}),`\n`,_jsx(ResponseField,{name:`error`,type:`object`,id:`param-error`,children:_jsxs(_components.p,{children:[`Returned for usage-query errors, with `,_jsx(_components.code,{children:`code`}),`, `,_jsx(_components.code,{children:`message`}),`, and `,_jsx(_components.code,{children:`type`}),`; `,_jsx(_components.code,{children:`type`}),` is `,_jsx(_components.code,{children:`usage_query_error`}),`. Authentication errors with HTTP 401 / 403 are returned by the authentication layer.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`rate-limits-and-caching`,children:`Rate limits and caching`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Up to `,_jsx(_components.code,{children:`60`}),` queries per API Key per minute; global API rate limits also apply`]}),`\n`,_jsxs(_components.li,{children:[`Results with identical parameters are cached for `,_jsx(_components.code,{children:`60`}),` seconds; the `,_jsx(_components.code,{children:`X-Usage-Cache`}),` response header is `,_jsx(_components.code,{children:`hit`}),` or `,_jsx(_components.code,{children:`miss`})]}),`\n`,_jsx(_components.li,{children:`Usage records are typically available within 1 second, but the last minute of data may be incomplete, with additional cache delay`}),`\n`,_jsx(_components.li,{children:`Poll no more frequently than once a minute; do not use this endpoint as a real-time billing notification`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`accounting-rules`,children:`Accounting rules`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Uses successfully billed call records, the same data as the website dashboard`}),`\n`,_jsx(_components.li,{children:`Failed calls and tasks refunded after failure are excluded; no manual offset is needed. Partially successful image batches are billed for the images actually delivered`}),`\n`,_jsx(_components.li,{children:`Spending is attributed to the billing posting time. Asynchronous image/video tasks are posted at completion, not submission; tasks crossing midnight belong to the completion day`}),`\n`,_jsxs(_components.li,{children:[`Deleting and recreating an API Key creates a new Key; querying `,_jsx(_components.code,{children:`scope=key`}),` with the new Key does not include the old Key’s history`]}),`\n`,_jsx(_components.li,{children:`Manual balance adjustments are not call spending and are excluded`}),`\n`,_jsx(_components.li,{children:`Data after April 27, 2026, is available`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`error-handling`,children:`Error handling`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`HTTP status`}),_jsx(_components.th,{children:_jsx(_components.code,{children:`error.code`})}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`invalid_start`}),` / `,_jsx(_components.code,{children:`invalid_end`})]}),_jsx(_components.td,{children:`Invalid start or end time format`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_range`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`end`}),` is not later than `,_jsx(_components.code,{children:`start`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`range_too_large`})}),_jsx(_components.td,{children:`Range exceeds 31 days; split it into multiple queries`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_tz`})}),_jsx(_components.td,{children:`Unknown IANA timezone`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_group_by`})}),_jsx(_components.td,{children:`Invalid grouping option`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`invalid_scope`})}),_jsx(_components.td,{children:`Invalid query scope`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`400`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`too_many_models`})}),_jsx(_components.td,{children:`More than 50 models`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401 / 403`}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`Invalid or expired API Key, IP not allowed, or disabled account`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`429`}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`Exceeds 60 queries per Key per minute, or a global API rate limit`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`503`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`usage_unavailable`})}),_jsx(_components.td,{children:`Usage data is temporarily unavailable; retry later`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`A `,_jsx(_components.code,{children:`503 usage_unavailable`}),` response returns no amounts. It means the query is unavailable, not that spending is zero. Do not convert failed responses into zero amounts or overwrite a previous successful result.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`comparison-with-other-endpoints`,children:`Comparison with other endpoints`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Endpoint`}),_jsx(_components.th,{children:`Capability`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`GET /v1/dashboard/billing/usage`})}),_jsx(_components.td,{children:`Cumulative spending only; no model or time filters`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`POST /v1/logs/export`})}),_jsx(_components.td,{children:`Asynchronous export of call details (CSV / XLSX); aggregate them yourself`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`GET /v1/usage`})}),_jsx(_components.td,{children:`Query by time and model; directly returns totals and grouped spending`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`For remaining quota, use `,_jsx(_components.a,{href:`/en/api-reference/account/token-balance`,children:`Query Token Balance`}),` or `,_jsx(_components.a,{href:`/en/api-reference/account/user-balance`,children:`Query User Balance`}),`.`]})]})}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":"Query Usage and Spending","description":" - Query spending and request statistics for a specified time range\n- Filter by model and group by model or calendar day\n- Query usage for the current API Key or the entire account\n- Returns USD amounts, credits, request counts, and token usage ","api":"GET https://api.apimart.ai/v1/usage","href":"/en/api-reference/account/usage"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"Endpoints","slug":"endpoints","depth":2,"children":[]},{"title":"Request parameters","slug":"request-parameters","depth":2,"children":[]},{"title":"Request examples","slug":"request-examples","depth":2,"children":[{"title":"Total spending for the current API Key over the last 24 hours","slug":"total-spending-for-the-current-api-key-over-the-last-24-hours","depth":3,"children":[]},{"title":"Daily spending for a specified model across the account","slug":"daily-spending-for-a-specified-model-across-the-account","depth":3,"children":[]},{"title":"Group by model and calendar day","slug":"group-by-model-and-calendar-day","depth":3,"children":[]}]},{"title":"Response fields","slug":"response-fields","depth":2,"children":[]},{"title":"Rate limits and caching","slug":"rate-limits-and-caching","depth":2,"children":[]},{"title":"Accounting rules","slug":"accounting-rules","depth":2,"children":[]},{"title":"Error handling","slug":"error-handling","depth":2,"children":[]},{"title":"Comparison with other endpoints","slug":"comparison-with-other-endpoints","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"5\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --get\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'https://api.apimart.ai/v1/usage'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --header\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Authorization: Bearer \u0026#x3C;token>'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --data-urlencode\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'start=2026-09-01T00:00:00+08:00'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --data-urlencode\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'end=2026-09-08T00:00:00+08:00'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --data-urlencode\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'group_by=model'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Python","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"python\">\u003ccode language=\"python\" numberOfLines=\"20\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">import\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">response \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests.get(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"https://api.apimart.ai/v1/usage\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> headers\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Authorization\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Bearer \u0026#x3C;token>\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> params\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"start\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"2026-09-01T00:00:00+08:00\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"end\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"2026-09-08T00:00:00+08:00\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"group_by\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"model\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> timeout\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">30\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">payload \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> response.json()\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">if\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\"> not\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> response.ok \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">or\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\"> not\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> payload.get(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"success\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">):\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> message \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> payload.get(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"error\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, {}).get(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Usage query failed\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> raise\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4EC9B0\"> RuntimeError\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">f\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"HTTP \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">{\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">response.status_code\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">: \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">{\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">message\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">print\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(payload[\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"data\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">][\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"total\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">])\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">print\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(payload[\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"data\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">][\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"items\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">])\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"JavaScript","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"javascript\">\u003ccode language=\"javascript\" numberOfLines=\"20\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> url\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\"> new\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> URL\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://api.apimart.ai/v1/usage\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">url\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">search\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\"> new\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> URLSearchParams\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">({\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> start:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"2026-09-01T00:00:00+08:00\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> end:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"2026-09-08T00:00:00+08:00\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> group_by:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"model\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}).\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">toString\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">();\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> response\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> fetch\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">url\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> headers:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">Authorization:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Bearer \u0026#x3C;token>\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">});\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> payload\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> response\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">json\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">();\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">if\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> (\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">!\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">response\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">ok\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> ||\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> !\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">payload\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">success\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">) {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> throw\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\"> new\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> Error\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> `HTTP \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">${\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">response\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">status\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">${\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">payload\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">error\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#D4D4D4\">?.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">message\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> ??\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Usage query failed\"\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">`\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> );\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">console\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">log\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">payload\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">data\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">total\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">console\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">log\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">payload\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">data\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">items\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"200","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"35\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"success\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">true\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"data\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"scope\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"key\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"start\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">1788192000\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"end\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">1788796800\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"tz\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Asia/Shanghai\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"group_by\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"model\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"total\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"amount_usd\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">12.3456\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"credits\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">123.456\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"requests\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">1834\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"prompt_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">902311\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"completion_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">215044\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"items\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"model\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"gpt-5.6-luna\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"amount_usd\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">9.1271\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"credits\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">91.271\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"requests\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">1520\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"prompt_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">880120\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"completion_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">201300\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"model\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"sora-2\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"amount_usd\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">3.2185\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"credits\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">32.185\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"requests\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">314\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"prompt_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">22191\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"completion_tokens\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">13744\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> ]\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"400","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"8\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"success\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">false\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"error\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"code\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"range_too_large\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Time range must not exceed 31 days.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"usage_query_error\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Query Usage and Spending","path":"/v1/usage","servers":[{"url":"https://api.apimart.ai"}],"method":"get","request":{"security":[],"parameters":{"query":{"start":{"schema":[{"type":"object","properties":{},"description":"Inclusive start time. Accepts a Unix timestamp in seconds or an RFC3339 string with a timezone, such as `2026-09-01T00:00:00+08:00` . Defaults to 24 hours before `end` when omitted. Timestamps use seconds, not milliseconds."}]},"end":{"schema":[{"type":"object","properties":{},"description":"Exclusive end time. Uses the same formats as `start` and defaults to the current time when omitted. Must be later than `start` , and `end - start` must not exceed 31 days."}]},"model":{"schema":[{"type":"string","description":"Model names; all models are included when omitted. Separate multiple models with commas, up to `50` models. Exact, case-insensitive matching. Wildcards are not supported. Example: `gpt-5.6-luna,sora-2`"}]},"group_by":{"schema":[{"type":"string","description":"Grouping options: `none` : totals only; `items` is an empty array `model` : group by model `date` : group by calendar day `model,date` : group by both model and calendar day"}]},"tz":{"schema":[{"type":"string","description":"IANA timezone name; defaults to `Asia/Shanghai` . Only affects calendar-day boundaries when `group_by` includes `date` ; it does not change the query start or end instants. RFC3339 times are still parsed using their own timezone offsets."}]},"scope":{"schema":[{"type":"string","description":"Query scope: `key` : only the current API Key (default) `account` : all API Keys belonging to the account of the current API Key"}]}},"header":{"Authorization":{"schema":[{"type":"string","description":"Authenticate with the same API Key used for model calls, using a Bearer Token. Get a key from the API Key management page .","required":true}]}},"cookie":{},"path":{}},"body":{}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"success":[{"type":"boolean","description":"Whether the query succeeded: `true` on success, `false` for usage-query errors."}],"data":[{"type":"object","properties":{"scope":[{"type":"string","description":"Query scope: `key` or `account` ."}],"start":[{"type":"integer","description":"Actual query start time as a Unix timestamp in seconds, inclusive."}],"end":[{"type":"integer","description":"Actual query end time as a Unix timestamp in seconds, exclusive."}],"tz":[{"type":"string","description":"Timezone used for calendar-day grouping."}],"group_by":[{"type":"string","description":"Grouping: `none` , `model` , `date` , or `model,date` ."}],"total":[{"type":"object","properties":{},"description":"Totals within the query range; see the statistics below."}],"items":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"Grouped details, sorted by `amount_usd` in descending order. Empty when `group_by=none` . Each entry includes the statistics below. Entries include `model` when `group_by` includes `model` Entries include `date` when `group_by` includes `date` , formatted as `YYYY-MM-DD` with calendar days determined by `tz`"}]},"description":"On success, contains the query range, totals, and grouped details."}],"error":[{"type":"object","properties":{},"description":"Returned for usage-query errors, with `code` , `message` , and `type` ; `type` is `usage_query_error` . Authentication errors with HTTP 401 / 403 are returned by the authentication layer."}]}}],"examples":{"example":{"value":{"success":true,"data":{"scope":"\u003cstring>","start":123,"end":123,"tz":"\u003cstring>","group_by":"\u003cstring>","total":{},"items":[{}]},"error":{}}}}}}},"deprecated":false}},"jsLinks":["/_mintlify/custom/apicore/1f7e29c94a916812/cn-domain-rewrite.js","/_mintlify/custom/apicore/afc6076845564106/param-field-copy.js"],"subdomain":"apicore","siteName":"APIMart","title":"Query Usage and Spending - APIMart","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/en/api-reference/account/usage","matchLevel":0},"zh-Hans":{"href":"/cn/api-reference/account/usage","matchLevel":1},"ja":{"href":"/ja/api-reference/account/usage","matchLevel":1},"ko":{"href":"/ko/api-reference/account/usage","matchLevel":1},"ru":{"href":"/ru/api-reference/account/usage","matchLevel":1},"de":{"href":"/de/api-reference/account/usage","matchLevel":1},"fr":{"href":"/fr/api-reference/account/usage","matchLevel":1},"pt":{"href":"/pt/api-reference/account/usage","matchLevel":1},"id":{"href":"/id/api-reference/account/usage","matchLevel":1},"es":{"href":"/es/api-reference/account/usage","matchLevel":1}}},"lastModified":"2026-09-18T09:08:08.090Z","originalFileLocation":"en/api-reference/account/usage.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=\"- Query spending and request statistics for a specified time range - Filter by model and group by model or calendar day - Query usage for the current API Key or the entire account - Returns USD amounts, credits, request counts, and token usage\">\u003cmeta data-mint-head name=\"keywords\" content=\"OpenAI compatible, API gateway, GPT-5, Claude, Gemini, multi-provider, transparent pricing, SLA\">\u003cmeta data-mint-head name=\"application-name\" content=\"APIMart\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/apicore/lN2mX6cSovqJeXFa/_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/apicore/lN2mX6cSovqJeXFa/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/apicore/lN2mX6cSovqJeXFa/_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/apicore/lN2mX6cSovqJeXFa/_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/apicore/lN2mX6cSovqJeXFa/_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/apicore/lN2mX6cSovqJeXFa/_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/apicore/lN2mX6cSovqJeXFa/_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/apicore/lN2mX6cSovqJeXFa/_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/apicore/lN2mX6cSovqJeXFa/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Query Usage and Spending - APIMart\">\u003cmeta data-mint-head property=\"og:description\" content=\"- Query spending and request statistics for a specified time range - Filter by model and group by model or calendar day - Query usage for the current API Key or the entire account - Returns USD amounts, credits, request counts, and token usage\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"APIMart\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.apimart.ai/en/api-reference/account/usage\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://apicore.mintlify.app/_mintlify/api/og/v2?division=Account+Management\u0026amp;title=Query+Usage+and+Spending\u0026amp;description=+-+Query+spending+and+request+statistics+for+a+specified+time+range%0A-+Filter+by+model+and+group+by+model+or+calendar+day%0A-+Query+usage+for+the+current+API+Key+o\u0026amp;theme=85f832f8b30837d0268a5e67\u0026amp;signature=41b7f4170187eae577dce9ffe477e4cbbeb53626c6b9fb26cff4eb4bdb7ea316\">\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=\"Query Usage and Spending - APIMart\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"- Query spending and request statistics for a specified time range - Filter by model and group by model or calendar day - Query usage for the current API Key or the entire account - Returns USD amounts, credits, request counts, and token usage\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://apicore.mintlify.app/_mintlify/api/og/v2?division=Account+Management\u0026amp;title=Query+Usage+and+Spending\u0026amp;description=+-+Query+spending+and+request+statistics+for+a+specified+time+range%0A-+Filter+by+model+and+group+by+model+or+calendar+day%0A-+Query+usage+for+the+current+API+Key+o\u0026amp;theme=85f832f8b30837d0268a5e67\u0026amp;signature=41b7f4170187eae577dce9ffe477e4cbbeb53626c6b9fb26cff4eb4bdb7ea316\">\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/apicore/lN2mX6cSovqJeXFa/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"APIMart\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563EB\">\u003cmeta data-mint-head name=\"twitter:creator\" content=\"@APIMart_\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.apimart.ai/en/api-reference/account/usage\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/api-reference/account/usage.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.apimart.ai/en/api-reference/account/usage\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hans\" href=\"https://docs.apimart.ai/cn/api-reference/account/usage\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://docs.apimart.ai/ja/api-reference/account/usage\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ko\" href=\"https://docs.apimart.ai/ko/api-reference/account/usage\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ru\" href=\"https://docs.apimart.ai/ru/api-reference/account/usage\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"de\" href=\"https://docs.apimart.ai/de/api-reference/account/usage\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"fr\" href=\"https://docs.apimart.ai/fr/api-reference/account/usage\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"pt\" href=\"https://docs.apimart.ai/pt/api-reference/account/usage\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"id\" href=\"https://docs.apimart.ai/id/api-reference/account/usage\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"es\" href=\"https://docs.apimart.ai/es/api-reference/account/usage\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.apimart.ai/en/api-reference/account/usage\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.apimart.ai/#organization\",\"name\":\"APIMart\",\"url\":\"https://docs.apimart.ai\"},{\"@type\":\"WebSite\",\"@id\":\"https://docs.apimart.ai#website\",\"name\":\"APIMart\",\"url\":\"https://docs.apimart.ai\",\"publisher\":{\"@id\":\"https://docs.apimart.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.apimart.ai/en/api-reference/account/usage#webpage\",\"url\":\"https://docs.apimart.ai/en/api-reference/account/usage\",\"name\":\"Query Usage and Spending\",\"description\":\"- Query spending and request statistics for a specified time range - Filter by model and group by model or calendar day - Query usage for the current API Key or the entire account - Returns USD amounts, credits, request counts, and token usage\",\"dateModified\":\"2026-09-18T09:08:08.090Z\",\"isPartOf\":{\"@id\":\"https://docs.apimart.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.apimart.ai/en/api-reference/account/usage#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.apimart.ai/en/api-reference/account/usage#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Account Management\",\"item\":\"https://docs.apimart.ai/en/api-reference/account/token-balance\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Query Usage and Spending\",\"item\":\"https://docs.apimart.ai/en/api-reference/account/usage\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.apimart.ai/en/api-reference/account/usage#apireference\",\"headline\":\"Query Usage and Spending\",\"name\":\"Query Usage and Spending\",\"description\":\"- Query spending and request statistics for a specified time range - Filter by model and group by model or calendar day - Query usage for the current API Key or the entire account - Returns USD amounts, credits, request counts, and token usage\",\"url\":\"https://docs.apimart.ai/en/api-reference/account/usage\",\"mainEntityOfPage\":{\"@id\":\"https://docs.apimart.ai/en/api-reference/account/usage#webpage\"},\"dateModified\":\"2026-09-18T09:08:08.090Z\",\"publisher\":{\"@id\":\"https://docs.apimart.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.apimart.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"APIMart\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"APIMart","nav":{"global":null,"languages":[{"language":"en","tabs":[{"tab":"API Manual","groups":[{"group":"Overview","pages":[{"title":"APIMart — OpenAI-Compatible API Gateway (GPT-5, Claude, Gemini)","href":"/en"}]},{"group":"Models","pages":[{"title":"Models List Metadata API","api":"GET https://api.apimart.ai/v1/models","href":"/en/api-reference/texts/models/list"}]},{"group":"Text Series","icon":"text","pages":[{"title":"General Chat API (Default Streaming)","api":"POST https://api.apimart.ai/v1/chat/completions","href":"/en/api-reference/texts/general/chat-completions"},{"title":"General Chat API (Default Non-Streaming)","api":"POST https://api.apimart.ai/api/v1/chat/completions","href":"/en/api-reference/texts/general/chat-completions-nostream"},{"title":"Claude Messages API","api":"POST https://api.apimart.ai/v1/messages","href":"/en/api-reference/texts/general/claude-messages"},{"title":"Gemini Native Format","api":"POST https://api.apimart.ai/v1beta/models/{model}:{method}","href":"/en/api-reference/texts/gemini/quickstart"},{"title":"OpenAI Multimodal Responses API","api":"POST https://api.apimart.ai/v1/responses","href":"/en/api-reference/texts/openai/responses"},{"title":"Gemini Context Caching Guide","sidebarTitle":"Gemini Context Caching","icon":"database","href":"/en/api-reference/texts/gemini/context-cache"},{"title":"Claude Context Caching Guide","sidebarTitle":"Claude Context Caching","icon":"database","href":"/en/api-reference/texts/general/claude-context-cache"},{"group":"qwen3.8-max","icon":"message","pages":[{"title":"qwen3.8-max Integration Guide","api":"POST https://api.apimart.ai/v1/chat/completions","href":"/en/api-reference/texts/qwen3.8-max/guide"},{"title":"Model Pricing API","api":"GET https://api.apimart.ai/api/pricing/model?model=qwen3.8-max","href":"/en/api-reference/texts/qwen3.8-max/pricing"}]}]},{"group":"Image Series","icon":"image","pages":[{"group":"Nano banana 2.1","icon":"image","pages":[{"title":"Nano banana 2.1 Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/gemini-nano-banana-2.1/generation"}]},{"group":"Nano banana2","icon":"image","pages":[{"title":"Nano banana2 Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/gemini-3.1-flash/generation"},{"title":"Nano Banana Lite Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/gemini-3.1-flash/generation-lite"}]},{"group":"Nano banana Pro","icon":"image","pages":[{"title":"Nano banana Pro Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/gemini-3-pro/generation"}]},{"group":"Nano banana","icon":"image","pages":[{"title":"Nano banana Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/gemini-2.5-flash/generation"}]},{"group":"Imagen-4.0","icon":"image","pages":[{"title":"Imagen 4.0 Apimart Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/imagen-4.0-apimart/generation"}]},{"group":"GPT-Image(1/1.5)","icon":"image","pages":[{"title":"GPT-Image(1/1.5) Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/gpt-image-1/generation"}]},{"group":"GPT-Image-2","icon":"image","pages":[{"title":"GPT-Image-2 Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/gpt-image-2/generation"},{"title":"GPT-Image-2 Official Channel Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/gpt-image-2/official"}]},{"group":"GPT-Image-2.5","icon":"image","pages":[{"title":"GPT-Image-2.5 Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/gpt-image-2.5/generation"}]},{"group":"GPT-Image-2.5 Ext","icon":"image","pages":[{"title":"GPT-Image-2.5 Ext Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/gpt-image-2.5-ext/generation"}]},{"group":"Seedream-4.0","icon":"image","pages":[{"title":"Seedream-4.0 Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/seedream-4/generation"}]},{"group":"Seedream-4.5","icon":"image","pages":[{"title":"Seedream-4.5 Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/seedream-4.5/generation"}]},{"group":"Seedream-5.0-Lite","icon":"image","pages":[{"title":"Seedream-5.0-Lite Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/seedream-5-lite/generation"}]},{"group":"Seedream-5.0-Pro","icon":"image","pages":[{"title":"Seedream-5.0-Pro Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/seedream-5-0-pro/generation"}]},{"group":"Seedream-5.0-Flash","icon":"image","pages":[{"title":"Seedream-5.0-Flash Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/seedream-5-0-flash/generation"}]},{"group":"Flux Kontext","icon":"image","pages":[{"title":"FLUX Kontext Image Generation and Editing","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/flux-kontext/generation"}]},{"group":"Flux 2.0","icon":"image","pages":[{"title":"FLUX.2 Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/flux-2/generation"}]},{"group":"FLUX 3 Image","icon":"image","pages":[{"title":"FLUX 3 Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/flux-3-image/generation"}]},{"group":"FLUX 3 Image Klein","icon":"image","pages":[{"title":"FLUX 3 Image Klein Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/flux-3-image-klein/generation"}]},{"group":"Hy-Image-3.5 Preview","icon":"image","pages":[{"title":"Hy-Image-3.5 Preview Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/hy-image-v3.5-preview/generation"}]},{"group":"MAI-Image-2.6","icon":"image","pages":[{"title":"MAI-Image-2.6 Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/mai-image-2.6/generation"}]},{"group":"Qwen Image 2.0","icon":"image","pages":[{"title":"Qwen Image 2.0 Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/qwen-image/generation"}]},{"group":"Qwen Image 3.0","icon":"image","pages":[{"title":"Qwen Image 3.0 Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/qwen-image-3.0/generation"}]},{"group":"Z-Image-Turbo","icon":"image","pages":[{"title":"Z-Image-Turbo Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/z-image-turbo/generation"}]},{"group":"Grok Imagine","icon":"image","pages":[{"title":"Grok Imagine Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/grok-imagine/generation"}]},{"group":"Grok Imagine 2.0 Ext","icon":"image","pages":[{"title":"Grok Imagine 2.0 Ext Image Generation","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/grok-imagine-2.0-ext/generation"},{"title":"Grok Imagine 2.0 Ext Layers and Region Editing","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/grok-imagine-2.0-ext/layer-region-edit"},{"title":"Grok Imagine Image 2.0 Official Generation and Editing","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/grok-imagine-2.0-ext/official"}]},{"group":"wan2.7-image","icon":"image","pages":[{"title":"wan2.7 Image Generation \u0026 Editing","api":"POST https://api.apimart.ai/v1/images/generations","href":"/en/api-reference/images/wan2.7-image/generation"}]},{"group":"Midjourney","icon":"image","pages":[{"title":"Midjourney API overview","href":"/en/api-reference/images/midjourney/generation"},{"title":"Imagine (text-to-image)","api":"POST https://api.apimart.ai/v1/midjourney/generations","href":"/en/api-reference/images/midjourney/imagine"},{"title":"Blend (multi-image blend)","api":"POST https://api.apimart.ai/v1/midjourney/generations/blend","href":"/en/api-reference/images/midjourney/blend"},{"title":"Describe (image to text)","api":"POST https://api.apimart.ai/v1/midjourney/generations/describe","href":"/en/api-reference/images/midjourney/describe"},{"title":"Edits (image edit)","api":"POST https://api.apimart.ai/v1/midjourney/generations/edits","href":"/en/api-reference/images/midjourney/edits"},{"title":"Upscale","api":"POST https://api.apimart.ai/v1/midjourney/generations/upscale","href":"/en/api-reference/images/midjourney/upscale"},{"title":"Variation","api":"POST https://api.apimart.ai/v1/midjourney/generations/variation","href":"/en/api-reference/images/midjourney/variation"},{"title":"High Variation","api":"POST https://api.apimart.ai/v1/midjourney/generations/high-variation","href":"/en/api-reference/images/midjourney/high-variation"},{"title":"Low Variation","api":"POST https://api.apimart.ai/v1/midjourney/generations/low-variation","href":"/en/api-reference/images/midjourney/low-variation"},{"title":"Reroll","api":"POST https://api.apimart.ai/v1/midjourney/generations/reroll","href":"/en/api-reference/images/midjourney/reroll"},{"title":"Zoom","api":"POST https://api.apimart.ai/v1/midjourney/generations/zoom","href":"/en/api-reference/images/midjourney/zoom"},{"title":"Pan","api":"POST https://api.apimart.ai/v1/midjourney/generations/pan","href":"/en/api-reference/images/midjourney/pan"},{"title":"Inpaint","api":"POST https://api.apimart.ai/v1/midjourney/generations/inpaint","href":"/en/api-reference/images/midjourney/inpaint"},{"title":"Modal (submit parameters)","api":"POST https://api.apimart.ai/v1/midjourney/generations/modal","href":"/en/api-reference/images/midjourney/modal"},{"title":"Video (image-to-video)","api":"POST https://api.apimart.ai/v1/midjourney/generations/video","href":"/en/api-reference/images/midjourney/video"},{"title":"Remix (reshape, v8.1 / v8.2 only)","api":"POST https://api.apimart.ai/v1/midjourney/generations/remix-strong","href":"/en/api-reference/images/midjourney/remix"},{"title":"Get task","api":"GET https://api.apimart.ai/v1/midjourney/{task_id}","href":"/en/api-reference/images/midjourney/query"},{"title":"Best Practices","href":"/en/api-reference/images/midjourney/best-practices"},{"title":"End-to-End Workflow Examples","href":"/en/api-reference/images/midjourney/workflow"}]}]},{"group":"Video Series","icon":"video","pages":[{"group":"seedance-1-0-pro","icon":"video","pages":[{"title":"seedance-1-0-pro Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/doubao/generation"}]},{"group":"seedance-1-5-pro","icon":"video","pages":[{"title":"seedance-1-5-pro Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/seedance-1-5-pro/generation"}]},{"group":"seedance-2-0","icon":"video","pages":[{"title":"seedance-2.0 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/seedance-2-0/generation"},{"title":"Virtual Avatar Assets","api":"POST https://api.apimart.ai/v1/seedance2/private-avatar","href":"/en/api-reference/videos/seedance-2-0/private-avatar"}]},{"group":"seedance-2-5","icon":"video","pages":[{"title":"seedance-2.5 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/seedance-2-5/generation"}]},{"group":"VEO3","icon":"video","pages":[{"title":"VEO3 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/veo3/generation"},{"title":"VEO3 Video Remix","api":"POST https://api.apimart.ai/v1/videos/{task_id}/remix","href":"/en/api-reference/videos/veo3/remix"},{"title":"VEO3 Official Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/veo3/generation-official"}]},{"group":"MiniMax-Hailuo-02","icon":"video","pages":[{"title":"MiniMax-Hailuo-02 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/minimax-hailuo/generation"}]},{"group":"MiniMax-Hailuo-2.3","icon":"video","pages":[{"title":"MiniMax-Hailuo-2.3 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/minimax-hailuo-2.3/generation"}]},{"group":"MiniMax-H3","icon":"video","pages":[{"title":"MiniMax-H3 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/minimax-h3/generation"},{"title":"MiniMax-H3-Max Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/minimax-h3/max"},{"title":"MiniMax-H3 Context-IR Prompt Enhancement","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/minimax-h3/context-ir"},{"title":"MiniMax-H3 Regeneration","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/minimax-h3/regeneration"}]},{"group":"FLUX 3 Video","icon":"video","pages":[{"title":"FLUX 3 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/flux-3-video/generation"}]},{"group":"SkyReels V4","icon":"video","pages":[{"title":"SkyReels V4 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/skyreels-v4/generation"}]},{"group":"HappyHorse","icon":"video","pages":[{"title":"HappyHorse 1.0 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/happyhorse-1.0/generation"},{"title":"HappyHorse 1.1 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/happyhorse-1.1/generation"}]},{"group":"Wan3.0","icon":"video","pages":[{"title":"Wan3.0 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/wan3.0-video/generation"}]},{"group":"Wan2.7","icon":"video","pages":[{"title":"Wan2.7 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/wan2.7/generation"},{"title":"Wan2.7-R2V Reference-to-Video","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/wan2.7-r2v/generation"},{"title":"Wan2.7-VideoEdit Video Editing","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/wan2.7-videoedit/generation"}]},{"group":"Wan2.6","icon":"video","pages":[{"title":"Wan2.6 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/wan2.6/generation"},{"title":"wan2.6-i2v-flash Image-to-Video","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/wan2.6/i2v-flash-generation"}]},{"group":"Wan2.5","icon":"video","pages":[{"title":"wan2.5-preview Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/wan2.5/generation"}]},{"group":"Kling 2.6","icon":"video","pages":[{"title":"Kling 2.6 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/kling-v2-6/generation"},{"title":"Kling v2.6 Motion Control Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/kling-v2-6/kling-v2-6-motion-control-generation"}]},{"group":"Kling v3","icon":"video","pages":[{"title":"Kling v3 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/kling-v3/generation"}]},{"group":"Kling 3.0 Turbo","icon":"video","pages":[{"title":"Kling 3.0 Turbo Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/kling-3.0-turbo/generation"}]},{"group":"Kling v3 Omni","icon":"video","pages":[{"title":"Kling v3 Omni Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/kling-v3-omni/generation"}]},{"group":"Kling V4","icon":"video","pages":[{"title":"Kling V4 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/kling-v4/generation"}]},{"group":"Kling Video O1","icon":"video","pages":[{"title":"Kling Video O1 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/kling-video-o1/generation"}]},{"group":"Vidu Q3(pro/turbo)","icon":"video","pages":[{"title":"Vidu Q3(pro/turbo) Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/vidu-q3-pro/generation"}]},{"group":"Vidu Q4 Preview","icon":"video","pages":[{"title":"Vidu Q4 Preview Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/vidu-q4-preview/generation"}]},{"group":"Vidu Q3(mix/standard)","icon":"video","pages":[{"title":"Vidu Q3(mix/standard) Reference-to-Video","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/vidu-q3/generation"}]},{"group":"Grok Imagine","icon":"video","pages":[{"title":"Grok Imagine 1.5 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/grok-imagine/generation"},{"title":"Grok Official Video Models","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/grok-imagine/official"}]},{"group":"Pixverse v6","icon":"video","pages":[{"title":"Pixverse v6 Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/pixverse-v6/generation"}]},{"group":"PixVerse V6 Max","icon":"video","pages":[{"title":"PixVerse V6 Max Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/pixverse-v6-max/generation"}]},{"group":"gemini-omni-1.1-flash-ext","icon":"video","pages":[{"title":"gemini-omni-1.1-flash-ext Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/omni-flash-ext/generation"}]},{"group":"Gemini Omni 1.1 Flash","icon":"video","pages":[{"title":"Gemini Omni 1.1 Flash Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/gemini-omni-1.1-flash/generation"}]},{"group":"Gemini Omni Flash","icon":"video","pages":[{"title":"Gemini Omni Flash Video Generation","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/en/api-reference/videos/gemini-omni-flash-preview/generation"}]}]},{"group":"Audio Series","icon":"microphone","pages":[{"title":"Whisper-1 Audio Transcription","api":"POST https://api.apimart.ai/v1/audio/transcriptions","href":"/en/api-reference/audios/whisper-1"},{"title":"TTS Text-to-Speech","api":"POST https://api.apimart.ai/v1/audio/speech","href":"/en/api-reference/audios/tts"},{"group":"Flow Music","icon":"music","pages":[{"title":"Generate Music","api":"POST https://api.apimart.ai/v1/music/generations","href":"/en/api-reference/audios/flow-music/music"},{"title":"Lyria 3.5 Generate Music","api":"POST https://api.apimart.ai/v1/music/generations","href":"/en/api-reference/audios/flow-music/music-lyria-3-5"},{"title":"Generate Lyrics","api":"POST https://api.apimart.ai/v1/music/generations/lyricsFlowMusic","href":"/en/api-reference/audios/flow-music/lyrics"},{"title":"Extend Music","api":"POST https://api.apimart.ai/v1/music/generations/extendFlowMusic","href":"/en/api-reference/audios/flow-music/extend"},{"title":"Lyria 3.5 Extend Music","api":"POST https://api.apimart.ai/v1/music/generations/extendFlowMusic","href":"/en/api-reference/audios/flow-music/extend-lyria-3-5"},{"title":"Replace Section","api":"POST https://api.apimart.ai/v1/music/generations/replaceFlowMusic","href":"/en/api-reference/audios/flow-music/replace"},{"title":"Lyria 3.5 Replace Section","api":"POST https://api.apimart.ai/v1/music/generations/replaceFlowMusic","href":"/en/api-reference/audios/flow-music/replace-lyria-3-5"},{"title":"Cover Rearrangement","api":"POST https://api.apimart.ai/v1/music/generations/coverFlowMusic","href":"/en/api-reference/audios/flow-music/cover"},{"title":"Lyria 3.5 Cover Rearrangement","api":"POST https://api.apimart.ai/v1/music/generations/coverFlowMusic","href":"/en/api-reference/audios/flow-music/cover-lyria-3-5"},{"title":"Stem Separation","api":"POST https://api.apimart.ai/v1/music/generations/stemsFlowMusic","href":"/en/api-reference/audios/flow-music/stems"},{"title":"Upload Audio","api":"POST https://api.apimart.ai/v1/music/generations/uploadAudioFlowMusic","href":"/en/api-reference/audios/flow-music/upload-audio"},{"title":"Download Audio","api":"POST https://api.apimart.ai/v1/music/generations/downloadAudioFlowMusic","href":"/en/api-reference/audios/flow-music/download-audio"},{"title":"Music Video Rendering","api":"POST https://api.apimart.ai/v1/music/generations/videoClipFlowMusic","href":"/en/api-reference/audios/flow-music/video-clip"},{"title":"Query Task","api":"GET https://api.apimart.ai/v1/music/tasks/{task_id}","href":"/en/api-reference/audios/flow-music/query"}]},{"group":"Suno","icon":"music","pages":[{"title":"Suno V6 General Agreements and Task Inquiry","api":"GET https://api.apimart.ai/v1/music/tasks/{task_id}","href":"/en/api-reference/audios/suno/overview"},{"title":"Generate music","api":"POST https://api.apimart.ai/v1/music/generations","href":"/en/api-reference/audios/suno/generation"},{"title":"Generate lyrics","api":"POST https://api.apimart.ai/v1/music/generations/lyrics","href":"/en/api-reference/audios/suno/lyrics"},{"title":"Inspiration generation (inspo)","api":"POST https://api.apimart.ai/v1/music/generations/inspo","href":"/en/api-reference/audios/suno/inspo"},{"title":"Sound effect generation","api":"POST https://api.apimart.ai/v1/music/generations/sounds","href":"/en/api-reference/audios/suno/sounds"},{"title":"Tag enhancement","api":"POST https://api.apimart.ai/v1/music/generations/upsampleTags","href":"/en/api-reference/audios/suno/upsample-tags"},{"title":"Upload audio","api":"POST https://api.apimart.ai/v1/music/generations/uploadTask","href":"/en/api-reference/audios/suno/upload"},{"title":"Upload Audio and Create a Cover","api":"POST https://api.apimart.ai/v1/music/generations/uploadCover","href":"/en/api-reference/audios/suno/upload-cover"},{"title":"Upload and Extend Audio","api":"POST https://api.apimart.ai/v1/music/generations/uploadExtend","href":"/en/api-reference/audios/suno/upload-extend"},{"title":"Create a Custom Model","api":"POST https://api.apimart.ai/v1/music/generations/createModel","href":"/en/api-reference/audios/suno/create-model"},{"title":"Continuation and extension","api":"POST https://api.apimart.ai/v1/music/generations/extend","href":"/en/api-reference/audios/suno/extend"},{"title":"Style cover","api":"POST https://api.apimart.ai/v1/music/generations/coverSong","href":"/en/api-reference/audios/suno/cover-song"},{"title":"Mastering","api":"POST https://api.apimart.ai/v1/music/generations/remaster","href":"/en/api-reference/audios/suno/remaster"},{"title":"Stem extraction","api":"POST https://api.apimart.ai/v1/music/generations/stems","href":"/en/api-reference/audios/suno/stems"},{"title":"Full stem separation","api":"POST https://api.apimart.ai/v1/music/generations/stemsAll","href":"/en/api-reference/audios/suno/stems-all"},{"title":"Add vocals","api":"POST https://api.apimart.ai/v1/music/generations/addVocals","href":"/en/api-reference/audios/suno/add-vocals"},{"title":"Add accompaniment","api":"POST https://api.apimart.ai/v1/music/generations/addInstrumental","href":"/en/api-reference/audios/suno/add-instrumental"},{"title":"Add stem (add stem)","api":"POST https://api.apimart.ai/v1/music/generations/addStem","href":"/en/api-reference/audios/suno/add-stem"},{"title":"Extract Vox (deprecated)","api":"POST https://api.apimart.ai/v1/music/generations/vox","href":"/en/api-reference/audios/suno/vox"},{"title":"Create voice","api":"POST https://api.apimart.ai/v1/music/generations/createVoice","href":"/en/api-reference/audios/suno/create-voice"},{"title":"Persona","api":"POST https://api.apimart.ai/v1/music/generations/persona","href":"/en/api-reference/audios/suno/persona"},{"title":"Section replacement","api":"POST https://api.apimart.ai/v1/music/generations/replaceMusic","href":"/en/api-reference/audios/suno/replace-music"},{"title":"Remove segment","api":"POST https://api.apimart.ai/v1/music/generations/removeSection","href":"/en/api-reference/audios/suno/remove-section"},{"title":"Crop audio","api":"POST https://api.apimart.ai/v1/music/generations/crop","href":"/en/api-reference/audios/suno/crop"},{"title":"Fade in","api":"POST https://api.apimart.ai/v1/music/generations/fadeIn","href":"/en/api-reference/audios/suno/fade-in"},{"title":"Fade out","api":"POST https://api.apimart.ai/v1/music/generations/fadeOut","href":"/en/api-reference/audios/suno/fade-out"},{"title":"Adjust speed","api":"POST https://api.apimart.ai/v1/music/generations/adjustSpeed","href":"/en/api-reference/audios/suno/adjust-speed"},{"title":"Full song synthesis / concatenation","api":"POST https://api.apimart.ai/v1/music/generations/concat","href":"/en/api-reference/audios/suno/concat"},{"title":"Generate mashup (mashup)","api":"POST https://api.apimart.ai/v1/music/generations/mashup","href":"/en/api-reference/audios/suno/mashup"},{"title":"Sample to song (sample)","api":"POST https://api.apimart.ai/v1/music/generations/sample","href":"/en/api-reference/audios/suno/sample"},{"title":"Generate MIDI","api":"POST https://api.apimart.ai/v1/music/generations/midi","href":"/en/api-reference/audios/suno/midi"},{"title":"Lyrics timeline","api":"POST https://api.apimart.ai/v1/music/generations/alignedLyrics","href":"/en/api-reference/audios/suno/aligned-lyrics"},{"title":"BPM analysis","api":"POST https://api.apimart.ai/v1/music/generations/bpm","href":"/en/api-reference/audios/suno/bpm"},{"title":"Generate music video (MV)","api":"POST https://api.apimart.ai/v1/music/generations/generateMp4","href":"/en/api-reference/audios/suno/generate-mp4"},{"title":"Download Audio Files","api":"POST https://api.apimart.ai/v1/music/generations/download","href":"/en/api-reference/audios/suno/wav"}]}]},{"group":"Moderation Series","icon":"shield-check","pages":[{"group":"omni-moderation-latest","icon":"shield-check","pages":[{"title":"omni-moderation-latest Content Moderation","api":"POST https://api.apimart.ai/v1/moderations","href":"/en/api-reference/moderations/omni-moderation-latest/generation"}]}]},{"group":"Upload Management","icon":"cloud-arrow-up","pages":[{"title":"Upload Image","api":"POST https://api.apimart.ai/v1/uploads/images","href":"/en/api-reference/uploads/images"}]},{"group":"Task Management","icon":"list-check","pages":[{"title":"Get Task Status","api":"GET https://api.apimart.ai/v1/tasks/{task_id}","href":"/en/api-reference/tasks/status"},{"title":"Task Completion Callback (Webhook)","href":"/en/api-reference/tasks/webhook"}]},{"group":"Account Management","icon":"wallet","pages":[{"title":"Query Token Balance","api":"GET https://api.apimart.ai/v1/balance","href":"/en/api-reference/account/token-balance"},{"title":"Query User Balance","description":" - Query overall remaining and used credits of user account\n- Get user-level balance information\n- CORS support for cross-origin requests\n- Real-time balance monitoring ","api":"GET https://api.apimart.ai/v1/user/balance","href":"/en/api-reference/account/user-balance"},{"title":"Query Usage and Spending","api":"GET https://api.apimart.ai/v1/usage","href":"/en/api-reference/account/usage"}]}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/en/integrations/chat/chatbox"}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/en/quickstart"}]},{"tab":"FAQs","pages":[{"title":"FAQs","href":"/en/faqs"}]}]},{"language":"zh-Hans","pages":[{"title":"zh-Hans","href":"/cn/api-reference/account/usage"}]},{"language":"ja","pages":[{"title":"ja","href":"/ja/api-reference/account/usage"}]},{"language":"ko","pages":[{"title":"ko","href":"/ko/api-reference/account/usage"}]},{"language":"ru","pages":[{"title":"ru","href":"/ru/api-reference/account/usage"}]},{"language":"de","pages":[{"title":"de","href":"/de/api-reference/account/usage"}]},{"language":"fr","pages":[{"title":"fr","href":"/fr/api-reference/account/usage"}]},{"language":"pt","pages":[{"title":"pt","href":"/pt/api-reference/account/usage"}]},{"language":"id","pages":[{"title":"id","href":"/id/api-reference/account/usage"}]},{"language":"es","pages":[{"title":"es","href":"/es/api-reference/account/usage"}]}]},"title":"Query Usage and Spending - APIMart","buildId":"dpl_HcHmUS6i3UwswnTHJUEdcTtwfdTQ","deploymentId":"dpl_HcHmUS6i3UwswnTHJUEdcTtwfdTQ","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-BRm_l__d.js","utils-f1l1Oc-G.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-BlhqDhJO.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-DHCB7rsC.js","snippetPresets-CYXLx6Hv.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-B78P2dEq.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-C4YLPVAh.js","shallow-vlLnTDkQ.js","getApiPlaygroundDisplay-D_98hhvf.js","CodeSnippet-DtnZHGqq.js","CodeSnippets-CLFb8KJt.js","Page-kQh739Uz.js","getPastedJson-Cq-zlbnU.js","icon-sN3t983t.js","MethodPill-P_YQ2s09.js","DuplicateIcon-BVzyNsGJ.js","createIcon-B3jqgqC6.js","DynamicMarkdown-Crwq6WG_.js","SectionHeading-C7pGS2Bb.js","axios-vUo_bRtp.js"]}