{ "success": false, "error": { "code": "range_too_large", "message": "Time range must not exceed 31 days.", "type": "usage_query_error" }}
Запрашивайте расходы за заданный период с помощью API Key. Доступны фильтрация по моделям и группировка по моделям, календарным дням или обоим признакам. Результат агрегируется сразу: создавать задачу и опрашивать её статус не нужно.
Время начала включается в период. Принимается Unix timestamp в секундах или строка RFC3339 с часовым поясом, например 2026-09-01T00:00:00+08:00.По умолчанию — за 24 часа до end. Timestamp задаётся в секундах, не в миллисекундах.
Время окончания не включается. Формат тот же, что у start; по умолчанию — текущее время.Должно быть позже start; end - start не может превышать 31 день.
Название модели. Если не указано, учитываются все модели. Несколько моделей разделяются запятыми; максимум 50.Точное совпадение без учёта регистра. Подстановочные знаки не поддерживаются.Пример: gpt-5.6-luna,sora-2
Часовой пояс IANA. По умолчанию Asia/Shanghai.Влияет только на границы календарных дней, когда group_by содержит date, и не меняет моменты начала и окончания. Времена RFC3339 интерпретируются с указанным в них часовым поясом.
account: все API Key аккаунта, которому принадлежит текущий ключ
Период — [start, end): начало включается, окончание исключается. Одинаковое значение end предыдущего запроса и start следующего исключает двойной учёт границы.При ручном составлении URL кодируйте + в RFC3339 как %2B. cURL --data-urlencode, Python params и JavaScript URLSearchParams в примерах делают это автоматически.
При ошибке запроса использования содержит code, message и type; type равен usage_query_error. Ошибки аутентификации 401 / 403 возвращает слой аутентификации.
Используются записи успешно оплаченных вызовов, как в панели данных на сайте
Неуспешные вызовы и возвраты после сбоя задачи исключены; вычитать их вручную не нужно. При частичном успехе пакета изображений оплачиваются фактически выданные изображения
Расходы относятся ко времени проведения платежа. Асинхронные задачи изображений и видео учитываются при завершении, не при отправке; при переходе через полночь — в день завершения
API Key, созданный заново после удаления, является новым ключом. Его запрос scope=key не включает историю старого ключа
Ручные корректировки баланса не являются расходами вызовов и исключаются
Период превышает 31 день; разбейте его на несколько запросов
400
invalid_tz
Неизвестный часовой пояс IANA
400
invalid_group_by
Неверная группировка
400
invalid_scope
Неверная область статистики
400
too_many_models
Более 50 моделей
401 / 403
—
Недействительный или просроченный API Key, IP не разрешён либо аккаунт отключён
429
—
Более 60 запросов в минуту на ключ либо глобальный лимит API
503
usage_unavailable
Данные временно недоступны; повторите позже
Ответ 503 usage_unavailable не содержит сумм. Это означает недоступность запроса, а не нулевые расходы. Не заменяйте ошибку нулевой суммой и не перезаписывайте предыдущий успешный результат.
{"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":"apimart-ai","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6ae1c97b1297abb2484bbfc0"},"chroma":{"liveDeploymentHistoryId":"6ae305834064fb4dbead9f03","collectionId":"376ff515-cd5f-4f62-8266-bef9fbd9e49a","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae305834064fb4dbead9f03"},"entitlements":{},"buildId":"6ae305834064fb4dbead9f03","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"zh-Hans","tag":"API 手册","count":163},{"language":"de","tag":"API-Handbuch","count":163},{"language":"en","tag":"API Manual","count":163},{"language":"es","tag":"Manual de la API","count":163},{"language":"fr","tag":"Manuel API","count":163},{"language":"id","tag":"Panduan API","count":163},{"language":"ja","tag":"APIマニュアル","count":163},{"language":"ko","tag":"API 매뉴얼","count":163},{"language":"pt","tag":"Manual da API","count":163},{"language":"ru","tag":"Руководство API","count":163},{"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":50},{"language":"de","tag":"Bildserie","count":50},{"language":"en","tag":"Image Series","count":50},{"language":"es","tag":"Serie de imágenes","count":50},{"language":"fr","tag":"Série Image","count":50},{"language":"id","tag":"Seri Gambar","count":50},{"language":"ja","tag":"画像シリーズ","count":50},{"language":"ko","tag":"이미지 시리즈","count":50},{"language":"pt","tag":"Série de Imagem","count":50},{"language":"ru","tag":"Серия изображений","count":50},{"language":"zh-Hans","tag":"视频系列","count":43},{"language":"de","tag":"Videoserie","count":43},{"language":"en","tag":"Video Series","count":43},{"language":"es","tag":"Serie de video","count":43},{"language":"fr","tag":"Série Vidéo","count":43},{"language":"id","tag":"Seri Video","count":43},{"language":"ja","tag":"動画シリーズ","count":43},{"language":"ko","tag":"비디오 시리즈","count":43},{"language":"pt","tag":"Série de Vídeo","count":43},{"language":"ru","tag":"Видеосерия","count":43},{"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":10},{"language":"de","tag":"Textserie","count":10},{"language":"en","tag":"Text Series","count":10},{"language":"es","tag":"Serie de texto","count":10},{"language":"fr","tag":"Série Texte","count":10},{"language":"id","tag":"Seri Teks","count":10},{"language":"ja","tag":"テキストシリーズ","count":10},{"language":"ko","tag":"텍스트 시리즈","count":10},{"language":"pt","tag":"Série de Texto","count":10},{"language":"ru","tag":"Текстовая серия","count":10},{"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":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":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":"ru/api-reference/account/usage","slug":"/ru/api-reference/account/usage","pageMetadata":{"title":"Запрос расходов и использования","description":" - Расходы и статистика вызовов за заданный период\n- Фильтрация по моделям, группировка по моделям и календарным дням\n- Статистика текущего API Key или всего аккаунта\n- Сумма в USD, кредиты, число вызовов и токены ","api":"GET https://api.apimart.ai/v1/usage","href":"/ru/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: \"Расходы и статистика вызовов за заданный период\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"Фильтрация по моделям, группировка по моделям и календарным дням\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"Статистика текущего API Key или всего аккаунта\"\n }), \"\\n\", _jsx(_components.li, {\n children: \"Сумма в USD, кредиты, число вызовов и токены\"\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:`Запрашивайте расходы за заданный период с помощью API Key. Доступны фильтрация по моделям и группировка по моделям, календарным дням или обоим признакам. Результат агрегируется сразу: создавать задачу и опрашивать её статус не нужно.`}),`\n`,`\n`,`\n`,_jsx(Heading,{level:`2`,id:`аутентификация`,children:`Аутентификация`}),`\n`,_jsxs(ParamField,{header:`Authorization`,type:`string`,required:true,id:`param-authorization`,children:[_jsxs(_components.p,{children:[`Используйте тот же API Key, что и для вызова моделей, с аутентификацией Bearer Token. Получить ключ можно на `,_jsx(_components.a,{href:`https://apimart.ai/keys`,children:`странице управления API Key`}),`.`]}),_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:`Запрос доступен при нулевом балансе. Баланс не проверяется, но проверяются статус и срок действия API Key, список разрешённых IP и статус аккаунта.`})}),`\n`,_jsx(Heading,{level:`2`,id:`эндпоинты`,children:`Эндпоинты`}),`\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:`Оба эндпоинта имеют одинаковые функции и поддерживают CORS. Храните API Key безопасно и не раскрывайте его в публичном коде фронтенда.`}),`\n`,_jsx(Heading,{level:`2`,id:`параметры-запроса`,children:`Параметры запроса`}),`\n`,_jsx(_components.p,{children:`Все параметры передаются в строке запроса URL.`}),`\n`,_jsxs(ParamField,{query:`start`,type:`integer | string`,id:`param-start`,children:[_jsxs(_components.p,{children:[`Время начала включается в период. Принимается Unix timestamp в секундах или строка RFC3339 с часовым поясом, например `,_jsx(_components.code,{children:`2026-09-01T00:00:00+08:00`}),`.`]}),_jsxs(_components.p,{children:[`По умолчанию — за 24 часа до `,_jsx(_components.code,{children:`end`}),`. Timestamp задаётся в секундах, не в миллисекундах.`]})]}),`\n`,_jsxs(ParamField,{query:`end`,type:`integer | string`,id:`param-end`,children:[_jsxs(_components.p,{children:[`Время окончания не включается. Формат тот же, что у `,_jsx(_components.code,{children:`start`}),`; по умолчанию — текущее время.`]}),_jsxs(_components.p,{children:[`Должно быть позже `,_jsx(_components.code,{children:`start`}),`; `,_jsx(_components.code,{children:`end - start`}),` не может превышать 31 день.`]})]}),`\n`,_jsxs(ParamField,{query:`model`,type:`string`,id:`param-model`,children:[_jsxs(_components.p,{children:[`Название модели. Если не указано, учитываются все модели. Несколько моделей разделяются запятыми; максимум `,_jsx(_components.code,{children:`50`}),`.`]}),_jsx(_components.p,{children:`Точное совпадение без учёта регистра. Подстановочные знаки не поддерживаются.`}),_jsxs(_components.p,{children:[`Пример: `,_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:`Группировка:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`none`}),`: только итог, `,_jsx(_components.code,{children:`items`}),` — пустой массив`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`model`}),`: по моделям`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`date`}),`: по календарным дням`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`model,date`}),`: по моделям и календарным дням`]}),`\n`]})]}),`\n`,_jsxs(ParamField,{query:`tz`,type:`string`,default:`Asia/Shanghai`,id:`param-tz`,children:[_jsxs(_components.p,{children:[`Часовой пояс IANA. По умолчанию `,_jsx(_components.code,{children:`Asia/Shanghai`}),`.`]}),_jsxs(_components.p,{children:[`Влияет только на границы календарных дней, когда `,_jsx(_components.code,{children:`group_by`}),` содержит `,_jsx(_components.code,{children:`date`}),`, и не меняет моменты начала и окончания. Времена RFC3339 интерпретируются с указанным в них часовым поясом.`]})]}),`\n`,_jsxs(ParamField,{query:`scope`,type:`string`,default:`key`,id:`param-scope`,children:[_jsx(_components.p,{children:`Область статистики:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`key`}),`: только текущий API Key (по умолчанию)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`account`}),`: все API Key аккаунта, которому принадлежит текущий ключ`]}),`\n`]})]}),`\n`,_jsxs(Note,{children:[_jsxs(_components.p,{children:[`Период — `,_jsx(_components.code,{children:`[start, end)`}),`: начало включается, окончание исключается. Одинаковое значение `,_jsx(_components.code,{children:`end`}),` предыдущего запроса и `,_jsx(_components.code,{children:`start`}),` следующего исключает двойной учёт границы.`]}),_jsxs(_components.p,{children:[`При ручном составлении URL кодируйте `,_jsx(_components.code,{children:`+`}),` в RFC3339 как `,_jsx(_components.code,{children:`%2B`}),`. cURL `,_jsx(_components.code,{children:`--data-urlencode`}),`, Python `,_jsx(_components.code,{children:`params`}),` и JavaScript `,_jsx(_components.code,{children:`URLSearchParams`}),` в примерах делают это автоматически.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`примеры-запросов`,children:`Примеры запросов`}),`\n`,_jsx(Heading,{level:`3`,id:`расходы-текущего-api-key-за-последние-24-часа`,children:`Расходы текущего API Key за последние 24 часа`}),`\n`,_jsx(_components.p,{children:`Без параметров строки запроса используются период, область и группировка по умолчанию.`}),`\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:`ежедневные-расходы-всего-аккаунта-по-выбранным-моделям`,children:`Ежедневные расходы всего аккаунта по выбранным моделям`}),`\n`,_jsx(_components.p,{children:`Запрос расходов с 11 по 18 сентября 2026 года по пекинскому времени, не включая 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:`группировка-по-моделям-и-календарным-дням`,children:`Группировка по моделям и календарным дням`}),`\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:[`При этой группировке каждый элемент `,_jsx(_components.code,{children:`items`}),` содержит и `,_jsx(_components.code,{children:`model`}),`, и `,_jsx(_components.code,{children:`date`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`поля-ответа`,children:`Поля ответа`}),`\n`,_jsx(ResponseField,{name:`success`,type:`boolean`,id:`param-success`,children:_jsxs(_components.p,{children:[`Успешность запроса: `,_jsx(_components.code,{children:`true`}),` при успехе, `,_jsx(_components.code,{children:`false`}),` при ошибке запроса использования.`]})}),`\n`,_jsxs(ResponseField,{name:`data`,type:`object`,id:`param-data`,children:[_jsx(_components.p,{children:`При успехе возвращает область запроса, итог и сгруппированные данные.`}),_jsxs(Expandable,{title:`Свойства data`,children:[_jsx(ResponseField,{name:`scope`,type:`string`,id:`param-scope-1`,children:_jsxs(_components.p,{children:[`Область статистики: `,_jsx(_components.code,{children:`key`}),` или `,_jsx(_components.code,{children:`account`}),`.`]})}),_jsx(ResponseField,{name:`start`,type:`integer`,id:`param-start-1`,children:_jsx(_components.p,{children:`Фактическое время начала: Unix timestamp в секундах, включительно.`})}),_jsx(ResponseField,{name:`end`,type:`integer`,id:`param-end-1`,children:_jsx(_components.p,{children:`Фактическое время окончания: Unix timestamp в секундах, исключительно.`})}),_jsx(ResponseField,{name:`tz`,type:`string`,id:`param-tz-1`,children:_jsx(_components.p,{children:`Часовой пояс для группировки по календарным дням.`})}),_jsx(ResponseField,{name:`group_by`,type:`string`,id:`param-group-by-1`,children:_jsxs(_components.p,{children:[`Группировка: `,_jsx(_components.code,{children:`none`}),`, `,_jsx(_components.code,{children:`model`}),`, `,_jsx(_components.code,{children:`date`}),` или `,_jsx(_components.code,{children:`model,date`}),`.`]})}),_jsx(ResponseField,{name:`total`,type:`object`,id:`param-total`,children:_jsx(_components.p,{children:`Итог за период запроса. Статистические поля приведены ниже.`})}),_jsxs(ResponseField,{name:`items`,type:`object[]`,id:`param-items`,children:[_jsxs(_components.p,{children:[`Сгруппированные данные по убыванию `,_jsx(_components.code,{children:`amount_usd`}),`. При `,_jsx(_components.code,{children:`group_by=none`}),` — пустой массив. Каждый элемент содержит статистические поля из таблицы ниже.`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Если `,_jsx(_components.code,{children:`group_by`}),` содержит `,_jsx(_components.code,{children:`model`}),`, элемент содержит `,_jsx(_components.code,{children:`model`})]}),`\n`,_jsxs(_components.li,{children:[`Если `,_jsx(_components.code,{children:`group_by`}),` содержит `,_jsx(_components.code,{children:`date`}),`, элемент содержит `,_jsx(_components.code,{children:`date`}),` в формате `,_jsx(_components.code,{children:`YYYY-MM-DD`}),`; границы дней определяются `,_jsx(_components.code,{children:`tz`})]}),`\n`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`data.total`}),` и `,_jsx(_components.code,{children:`data.items[]`}),` используют следующие общие статистические поля:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Поле`}),_jsx(_components.th,{children:`Тип`}),_jsx(_components.th,{children:`Описание`})]})}),_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, округлённая до 6 знаков после запятой`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`credits`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[`Кредиты сервиса: `,_jsx(_components.code,{children:`amount_usd × 10`}),`, в тех же единицах, что на сайте`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`requests`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Число успешно оплаченных вызовов`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`prompt_tokens`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Входные токены; обычно 0 для изображений и видео с оплатой за вызов или секунду`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`completion_tokens`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Выходные токены; обычно 0 для изображений и видео с оплатой за вызов или секунду`})]})]})]}),`\n`,_jsx(ResponseField,{name:`error`,type:`object`,id:`param-error`,children:_jsxs(_components.p,{children:[`При ошибке запроса использования содержит `,_jsx(_components.code,{children:`code`}),`, `,_jsx(_components.code,{children:`message`}),` и `,_jsx(_components.code,{children:`type`}),`; `,_jsx(_components.code,{children:`type`}),` равен `,_jsx(_components.code,{children:`usage_query_error`}),`. Ошибки аутентификации 401 / 403 возвращает слой аутентификации.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`лимиты-и-кеш`,children:`Лимиты и кеш`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Не более `,_jsx(_components.code,{children:`60`}),` запросов в минуту на API Key; также действуют глобальные лимиты API`]}),`\n`,_jsxs(_components.li,{children:[`Результаты с одинаковыми параметрами кешируются на `,_jsx(_components.code,{children:`60`}),` секунд; заголовок `,_jsx(_components.code,{children:`X-Usage-Cache`}),` — `,_jsx(_components.code,{children:`hit`}),` или `,_jsx(_components.code,{children:`miss`})]}),`\n`,_jsx(_components.li,{children:`Расходы обычно доступны в течение 1 секунды, но данные за последнюю минуту могут быть неполными; возможна задержка кеша`}),`\n`,_jsx(_components.li,{children:`Рекомендуется интервал не менее 1 минуты; не используйте эндпоинт как уведомление о списаниях в реальном времени`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`правила-учёта`,children:`Правила учёта`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Используются записи успешно оплаченных вызовов, как в панели данных на сайте`}),`\n`,_jsx(_components.li,{children:`Неуспешные вызовы и возвраты после сбоя задачи исключены; вычитать их вручную не нужно. При частичном успехе пакета изображений оплачиваются фактически выданные изображения`}),`\n`,_jsx(_components.li,{children:`Расходы относятся ко времени проведения платежа. Асинхронные задачи изображений и видео учитываются при завершении, не при отправке; при переходе через полночь — в день завершения`}),`\n`,_jsxs(_components.li,{children:[`API Key, созданный заново после удаления, является новым ключом. Его запрос `,_jsx(_components.code,{children:`scope=key`}),` не включает историю старого ключа`]}),`\n`,_jsx(_components.li,{children:`Ручные корректировки баланса не являются расходами вызовов и исключаются`}),`\n`,_jsx(_components.li,{children:`Доступны данные после 27 апреля 2026 года`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`обработка-ошибок`,children:`Обработка ошибок`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Статус HTTP`}),_jsx(_components.th,{children:_jsx(_components.code,{children:`error.code`})}),_jsx(_components.th,{children:`Описание`})]})}),_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:`Неверный формат времени начала или окончания`})]}),_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`}),` не позже `,_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:`Период превышает 31 день; разбейте его на несколько запросов`})]}),_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:`Неизвестный часовой пояс IANA`})]}),_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:`Неверная группировка`})]}),_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:`Неверная область статистики`})]}),_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:`Более 50 моделей`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401 / 403`}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`Недействительный или просроченный API Key, IP не разрешён либо аккаунт отключён`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`429`}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`Более 60 запросов в минуту на ключ либо глобальный лимит API`})]}),_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:`Данные временно недоступны; повторите позже`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Ответ `,_jsx(_components.code,{children:`503 usage_unavailable`}),` не содержит сумм. Это означает недоступность запроса, а не нулевые расходы. Не заменяйте ошибку нулевой суммой и не перезаписывайте предыдущий успешный результат.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`отличия-от-других-эндпоинтов`,children:`Отличия от других эндпоинтов`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Эндпоинт`}),_jsx(_components.th,{children:`Возможности`})]})}),_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:`Только накопленные расходы; без фильтров по моделям или времени`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`POST /v1/logs/export`})}),_jsx(_components.td,{children:`Асинхронный экспорт деталей вызовов (CSV / XLSX); агрегация на вашей стороне`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`GET /v1/usage`})}),_jsx(_components.td,{children:`Запрос по времени и моделям с прямым возвратом итога и сгруппированных расходов`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Для оставшегося лимита используйте `,_jsx(_components.a,{href:`/ru/api-reference/account/token-balance`,children:`запрос баланса токена`}),` или `,_jsx(_components.a,{href:`/ru/api-reference/account/user-balance`,children:`запрос баланса пользователя`}),`.`]})]})}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":"Запрос расходов и использования","description":" - Расходы и статистика вызовов за заданный период\n- Фильтрация по моделям, группировка по моделям и календарным дням\n- Статистика текущего API Key или всего аккаунта\n- Сумма в USD, кредиты, число вызовов и токены ","api":"GET https://api.apimart.ai/v1/usage","href":"/ru/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:`Запрашивайте расходы за заданный период с помощью API Key. Доступны фильтрация по моделям и группировка по моделям, календарным дням или обоим признакам. Результат агрегируется сразу: создавать задачу и опрашивать её статус не нужно.`}),`\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:`\"Не удалось получить данные использования\"`}),_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:` \"Не удалось получить данные использования\"`}),_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:`аутентификация`,children:`Аутентификация`}),`\n`,_jsxs(ParamField,{header:`Authorization`,type:`string`,required:true,id:`param-authorization`,children:[_jsxs(_components.p,{children:[`Используйте тот же API Key, что и для вызова моделей, с аутентификацией Bearer Token. Получить ключ можно на `,_jsx(_components.a,{href:`https://apimart.ai/keys`,children:`странице управления API Key`}),`.`]}),_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:`Запрос доступен при нулевом балансе. Баланс не проверяется, но проверяются статус и срок действия API Key, список разрешённых IP и статус аккаунта.`})}),`\n`,_jsx(Heading,{level:`2`,id:`эндпоинты`,children:`Эндпоинты`}),`\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:`Оба эндпоинта имеют одинаковые функции и поддерживают CORS. Храните API Key безопасно и не раскрывайте его в публичном коде фронтенда.`}),`\n`,_jsx(Heading,{level:`2`,id:`параметры-запроса`,children:`Параметры запроса`}),`\n`,_jsx(_components.p,{children:`Все параметры передаются в строке запроса URL.`}),`\n`,_jsxs(ParamField,{query:`start`,type:`integer | string`,id:`param-start`,children:[_jsxs(_components.p,{children:[`Время начала включается в период. Принимается Unix timestamp в секундах или строка RFC3339 с часовым поясом, например `,_jsx(_components.code,{children:`2026-09-01T00:00:00+08:00`}),`.`]}),_jsxs(_components.p,{children:[`По умолчанию — за 24 часа до `,_jsx(_components.code,{children:`end`}),`. Timestamp задаётся в секундах, не в миллисекундах.`]})]}),`\n`,_jsxs(ParamField,{query:`end`,type:`integer | string`,id:`param-end`,children:[_jsxs(_components.p,{children:[`Время окончания не включается. Формат тот же, что у `,_jsx(_components.code,{children:`start`}),`; по умолчанию — текущее время.`]}),_jsxs(_components.p,{children:[`Должно быть позже `,_jsx(_components.code,{children:`start`}),`; `,_jsx(_components.code,{children:`end - start`}),` не может превышать 31 день.`]})]}),`\n`,_jsxs(ParamField,{query:`model`,type:`string`,id:`param-model`,children:[_jsxs(_components.p,{children:[`Название модели. Если не указано, учитываются все модели. Несколько моделей разделяются запятыми; максимум `,_jsx(_components.code,{children:`50`}),`.`]}),_jsx(_components.p,{children:`Точное совпадение без учёта регистра. Подстановочные знаки не поддерживаются.`}),_jsxs(_components.p,{children:[`Пример: `,_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:`Группировка:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`none`}),`: только итог, `,_jsx(_components.code,{children:`items`}),` — пустой массив`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`model`}),`: по моделям`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`date`}),`: по календарным дням`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`model,date`}),`: по моделям и календарным дням`]}),`\n`]})]}),`\n`,_jsxs(ParamField,{query:`tz`,type:`string`,default:`Asia/Shanghai`,id:`param-tz`,children:[_jsxs(_components.p,{children:[`Часовой пояс IANA. По умолчанию `,_jsx(_components.code,{children:`Asia/Shanghai`}),`.`]}),_jsxs(_components.p,{children:[`Влияет только на границы календарных дней, когда `,_jsx(_components.code,{children:`group_by`}),` содержит `,_jsx(_components.code,{children:`date`}),`, и не меняет моменты начала и окончания. Времена RFC3339 интерпретируются с указанным в них часовым поясом.`]})]}),`\n`,_jsxs(ParamField,{query:`scope`,type:`string`,default:`key`,id:`param-scope`,children:[_jsx(_components.p,{children:`Область статистики:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`key`}),`: только текущий API Key (по умолчанию)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`account`}),`: все API Key аккаунта, которому принадлежит текущий ключ`]}),`\n`]})]}),`\n`,_jsxs(Note,{children:[_jsxs(_components.p,{children:[`Период — `,_jsx(_components.code,{children:`[start, end)`}),`: начало включается, окончание исключается. Одинаковое значение `,_jsx(_components.code,{children:`end`}),` предыдущего запроса и `,_jsx(_components.code,{children:`start`}),` следующего исключает двойной учёт границы.`]}),_jsxs(_components.p,{children:[`При ручном составлении URL кодируйте `,_jsx(_components.code,{children:`+`}),` в RFC3339 как `,_jsx(_components.code,{children:`%2B`}),`. cURL `,_jsx(_components.code,{children:`--data-urlencode`}),`, Python `,_jsx(_components.code,{children:`params`}),` и JavaScript `,_jsx(_components.code,{children:`URLSearchParams`}),` в примерах делают это автоматически.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`примеры-запросов`,children:`Примеры запросов`}),`\n`,_jsx(Heading,{level:`3`,id:`расходы-текущего-api-key-за-последние-24-часа`,children:`Расходы текущего API Key за последние 24 часа`}),`\n`,_jsx(_components.p,{children:`Без параметров строки запроса используются период, область и группировка по умолчанию.`}),`\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:`ежедневные-расходы-всего-аккаунта-по-выбранным-моделям`,children:`Ежедневные расходы всего аккаунта по выбранным моделям`}),`\n`,_jsx(_components.p,{children:`Запрос расходов с 11 по 18 сентября 2026 года по пекинскому времени, не включая 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:`группировка-по-моделям-и-календарным-дням`,children:`Группировка по моделям и календарным дням`}),`\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:[`При этой группировке каждый элемент `,_jsx(_components.code,{children:`items`}),` содержит и `,_jsx(_components.code,{children:`model`}),`, и `,_jsx(_components.code,{children:`date`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`поля-ответа`,children:`Поля ответа`}),`\n`,_jsx(ResponseField,{name:`success`,type:`boolean`,id:`param-success`,children:_jsxs(_components.p,{children:[`Успешность запроса: `,_jsx(_components.code,{children:`true`}),` при успехе, `,_jsx(_components.code,{children:`false`}),` при ошибке запроса использования.`]})}),`\n`,_jsxs(ResponseField,{name:`data`,type:`object`,id:`param-data`,children:[_jsx(_components.p,{children:`При успехе возвращает область запроса, итог и сгруппированные данные.`}),_jsxs(Expandable,{title:`Свойства data`,children:[_jsx(ResponseField,{name:`scope`,type:`string`,id:`param-scope-1`,children:_jsxs(_components.p,{children:[`Область статистики: `,_jsx(_components.code,{children:`key`}),` или `,_jsx(_components.code,{children:`account`}),`.`]})}),_jsx(ResponseField,{name:`start`,type:`integer`,id:`param-start-1`,children:_jsx(_components.p,{children:`Фактическое время начала: Unix timestamp в секундах, включительно.`})}),_jsx(ResponseField,{name:`end`,type:`integer`,id:`param-end-1`,children:_jsx(_components.p,{children:`Фактическое время окончания: Unix timestamp в секундах, исключительно.`})}),_jsx(ResponseField,{name:`tz`,type:`string`,id:`param-tz-1`,children:_jsx(_components.p,{children:`Часовой пояс для группировки по календарным дням.`})}),_jsx(ResponseField,{name:`group_by`,type:`string`,id:`param-group-by-1`,children:_jsxs(_components.p,{children:[`Группировка: `,_jsx(_components.code,{children:`none`}),`, `,_jsx(_components.code,{children:`model`}),`, `,_jsx(_components.code,{children:`date`}),` или `,_jsx(_components.code,{children:`model,date`}),`.`]})}),_jsx(ResponseField,{name:`total`,type:`object`,id:`param-total`,children:_jsx(_components.p,{children:`Итог за период запроса. Статистические поля приведены ниже.`})}),_jsxs(ResponseField,{name:`items`,type:`object[]`,id:`param-items`,children:[_jsxs(_components.p,{children:[`Сгруппированные данные по убыванию `,_jsx(_components.code,{children:`amount_usd`}),`. При `,_jsx(_components.code,{children:`group_by=none`}),` — пустой массив. Каждый элемент содержит статистические поля из таблицы ниже.`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Если `,_jsx(_components.code,{children:`group_by`}),` содержит `,_jsx(_components.code,{children:`model`}),`, элемент содержит `,_jsx(_components.code,{children:`model`})]}),`\n`,_jsxs(_components.li,{children:[`Если `,_jsx(_components.code,{children:`group_by`}),` содержит `,_jsx(_components.code,{children:`date`}),`, элемент содержит `,_jsx(_components.code,{children:`date`}),` в формате `,_jsx(_components.code,{children:`YYYY-MM-DD`}),`; границы дней определяются `,_jsx(_components.code,{children:`tz`})]}),`\n`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`data.total`}),` и `,_jsx(_components.code,{children:`data.items[]`}),` используют следующие общие статистические поля:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Поле`}),_jsx(_components.th,{children:`Тип`}),_jsx(_components.th,{children:`Описание`})]})}),_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, округлённая до 6 знаков после запятой`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`credits`})}),_jsx(_components.td,{children:`number`}),_jsxs(_components.td,{children:[`Кредиты сервиса: `,_jsx(_components.code,{children:`amount_usd × 10`}),`, в тех же единицах, что на сайте`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`requests`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Число успешно оплаченных вызовов`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`prompt_tokens`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Входные токены; обычно 0 для изображений и видео с оплатой за вызов или секунду`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`completion_tokens`})}),_jsx(_components.td,{children:`integer`}),_jsx(_components.td,{children:`Выходные токены; обычно 0 для изображений и видео с оплатой за вызов или секунду`})]})]})]}),`\n`,_jsx(ResponseField,{name:`error`,type:`object`,id:`param-error`,children:_jsxs(_components.p,{children:[`При ошибке запроса использования содержит `,_jsx(_components.code,{children:`code`}),`, `,_jsx(_components.code,{children:`message`}),` и `,_jsx(_components.code,{children:`type`}),`; `,_jsx(_components.code,{children:`type`}),` равен `,_jsx(_components.code,{children:`usage_query_error`}),`. Ошибки аутентификации 401 / 403 возвращает слой аутентификации.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`лимиты-и-кеш`,children:`Лимиты и кеш`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Не более `,_jsx(_components.code,{children:`60`}),` запросов в минуту на API Key; также действуют глобальные лимиты API`]}),`\n`,_jsxs(_components.li,{children:[`Результаты с одинаковыми параметрами кешируются на `,_jsx(_components.code,{children:`60`}),` секунд; заголовок `,_jsx(_components.code,{children:`X-Usage-Cache`}),` — `,_jsx(_components.code,{children:`hit`}),` или `,_jsx(_components.code,{children:`miss`})]}),`\n`,_jsx(_components.li,{children:`Расходы обычно доступны в течение 1 секунды, но данные за последнюю минуту могут быть неполными; возможна задержка кеша`}),`\n`,_jsx(_components.li,{children:`Рекомендуется интервал не менее 1 минуты; не используйте эндпоинт как уведомление о списаниях в реальном времени`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`правила-учёта`,children:`Правила учёта`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Используются записи успешно оплаченных вызовов, как в панели данных на сайте`}),`\n`,_jsx(_components.li,{children:`Неуспешные вызовы и возвраты после сбоя задачи исключены; вычитать их вручную не нужно. При частичном успехе пакета изображений оплачиваются фактически выданные изображения`}),`\n`,_jsx(_components.li,{children:`Расходы относятся ко времени проведения платежа. Асинхронные задачи изображений и видео учитываются при завершении, не при отправке; при переходе через полночь — в день завершения`}),`\n`,_jsxs(_components.li,{children:[`API Key, созданный заново после удаления, является новым ключом. Его запрос `,_jsx(_components.code,{children:`scope=key`}),` не включает историю старого ключа`]}),`\n`,_jsx(_components.li,{children:`Ручные корректировки баланса не являются расходами вызовов и исключаются`}),`\n`,_jsx(_components.li,{children:`Доступны данные после 27 апреля 2026 года`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`обработка-ошибок`,children:`Обработка ошибок`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Статус HTTP`}),_jsx(_components.th,{children:_jsx(_components.code,{children:`error.code`})}),_jsx(_components.th,{children:`Описание`})]})}),_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:`Неверный формат времени начала или окончания`})]}),_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`}),` не позже `,_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:`Период превышает 31 день; разбейте его на несколько запросов`})]}),_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:`Неизвестный часовой пояс IANA`})]}),_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:`Неверная группировка`})]}),_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:`Неверная область статистики`})]}),_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:`Более 50 моделей`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401 / 403`}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`Недействительный или просроченный API Key, IP не разрешён либо аккаунт отключён`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`429`}),_jsx(_components.td,{children:`—`}),_jsx(_components.td,{children:`Более 60 запросов в минуту на ключ либо глобальный лимит API`})]}),_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:`Данные временно недоступны; повторите позже`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Ответ `,_jsx(_components.code,{children:`503 usage_unavailable`}),` не содержит сумм. Это означает недоступность запроса, а не нулевые расходы. Не заменяйте ошибку нулевой суммой и не перезаписывайте предыдущий успешный результат.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`отличия-от-других-эндпоинтов`,children:`Отличия от других эндпоинтов`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Эндпоинт`}),_jsx(_components.th,{children:`Возможности`})]})}),_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:`Только накопленные расходы; без фильтров по моделям или времени`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`POST /v1/logs/export`})}),_jsx(_components.td,{children:`Асинхронный экспорт деталей вызовов (CSV / XLSX); агрегация на вашей стороне`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`GET /v1/usage`})}),_jsx(_components.td,{children:`Запрос по времени и моделям с прямым возвратом итога и сгруппированных расходов`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Для оставшегося лимита используйте `,_jsx(_components.a,{href:`/ru/api-reference/account/token-balance`,children:`запрос баланса токена`}),` или `,_jsx(_components.a,{href:`/ru/api-reference/account/user-balance`,children:`запрос баланса пользователя`}),`.`]})]})}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":"Запрос расходов и использования","description":" - Расходы и статистика вызовов за заданный период\n- Фильтрация по моделям, группировка по моделям и календарным дням\n- Статистика текущего API Key или всего аккаунта\n- Сумма в USD, кредиты, число вызовов и токены ","api":"GET https://api.apimart.ai/v1/usage","href":"/ru/api-reference/account/usage"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Аутентификация","slug":"аутентификация","depth":2,"children":[]},{"title":"Эндпоинты","slug":"эндпоинты","depth":2,"children":[]},{"title":"Параметры запроса","slug":"параметры-запроса","depth":2,"children":[]},{"title":"Примеры запросов","slug":"примеры-запросов","depth":2,"children":[{"title":"Расходы текущего API Key за последние 24 часа","slug":"расходы-текущего-api-key-за-последние-24-часа","depth":3,"children":[]},{"title":"Ежедневные расходы всего аккаунта по выбранным моделям","slug":"ежедневные-расходы-всего-аккаунта-по-выбранным-моделям","depth":3,"children":[]},{"title":"Группировка по моделям и календарным дням","slug":"группировка-по-моделям-и-календарным-дням","depth":3,"children":[]}]},{"title":"Поля ответа","slug":"поля-ответа","depth":2,"children":[]},{"title":"Лимиты и кеш","slug":"лимиты-и-кеш","depth":2,"children":[]},{"title":"Правила учёта","slug":"правила-учёта","depth":2,"children":[]},{"title":"Обработка ошибок","slug":"обработка-ошибок","depth":2,"children":[]},{"title":"Отличия от других эндпоинтов","slug":"отличия-от-других-эндпоинтов","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\">\"Не удалось получить данные использования\"\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\"> \"Не удалось получить данные использования\"\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":"Запрос расходов и использования","path":"/v1/usage","servers":[{"url":"https://api.apimart.ai"}],"method":"get","request":{"security":[],"parameters":{"query":{"start":{"schema":[{"type":"object","properties":{},"description":"Время начала включается в период. Принимается Unix timestamp в секундах или строка RFC3339 с часовым поясом, например `2026-09-01T00:00:00+08:00` . По умолчанию — за 24 часа до `end` . Timestamp задаётся в секундах, не в миллисекундах."}]},"end":{"schema":[{"type":"object","properties":{},"description":"Время окончания не включается. Формат тот же, что у `start` ; по умолчанию — текущее время. Должно быть позже `start` ; `end - start` не может превышать 31 день."}]},"model":{"schema":[{"type":"string","description":"Название модели. Если не указано, учитываются все модели. Несколько моделей разделяются запятыми; максимум `50` . Точное совпадение без учёта регистра. Подстановочные знаки не поддерживаются. Пример: `gpt-5.6-luna,sora-2`"}]},"group_by":{"schema":[{"type":"string","description":"Группировка: `none` : только итог, `items` — пустой массив `model` : по моделям `date` : по календарным дням `model,date` : по моделям и календарным дням"}]},"tz":{"schema":[{"type":"string","description":"Часовой пояс IANA. По умолчанию `Asia/Shanghai` . Влияет только на границы календарных дней, когда `group_by` содержит `date` , и не меняет моменты начала и окончания. Времена RFC3339 интерпретируются с указанным в них часовым поясом."}]},"scope":{"schema":[{"type":"string","description":"Область статистики: `key` : только текущий API Key (по умолчанию) `account` : все API Key аккаунта, которому принадлежит текущий ключ"}]}},"header":{"Authorization":{"schema":[{"type":"string","description":"Используйте тот же API Key, что и для вызова моделей, с аутентификацией Bearer Token. Получить ключ можно на странице управления API Key .","required":true}]}},"cookie":{},"path":{}},"body":{}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"success":[{"type":"boolean","description":"Успешность запроса: `true` при успехе, `false` при ошибке запроса использования."}],"data":[{"type":"object","properties":{"scope":[{"type":"string","description":"Область статистики: `key` или `account` ."}],"start":[{"type":"integer","description":"Фактическое время начала: Unix timestamp в секундах, включительно."}],"end":[{"type":"integer","description":"Фактическое время окончания: Unix timestamp в секундах, исключительно."}],"tz":[{"type":"string","description":"Часовой пояс для группировки по календарным дням."}],"group_by":[{"type":"string","description":"Группировка: `none` , `model` , `date` или `model,date` ."}],"total":[{"type":"object","properties":{},"description":"Итог за период запроса. Статистические поля приведены ниже."}],"items":[{"type":"array","items":[{"type":"object","properties":{}}],"description":"Сгруппированные данные по убыванию `amount_usd` . При `group_by=none` — пустой массив. Каждый элемент содержит статистические поля из таблицы ниже. Если `group_by` содержит `model` , элемент содержит `model` Если `group_by` содержит `date` , элемент содержит `date` в формате `YYYY-MM-DD` ; границы дней определяются `tz`"}]},"description":"При успехе возвращает область запроса, итог и сгруппированные данные."}],"error":[{"type":"object","properties":{},"description":"При ошибке запроса использования содержит `code` , `message` и `type` ; `type` равен `usage_query_error` . Ошибки аутентификации 401 / 403 возвращает слой аутентификации."}]}}],"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":"Запрос расходов и использования - APIMart","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/en/api-reference/account/usage","matchLevel":1},"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":0},"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:04.672Z","originalFileLocation":"ru/api-reference/account/usage.mdx","locale":"ru"},"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=\"- Расходы и статистика вызовов за заданный период - Фильтрация по моделям, группировка по моделям и календарным дням - Статистика текущего API Key или всего аккаунта - Сумма в USD, кредиты, число вызовов и токены\">\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=\"Запрос расходов и использования - APIMart\">\u003cmeta data-mint-head property=\"og:description\" content=\"- Расходы и статистика вызовов за заданный период - Фильтрация по моделям, группировка по моделям и календарным дням - Статистика текущего API Key или всего аккаунта - Сумма в USD, кредиты, число вызовов и токены\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"APIMart\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.apimart.ai/ru/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=%D0%A3%D0%BF%D1%80%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5+%D0%B0%D0%BA%D0%BA%D0%B0%D1%83%D0%BD%D1%82%D0%BE%D0%BC\u0026amp;title=%D0%97%D0%B0%D0%BF%D1%80%D0%BE%D1%81+%D1%80%D0%B0%D1%81%D1%85%D0%BE%D0%B4%D0%BE%D0%B2+%D0%B8+%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F\u0026amp;description=+-+%D0%A0%D0%B0%D1%81%D1%85%D0%BE%D0%B4%D1%8B+%D0%B8+%D1%81%D1%82%D0%B0%D1%82%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B0+%D0%B2%D1%8B%D0%B7%D0%BE%D0%B2%D0%BE%D0%B2+%D0%B7%D0%B0+%D0%B7%D0%B0%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D0%B9+%D0%BF%D0%B5%D1%80%D0%B8%D0%BE%D0%B4%0A-+%D0%A4%D0%B8%D0%BB%D1%8C%D1%82%D1%80%D0%B0%D1%86%D0%B8%D1%8F+%D0%BF%D0%BE+%D0%BC%D0%BE%D0%B4%D0%B5%D0%BB%D1%8F%D0%BC%2C+%D0%B3%D1%80%D1%83%D0%BF%D0%BF%D0%B8%D1%80%D0%BE%D0%B2%D0%BA%D0%B0+%D0%BF%D0%BE+%D0%BC%D0%BE%D0%B4%D0%B5%D0%BB%D1%8F%D0%BC+%D0%B8+%D0%BA%D0%B0%D0%BB%D0%B5%D0%BD%D0%B4%D0%B0%D1%80%D0%BD%D1%8B%D0%BC+%D0%B4%D0%BD%D1%8F%D0%BC%0A-+%D0%A1%D1%82%D0%B0%D1%82%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B0+%D1%82%D0%B5%D0%BA%D1%83%D1%89%D0%B5%D0%B3%D0%BE+API+Key+%D0%B8%D0%BB%D0%B8+%D0%B2%D1%81%D0%B5%D0%B3%D0%BE+%D0%B0%D0%BA\u0026amp;theme=85f832f8b30837d0268a5e67\u0026amp;signature=e38a3b05da4c6e59f6441800348ba95549683612fdba68a9dd4b07545e5a98e8\">\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=\"Запрос расходов и использования - APIMart\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"- Расходы и статистика вызовов за заданный период - Фильтрация по моделям, группировка по моделям и календарным дням - Статистика текущего API Key или всего аккаунта - Сумма в USD, кредиты, число вызовов и токены\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://apicore.mintlify.app/_mintlify/api/og/v2?division=%D0%A3%D0%BF%D1%80%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5+%D0%B0%D0%BA%D0%BA%D0%B0%D1%83%D0%BD%D1%82%D0%BE%D0%BC\u0026amp;title=%D0%97%D0%B0%D0%BF%D1%80%D0%BE%D1%81+%D1%80%D0%B0%D1%81%D1%85%D0%BE%D0%B4%D0%BE%D0%B2+%D0%B8+%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F\u0026amp;description=+-+%D0%A0%D0%B0%D1%81%D1%85%D0%BE%D0%B4%D1%8B+%D0%B8+%D1%81%D1%82%D0%B0%D1%82%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B0+%D0%B2%D1%8B%D0%B7%D0%BE%D0%B2%D0%BE%D0%B2+%D0%B7%D0%B0+%D0%B7%D0%B0%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D0%B9+%D0%BF%D0%B5%D1%80%D0%B8%D0%BE%D0%B4%0A-+%D0%A4%D0%B8%D0%BB%D1%8C%D1%82%D1%80%D0%B0%D1%86%D0%B8%D1%8F+%D0%BF%D0%BE+%D0%BC%D0%BE%D0%B4%D0%B5%D0%BB%D1%8F%D0%BC%2C+%D0%B3%D1%80%D1%83%D0%BF%D0%BF%D0%B8%D1%80%D0%BE%D0%B2%D0%BA%D0%B0+%D0%BF%D0%BE+%D0%BC%D0%BE%D0%B4%D0%B5%D0%BB%D1%8F%D0%BC+%D0%B8+%D0%BA%D0%B0%D0%BB%D0%B5%D0%BD%D0%B4%D0%B0%D1%80%D0%BD%D1%8B%D0%BC+%D0%B4%D0%BD%D1%8F%D0%BC%0A-+%D0%A1%D1%82%D0%B0%D1%82%D0%B8%D1%81%D1%82%D0%B8%D0%BA%D0%B0+%D1%82%D0%B5%D0%BA%D1%83%D1%89%D0%B5%D0%B3%D0%BE+API+Key+%D0%B8%D0%BB%D0%B8+%D0%B2%D1%81%D0%B5%D0%B3%D0%BE+%D0%B0%D0%BA\u0026amp;theme=85f832f8b30837d0268a5e67\u0026amp;signature=e38a3b05da4c6e59f6441800348ba95549683612fdba68a9dd4b07545e5a98e8\">\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/ru/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=\"/ru/api-reference/account/usage.md\">\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=\"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=\"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/ru/api-reference/account/usage#webpage\",\"url\":\"https://docs.apimart.ai/ru/api-reference/account/usage\",\"name\":\"Запрос расходов и использования\",\"description\":\"- Расходы и статистика вызовов за заданный период - Фильтрация по моделям, группировка по моделям и календарным дням - Статистика текущего API Key или всего аккаунта - Сумма в USD, кредиты, число вызовов и токены\",\"dateModified\":\"2026-09-18T09:08:04.672Z\",\"isPartOf\":{\"@id\":\"https://docs.apimart.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.apimart.ai/ru/api-reference/account/usage#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.apimart.ai/ru/api-reference/account/usage#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Управление аккаунтом\",\"item\":\"https://docs.apimart.ai/ru/api-reference/account/token-balance\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Запрос расходов и использования\",\"item\":\"https://docs.apimart.ai/ru/api-reference/account/usage\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.apimart.ai/ru/api-reference/account/usage#apireference\",\"headline\":\"Запрос расходов и использования\",\"name\":\"Запрос расходов и использования\",\"description\":\"- Расходы и статистика вызовов за заданный период - Фильтрация по моделям, группировка по моделям и календарным дням - Статистика текущего API Key или всего аккаунта - Сумма в USD, кредиты, число вызовов и токены\",\"url\":\"https://docs.apimart.ai/ru/api-reference/account/usage\",\"mainEntityOfPage\":{\"@id\":\"https://docs.apimart.ai/ru/api-reference/account/usage#webpage\"},\"dateModified\":\"2026-09-18T09:08:04.672Z\",\"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","pages":[{"title":"en","href":"/en/api-reference/account/usage"}]},{"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","tabs":[{"tab":"Руководство API","groups":[{"group":"Обзор","pages":[{"title":"APIMart — OpenAI-совместимый API-шлюз (GPT-5, Claude, Gemini)","href":"/ru"}]},{"group":"Модели","pages":[{"title":"API метаданных списка моделей","api":"GET https://api.apimart.ai/v1/models","href":"/ru/api-reference/texts/models/list"}]},{"group":"Текстовая серия","icon":"text","pages":[{"title":"Универсальный Chat API (стриминг по умолчанию)","api":"POST https://api.apimart.ai/v1/chat/completions","href":"/ru/api-reference/texts/general/chat-completions"},{"title":"Универсальный Chat API (без стриминга по умолчанию)","api":"POST https://api.apimart.ai/api/v1/chat/completions","href":"/ru/api-reference/texts/general/chat-completions-nostream"},{"title":"Claude Messages API","api":"POST https://api.apimart.ai/v1/messages","href":"/ru/api-reference/texts/general/claude-messages"},{"title":"Нативный формат Gemini","api":"POST https://api.apimart.ai/v1beta/models/{model}:{method}","href":"/ru/api-reference/texts/gemini/quickstart"},{"title":"OpenAI Multimodal Responses API","api":"POST https://api.apimart.ai/v1/responses","href":"/ru/api-reference/texts/openai/responses"},{"title":"Руководство по кэшированию контекста OpenAI","sidebarTitle":"Кэш контекста OpenAI","icon":"database","href":"/ru/api-reference/texts/openai/context-cache"},{"title":"Руководство по контекстному кэшу Gemini","sidebarTitle":"Контекстный кэш Gemini","icon":"database","href":"/ru/api-reference/texts/gemini/context-cache"},{"title":"Руководство по контекстному кэшу Claude","sidebarTitle":"Контекстный кэш Claude","icon":"database","href":"/ru/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":"/ru/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":"/ru/api-reference/texts/qwen3.8-max/pricing"}]}]},{"group":"Серия изображений","icon":"image","pages":[{"group":"Nano banana 2.1","icon":"image","pages":[{"title":"Nano banana 2.1 Генерация изображений","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/gemini-nano-banana-2.1/generation"}]},{"group":"Nano banana2","icon":"image","pages":[{"title":"Nano banana2 Генерация изображений","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/gemini-3.1-flash/generation"},{"title":"Nano Banana Lite Генерация изображений","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/gemini-3.1-flash/generation-lite"}]},{"group":"Nano banana Pro","icon":"image","pages":[{"title":"Nano banana Pro Генерация изображений","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/gemini-3-pro/generation"}]},{"group":"Nano banana","icon":"image","pages":[{"title":"Nano banana Генерация изображений","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/gemini-2.5-flash/generation"}]},{"group":"Imagen-4.0","icon":"image","pages":[{"title":"Генерация изображений Imagen 4.0 Apimart","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/imagen-4.0-apimart/generation"}]},{"group":"GPT-Image(1/1.5)","icon":"image","pages":[{"title":"Генерация изображений GPT-Image(1/1.5)","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/gpt-image-1/generation"}]},{"group":"GPT-Image-2","icon":"image","pages":[{"title":"Генерация изображений GPT-Image-2","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/gpt-image-2/generation"},{"title":"Генерация изображений GPT-Image-2 (официальный канал)","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/gpt-image-2/official"}]},{"group":"GPT-Image-2.5","icon":"image","pages":[{"title":"Генерация изображений GPT-Image-2.5","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/gpt-image-2.5/generation"}]},{"group":"GPT-Image-2.5 Ext","icon":"image","pages":[{"title":"GPT-Image-2.5 Ext — генерация изображений","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/gpt-image-2.5-ext/generation"}]},{"group":"Seedream-4.0","icon":"image","pages":[{"title":"Генерация изображений Seedream-4.0","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/seedream-4/generation"}]},{"group":"Seedream-4.5","icon":"image","pages":[{"title":"Генерация изображений Seedream-4.5","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/seedream-4.5/generation"}]},{"group":"Seedream-5.0-Lite","icon":"image","pages":[{"title":"Генерация изображений Seedream-5.0-Lite","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/seedream-5-lite/generation"}]},{"group":"Seedream-5.0-Pro","icon":"image","pages":[{"title":"Генерация изображений Seedream-5.0-Pro","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/seedream-5-0-pro/generation"}]},{"group":"Seedream-5.0-Flash","icon":"image","pages":[{"title":"Генерация изображений Seedream-5.0-Flash","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/seedream-5-0-flash/generation"}]},{"group":"Flux Kontext","icon":"image","pages":[{"title":"Генерация изображений Flux Kontext","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/flux-kontext/generation"}]},{"group":"Flux 2.0","icon":"image","pages":[{"title":"Генерация изображений Flux 2.0","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/flux-2/generation"}]},{"group":"FLUX 3 Image","icon":"image","pages":[{"title":"FLUX 3 Image Генерация изображений","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/flux-3-image/generation"}]},{"group":"FLUX 3 Image Klein","icon":"image","pages":[{"title":"FLUX 3 Image Klein Генерация изображений","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/flux-3-image-klein/generation"}]},{"group":"Hy-Image-3.5 Preview","icon":"image","pages":[{"title":"Hy-Image-3.5 Preview Генерация изображений","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/hy-image-v3.5-preview/generation"}]},{"group":"Muse Image Ext","icon":"image","pages":[{"title":"Генерация изображений Muse Image Ext","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/muse-image-ext/generation"}]},{"group":"MAI-Image-2.6","icon":"image","pages":[{"title":"MAI-Image-2.6 Генерация изображений","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/mai-image-2.6/generation"}]},{"group":"Qwen Image 2.0","icon":"image","pages":[{"title":"Генерация изображений Qwen Image 2.0","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/qwen-image/generation"}]},{"group":"Qwen Image 3.0","icon":"image","pages":[{"title":"Генерация изображений Qwen Image 3.0","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/qwen-image-3.0/generation"}]},{"group":"Z-Image-Turbo","icon":"image","pages":[{"title":"Генерация изображений Z-Image-Turbo","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/z-image-turbo/generation"}]},{"group":"Grok Imagine","icon":"image","pages":[{"title":"Grok Imagine — генерация изображений","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/grok-imagine/generation"}]},{"group":"Grok Imagine 2.0 Ext","icon":"image","pages":[{"title":"Grok Imagine 2.0 Ext: генерация изображений","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/grok-imagine-2.0-ext/generation"},{"title":"Слои и редактирование областей Grok Imagine 2.0 Ext","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/grok-imagine-2.0-ext/layer-region-edit"},{"title":"Grok Imagine Image 2.0: официальная генерация и редактирование","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/grok-imagine-2.0-ext/official"}]},{"group":"wan2.7-image","icon":"image","pages":[{"title":"Генерация и редактирование изображений wan2.7","api":"POST https://api.apimart.ai/v1/images/generations","href":"/ru/api-reference/images/wan2.7-image/generation"}]},{"group":"Midjourney","icon":"image","pages":[{"title":"API Midjourney","href":"/ru/api-reference/images/midjourney/generation"},{"title":"Imagine (текст в изображение)","api":"POST https://api.apimart.ai/v1/midjourney/generations","href":"/ru/api-reference/images/midjourney/imagine"},{"title":"Blend (смешивание изображений)","api":"POST https://api.apimart.ai/v1/midjourney/generations/blend","href":"/ru/api-reference/images/midjourney/blend"},{"title":"Describe (изображение в текст)","api":"POST https://api.apimart.ai/v1/midjourney/generations/describe","href":"/ru/api-reference/images/midjourney/describe"},{"title":"Edits (редактирование изображения)","api":"POST https://api.apimart.ai/v1/midjourney/generations/edits","href":"/ru/api-reference/images/midjourney/edits"},{"title":"Upscale (увеличить плитку)","api":"POST https://api.apimart.ai/v1/midjourney/generations/upscale","href":"/ru/api-reference/images/midjourney/upscale"},{"title":"Variation (вариация)","api":"POST https://api.apimart.ai/v1/midjourney/generations/variation","href":"/ru/api-reference/images/midjourney/variation"},{"title":"High Variation (сильная вариация)","api":"POST https://api.apimart.ai/v1/midjourney/generations/high-variation","href":"/ru/api-reference/images/midjourney/high-variation"},{"title":"Low Variation (слабая вариация)","api":"POST https://api.apimart.ai/v1/midjourney/generations/low-variation","href":"/ru/api-reference/images/midjourney/low-variation"},{"title":"Reroll (перегенерация)","api":"POST https://api.apimart.ai/v1/midjourney/generations/reroll","href":"/ru/api-reference/images/midjourney/reroll"},{"title":"Zoom (zoom out / расширение)","api":"POST https://api.apimart.ai/v1/midjourney/generations/zoom","href":"/ru/api-reference/images/midjourney/zoom"},{"title":"Pan (расширение со сдвигом)","api":"POST https://api.apimart.ai/v1/midjourney/generations/pan","href":"/ru/api-reference/images/midjourney/pan"},{"title":"Inpaint (Vary Region)","api":"POST https://api.apimart.ai/v1/midjourney/generations/inpaint","href":"/ru/api-reference/images/midjourney/inpaint"},{"title":"Modal (отправить параметры)","api":"POST https://api.apimart.ai/v1/midjourney/generations/modal","href":"/ru/api-reference/images/midjourney/modal"},{"title":"Video (изображение в видео)","api":"POST https://api.apimart.ai/v1/midjourney/generations/video","href":"/ru/api-reference/images/midjourney/video"},{"title":"Remix (reshape, только v8.1 / v8.2)","api":"POST https://api.apimart.ai/v1/midjourney/generations/remix-strong","href":"/ru/api-reference/images/midjourney/remix"},{"title":"Запрос задачи","api":"GET https://api.apimart.ai/v1/midjourney/{task_id}","href":"/ru/api-reference/images/midjourney/query"},{"title":"Лучшие практики","href":"/ru/api-reference/images/midjourney/best-practices"},{"title":"Полные примеры рабочих процессов","href":"/ru/api-reference/images/midjourney/workflow"}]}]},{"group":"Видеосерия","icon":"video","pages":[{"group":"seedance-1-0-pro","icon":"video","pages":[{"title":"seedance-1-0-pro — генерация видео","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/doubao/generation"}]},{"group":"seedance-1-5-pro","icon":"video","pages":[{"title":"seedance-1-5-pro — генерация видео","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/seedance-1-5-pro/generation"}]},{"group":"seedance-2-0","icon":"video","pages":[{"title":"seedance-2.0 — генерация видео","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/seedance-2-0/generation"},{"title":"Ассеты виртуальных аватаров","api":"POST https://api.apimart.ai/v1/seedance2/private-avatar","href":"/ru/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":"/ru/api-reference/videos/seedance-2-5/generation"}]},{"group":"VEO3","icon":"video","pages":[{"title":"VEO3 — генерация видео","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/veo3/generation"},{"title":"VEO3 — продление видео","api":"POST https://api.apimart.ai/v1/videos/{task_id}/remix","href":"/ru/api-reference/videos/veo3/remix"},{"title":"VEO3 — генерация видео через официальный канал","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/veo3/generation-official"}]},{"group":"MiniMax-Hailuo-02","icon":"video","pages":[{"title":"MiniMax-Hailuo-02 — генерация видео","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/minimax-hailuo/generation"}]},{"group":"MiniMax-Hailuo-2.3","icon":"video","pages":[{"title":"Генерация видео MiniMax-Hailuo-2.3","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/minimax-hailuo-2.3/generation"}]},{"group":"MiniMax-H3","icon":"video","pages":[{"title":"Генерация видео MiniMax-H3","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/minimax-h3/generation"},{"title":"Генерация видео MiniMax-H3-Max","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/minimax-h3/max"},{"title":"MiniMax-H3 Context-IR улучшение промпта","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/minimax-h3/context-ir"},{"title":"MiniMax-H3 Regeneration","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/minimax-h3/regeneration"}]},{"group":"FLUX 3 Video","icon":"video","pages":[{"title":"Генерация видео FLUX 3","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/flux-3-video/generation"}]},{"group":"SkyReels V4","icon":"video","pages":[{"title":"Генерация видео SkyReels V4","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/skyreels-v4/generation"}]},{"group":"HappyHorse","icon":"video","pages":[{"title":"Генерация видео HappyHorse 1.0","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/happyhorse-1.0/generation"},{"title":"Генерация видео HappyHorse 1.1","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/happyhorse-1.1/generation"}]},{"group":"Wan3.0","icon":"video","pages":[{"title":"Генерация видео Wan3.0","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/wan3.0-video/generation"}]},{"group":"Wan2.7","icon":"video","pages":[{"title":"Генерация видео Wan2.7","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/wan2.7/generation"},{"title":"Wan2.7-R2V — генерация видео по референсу","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/wan2.7-r2v/generation"},{"title":"Wan2.7-VideoEdit — редактирование видео","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/wan2.7-videoedit/generation"}]},{"group":"Wan2.6","icon":"video","pages":[{"title":"Генерация видео Wan2.6","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/wan2.6/generation"},{"title":"wan2.6-i2v-flash — Image-to-Video","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/wan2.6/i2v-flash-generation"}]},{"group":"Wan2.5","icon":"video","pages":[{"title":"Генерация видео wan2.5-preview","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/wan2.5/generation"}]},{"group":"Kling 2.6","icon":"video","pages":[{"title":"Генерация видео Kling 2.6","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/kling-v2-6/generation"},{"title":"Генерация видео Kling v2.6 с управлением движением","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/kling-v2-6/kling-v2-6-motion-control-generation"}]},{"group":"Kling v3","icon":"video","pages":[{"title":"Генерация видео Kling v3","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/kling-v3/generation"}]},{"group":"Kling 3.0 Turbo","icon":"video","pages":[{"title":"Kling 3.0 Turbo — генерация видео","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/kling-3.0-turbo/generation"}]},{"group":"Kling v3 Omni","icon":"video","pages":[{"title":"Генерация видео Kling v3 Omni","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/kling-v3-omni/generation"}]},{"group":"Kling V4","icon":"video","pages":[{"title":"Kling V4 Генерация видео","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/kling-v4/generation"}]},{"group":"Kling Video O1","icon":"video","pages":[{"title":"Генерация видео Kling Video O1","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/kling-video-o1/generation"}]},{"group":"Vidu Q3(pro/turbo)","icon":"video","pages":[{"title":"Генерация видео Vidu Q3 (pro/turbo)","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/vidu-q3-pro/generation"}]},{"group":"Vidu Q4 Preview","icon":"video","pages":[{"title":"Vidu Q4 Preview Генерация видео","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/vidu-q4-preview/generation"}]},{"group":"Vidu Q3(mix/standard)","icon":"video","pages":[{"title":"Vidu Q3 (mix/standard) — генерация видео по референсам","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/vidu-q3/generation"}]},{"group":"Grok Imagine","icon":"video","pages":[{"title":"Генерация видео Grok Imagine 1.5","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/grok-imagine/generation"},{"title":"Официальные видеомодели Grok","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/grok-imagine/official"}]},{"group":"Pixverse v6","icon":"video","pages":[{"title":"Pixverse v6 Генерация видео","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/pixverse-v6/generation"}]},{"group":"PixVerse V6 Max","icon":"video","pages":[{"title":"PixVerse V6 Max Генерация видео","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/pixverse-v6-max/generation"}]},{"group":"Muse Video Ext","icon":"video","pages":[{"title":"Генерация видео Muse Video Ext","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/muse-video-ext/generation"}]},{"group":"gemini-omni-1.1-flash-ext","icon":"video","pages":[{"title":"Генерация видео gemini-omni-1.1-flash-ext","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/omni-flash-ext/generation"}]},{"group":"Gemini Omni 1.1 Flash","icon":"video","pages":[{"title":"Генерация видео Gemini Omni 1.1 Flash","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/gemini-omni-1.1-flash/generation"}]},{"group":"Gemini Omni Flash","icon":"video","pages":[{"title":"Генерация видео Gemini Omni Flash","api":"POST https://api.apimart.ai/v1/videos/generations","href":"/ru/api-reference/videos/gemini-omni-flash-preview/generation"}]}]},{"group":"Аудиосерия","icon":"microphone","pages":[{"title":"Whisper-1 — транскрибация аудио","api":"POST https://api.apimart.ai/v1/audio/transcriptions","href":"/ru/api-reference/audios/whisper-1"},{"title":"TTS — синтез речи (Text-to-Speech)","api":"POST https://api.apimart.ai/v1/audio/speech","href":"/ru/api-reference/audios/tts"},{"group":"Flow Music","icon":"music","pages":[{"title":"Генерация музыки","api":"POST https://api.apimart.ai/v1/music/generations","href":"/ru/api-reference/audios/flow-music/music"},{"title":"Генерация музыки с Lyria 3.5","api":"POST https://api.apimart.ai/v1/music/generations","href":"/ru/api-reference/audios/flow-music/music-lyria-3-5"},{"title":"Генерация текста песни","api":"POST https://api.apimart.ai/v1/music/generations/lyricsFlowMusic","href":"/ru/api-reference/audios/flow-music/lyrics"},{"title":"Продление музыки","api":"POST https://api.apimart.ai/v1/music/generations/extendFlowMusic","href":"/ru/api-reference/audios/flow-music/extend"},{"title":"Продление музыки с Lyria 3.5","api":"POST https://api.apimart.ai/v1/music/generations/extendFlowMusic","href":"/ru/api-reference/audios/flow-music/extend-lyria-3-5"},{"title":"Замена фрагмента","api":"POST https://api.apimart.ai/v1/music/generations/replaceFlowMusic","href":"/ru/api-reference/audios/flow-music/replace"},{"title":"Замена фрагмента с Lyria 3.5","api":"POST https://api.apimart.ai/v1/music/generations/replaceFlowMusic","href":"/ru/api-reference/audios/flow-music/replace-lyria-3-5"},{"title":"Cover-аранжировка","api":"POST https://api.apimart.ai/v1/music/generations/coverFlowMusic","href":"/ru/api-reference/audios/flow-music/cover"},{"title":"Cover-аранжировка Lyria 3.5","api":"POST https://api.apimart.ai/v1/music/generations/coverFlowMusic","href":"/ru/api-reference/audios/flow-music/cover-lyria-3-5"},{"title":"Разделение на дорожки","api":"POST https://api.apimart.ai/v1/music/generations/stemsFlowMusic","href":"/ru/api-reference/audios/flow-music/stems"},{"title":"Загрузка аудио","api":"POST https://api.apimart.ai/v1/music/generations/uploadAudioFlowMusic","href":"/ru/api-reference/audios/flow-music/upload-audio"},{"title":"Скачивание аудио","api":"POST https://api.apimart.ai/v1/music/generations/downloadAudioFlowMusic","href":"/ru/api-reference/audios/flow-music/download-audio"},{"title":"Рендеринг музыкального видео","api":"POST https://api.apimart.ai/v1/music/generations/videoClipFlowMusic","href":"/ru/api-reference/audios/flow-music/video-clip"},{"title":"Запрос задачи","api":"GET https://api.apimart.ai/v1/music/tasks/{task_id}","href":"/ru/api-reference/audios/flow-music/query"}]},{"group":"Suno","icon":"music","pages":[{"title":"Общие правила Suno V6 и получение задач","api":"GET https://api.apimart.ai/v1/music/tasks/{task_id}","href":"/ru/api-reference/audios/suno/overview"},{"title":"Сгенерировать музыку","api":"POST https://api.apimart.ai/v1/music/generations","href":"/ru/api-reference/audios/suno/generation"},{"title":"Сгенерировать текст песни","api":"POST https://api.apimart.ai/v1/music/generations/lyrics","href":"/ru/api-reference/audios/suno/lyrics"},{"title":"Генерация по вдохновению (inspo)","api":"POST https://api.apimart.ai/v1/music/generations/inspo","href":"/ru/api-reference/audios/suno/inspo"},{"title":"Генерация звуковых эффектов","api":"POST https://api.apimart.ai/v1/music/generations/sounds","href":"/ru/api-reference/audios/suno/sounds"},{"title":"Улучшение тегов","api":"POST https://api.apimart.ai/v1/music/generations/upsampleTags","href":"/ru/api-reference/audios/suno/upsample-tags"},{"title":"Загрузка аудио","api":"POST https://api.apimart.ai/v1/music/generations/uploadTask","href":"/ru/api-reference/audios/suno/upload"},{"title":"Загрузка аудио и создание кавера","api":"POST https://api.apimart.ai/v1/music/generations/uploadCover","href":"/ru/api-reference/audios/suno/upload-cover"},{"title":"Загрузка и продолжение аудио","api":"POST https://api.apimart.ai/v1/music/generations/uploadExtend","href":"/ru/api-reference/audios/suno/upload-extend"},{"title":"Создание пользовательской модели","api":"POST https://api.apimart.ai/v1/music/generations/createModel","href":"/ru/api-reference/audios/suno/create-model"},{"title":"Продолжение и продление","api":"POST https://api.apimart.ai/v1/music/generations/extend","href":"/ru/api-reference/audios/suno/extend"},{"title":"Перепевка в другом стиле","api":"POST https://api.apimart.ai/v1/music/generations/coverSong","href":"/ru/api-reference/audios/suno/cover-song"},{"title":"Мастеринг","api":"POST https://api.apimart.ai/v1/music/generations/remaster","href":"/ru/api-reference/audios/suno/remaster"},{"title":"Извлечение дорожки","api":"POST https://api.apimart.ai/v1/music/generations/stems","href":"/ru/api-reference/audios/suno/stems"},{"title":"Полное разделение на дорожки","api":"POST https://api.apimart.ai/v1/music/generations/stemsAll","href":"/ru/api-reference/audios/suno/stems-all"},{"title":"Добавить вокал","api":"POST https://api.apimart.ai/v1/music/generations/addVocals","href":"/ru/api-reference/audios/suno/add-vocals"},{"title":"Добавить аккомпанемент","api":"POST https://api.apimart.ai/v1/music/generations/addInstrumental","href":"/ru/api-reference/audios/suno/add-instrumental"},{"title":"Добавить дорожку (add stem)","api":"POST https://api.apimart.ai/v1/music/generations/addStem","href":"/ru/api-reference/audios/suno/add-stem"},{"title":"Извлечение Vox (устарело)","api":"POST https://api.apimart.ai/v1/music/generations/vox","href":"/ru/api-reference/audios/suno/vox"},{"title":"Создание голоса","api":"POST https://api.apimart.ai/v1/music/generations/createVoice","href":"/ru/api-reference/audios/suno/create-voice"},{"title":"Persona","api":"POST https://api.apimart.ai/v1/music/generations/persona","href":"/ru/api-reference/audios/suno/persona"},{"title":"Замена фрагмента","api":"POST https://api.apimart.ai/v1/music/generations/replaceMusic","href":"/ru/api-reference/audios/suno/replace-music"},{"title":"Удалить фрагмент","api":"POST https://api.apimart.ai/v1/music/generations/removeSection","href":"/ru/api-reference/audios/suno/remove-section"},{"title":"Обрезка аудио","api":"POST https://api.apimart.ai/v1/music/generations/crop","href":"/ru/api-reference/audios/suno/crop"},{"title":"Нарастание","api":"POST https://api.apimart.ai/v1/music/generations/fadeIn","href":"/ru/api-reference/audios/suno/fade-in"},{"title":"Затухание","api":"POST https://api.apimart.ai/v1/music/generations/fadeOut","href":"/ru/api-reference/audios/suno/fade-out"},{"title":"Регулировка скорости","api":"POST https://api.apimart.ai/v1/music/generations/adjustSpeed","href":"/ru/api-reference/audios/suno/adjust-speed"},{"title":"Синтез / склейка полной песни","api":"POST https://api.apimart.ai/v1/music/generations/concat","href":"/ru/api-reference/audios/suno/concat"},{"title":"Создать мэшап (mashup)","api":"POST https://api.apimart.ai/v1/music/generations/mashup","href":"/ru/api-reference/audios/suno/mashup"},{"title":"Образец в песню (sample)","api":"POST https://api.apimart.ai/v1/music/generations/sample","href":"/ru/api-reference/audios/suno/sample"},{"title":"Создать MIDI","api":"POST https://api.apimart.ai/v1/music/generations/midi","href":"/ru/api-reference/audios/suno/midi"},{"title":"Временная шкала текста песни","api":"POST https://api.apimart.ai/v1/music/generations/alignedLyrics","href":"/ru/api-reference/audios/suno/aligned-lyrics"},{"title":"Анализ BPM","api":"POST https://api.apimart.ai/v1/music/generations/bpm","href":"/ru/api-reference/audios/suno/bpm"},{"title":"Создать музыкальное видео (MV)","api":"POST https://api.apimart.ai/v1/music/generations/generateMp4","href":"/ru/api-reference/audios/suno/generate-mp4"},{"title":"Скачивание аудиофайлов","api":"POST https://api.apimart.ai/v1/music/generations/download","href":"/ru/api-reference/audios/suno/wav"}]}]},{"group":"Серия модерации","icon":"shield-check","pages":[{"group":"omni-moderation-latest","icon":"shield-check","pages":[{"title":"omni-moderation-latest Модерация контента","api":"POST https://api.apimart.ai/v1/moderations","href":"/ru/api-reference/moderations/omni-moderation-latest/generation"}]}]},{"group":"Управление загрузками","icon":"cloud-arrow-up","pages":[{"title":"Загрузка изображения","api":"POST https://api.apimart.ai/v1/uploads/images","href":"/ru/api-reference/uploads/images"}]},{"group":"Управление задачами","icon":"list-check","pages":[{"title":"Получение статуса задачи","api":"GET https://api.apimart.ai/v1/tasks/{task_id}","href":"/ru/api-reference/tasks/status"},{"title":"Обратный вызов о завершении задачи (Webhook)","href":"/ru/api-reference/tasks/webhook"}]},{"group":"Управление аккаунтом","icon":"wallet","pages":[{"title":"Запрос баланса токена","api":"GET https://api.apimart.ai/v1/balance","href":"/ru/api-reference/account/token-balance"},{"title":"Запрос баланса пользователя","description":" - Запрос общих оставшихся и использованных кредитов аккаунта пользователя\n- Получение информации о балансе на уровне пользователя\n- Поддержка CORS для кросс-доменных запросов\n- Мониторинг баланса в реальном времени ","api":"GET https://api.apimart.ai/v1/user/balance","href":"/ru/api-reference/account/user-balance"},{"title":"Запрос расходов и использования","api":"GET https://api.apimart.ai/v1/usage","href":"/ru/api-reference/account/usage"}]}]},{"tab":"Интеграции","pages":[{"title":"Интеграции","href":"/ru/integrations/chat/chatbox"}]},{"tab":"Руководства","pages":[{"title":"Руководства","href":"/ru/quickstart"}]},{"tab":"Часто задаваемые вопросы","pages":[{"title":"Часто задаваемые вопросы","href":"/ru/faqs"}]}]},{"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"}]}]},"basePath":"","title":"Запрос расходов и использования - APIMart","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-CS552b7R.js","utils-DDTCYAF2.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-De8ttokP.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-DrwRDvAh.js","snippetPresets-DtAN0nWx.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-D5rWArI6.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-O2i12wsz.js","shallow-DV8xABTt.js","getApiPlaygroundDisplay-DBZ0B5Jx.js","CodeSnippet-BVi0tPUX.js","CodeSnippets-CqASbIwY.js","Page-m07pfKpT.js","getPastedJson-DG9vsMS8.js","icon-CXzRSCr8.js","MethodPill-BdKVtEuX.js","DuplicateIcon-CZlmBrJI.js","createIcon-biFEUKPL.js","DynamicMarkdown-B54_zNBF.js","SectionHeading-DwwHK3Pt.js","axios-vUo_bRtp.js"]}