Ingest AI usage transactions for cost tracking. Costs are calculated automatically based on the provider’s pricing. Supports both single transaction and bulk submissions. Use this endpoint after each AI provider call to track cost.
Only billable_customer_id is required in the context object. You can add any additional fields. They will be stored and available for filtering in your dashboard.
AI provider. Fenra automatically applies the correct pricing for each provider. Use 'custom' for providers not yet supported, combined with custom pricing configuration in your dashboard.
Only billable_customer_id is required. Add any additional fields (environment, feature, user_id, team, etc.) and they will appear in your dashboard for filtering, alerts, and reports.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Fenra","colors":{"primary":"#654EDA","light":"#5542B9","dark":"#654EDA"},"logo":{"light":"https://mintcdn.com/fenra/VOqg4VznN6ND94vF/logo/light.svg?fit=max\u0026auto=format\u0026n=VOqg4VznN6ND94vF\u0026q=85\u0026s=293c5d6b460336cf446e149b545b81e8","dark":"https://mintcdn.com/fenra/VOqg4VznN6ND94vF/logo/dark.svg?fit=max\u0026auto=format\u0026n=VOqg4VznN6ND94vF\u0026q=85\u0026s=8312697fb9d3c479a6d3c4eb04d7b913"},"favicon":"/favicon.svg","appearance":{"default":"light","strict":true},"navbar":{"links":[{"label":"Support","href":"mailto:ajdin@fenra.io"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.fenra.io"}},"footer":{"socials":{"x":"https://x.com/fenra_io","github":"https://github.com/fenra-io","linkedin":"https://linkedin.com/company/fenra-io"}},"contextual":{"options":["copy","view","chatgpt","claude","cursor"]},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/fenra-io"},{"anchor":"Support","icon":"envelope","href":"mailto:ajdin@fenra.io"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"fenra","hasAudioNarration":false,"actualSubdomain":"fenra","customDomains":["docs.fenra.io"],"gitSource":{"type":"github","owner":"fenra-io","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae945acd388ef32a6c3ff46:success","clientVersion":"0.0.4102","searchFilterCounts":[{"language":"default","tag":"Documentation","count":19},{"language":"default","tag":"Integrations","count":7},{"language":"default","tag":"Platform","count":6},{"language":"default","tag":"API Reference","count":4},{"language":"default","tag":"Guides","count":4},{"language":"default","tag":"Overview","count":3},{"language":"default","tag":"Get Started","count":2},{"language":"default","tag":"Cost Explorer","count":2},{"language":"default","tag":"Endpoints","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"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":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/endpoint/create","slug":"/api-reference/endpoint/create","pageMetadata":{"title":"POST /usage/transactions","openapi":"POST /usage/transactions","description":"Ingest AI usage transactions for cost tracking. Costs are calculated automatically based on the provider's pricing. Supports both single transaction and bulk submissions. Use this endpoint after each AI provider call to track cost.","href":"/api-reference/endpoint/create"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Ingest AI usage transactions for cost tracking. Costs are calculated automatically based on the provider’s pricing. Supports both single transaction and bulk submissions. Use this endpoint after each AI provider call to track cost.\"\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`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Send AI usage transactions for cost tracking.`}),`\n`,_jsx(Heading,{level:`2`,id:`request-formats`,children:`Request Formats`}),`\n`,_jsx(Heading,{level:`3`,id:`single-transaction`,children:`Single Transaction`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,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:`15`,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:` \"provider\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_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-4o\"`}),_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:` \"usage\"`}),_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:`\"tokens\"`}),_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:` \"metrics\"`}),_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:` \"input_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`100`}),_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:` \"output_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`50`}),_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_tokens\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`150`})]}),`\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:` \"context\"`}),_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:` \"billable_customer_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"my-company\"`})]}),`\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:`3`,id:`bulk-request`,children:`Bulk Request`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"transactions\"`}),_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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"provider\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openai\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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-4o\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},children:`...`}),_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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"provider\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"anthropic\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},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:`\"claude-3-5-sonnet\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},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`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`context`,children:`Context`}),`\n`,_jsxs(_components.p,{children:[`Only `,_jsx(_components.code,{children:`billable_customer_id`}),` is required in the `,_jsx(_components.code,{children:`context`}),` object. You can add any additional fields. They will be stored and available for filtering in your dashboard.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"context\"`}),_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:` \"billable_customer_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"acme-corp\"`})]}),`\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:`response-codes`,children:`Response Codes`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`202 Accepted`})}),_jsx(_components.td,{children:`All transactions queued`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`207 Multi-Status`})}),_jsx(_components.td,{children:`Some succeeded, some failed`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`400 Bad Request`})}),_jsx(_components.td,{children:`Validation error`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`401 Unauthorized`})}),_jsx(_components.td,{children:`Invalid API key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`500 Internal Error`})}),_jsx(_components.td,{children:`Server error`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsx(Heading,{level:`3`,id:`basic-request`,children:`Basic Request`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`18`,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:`18`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://ingest.fenra.io/usage/transactions'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'X-Api-Key: YOUR_API_KEY'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"provider\": \"openai\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"gpt-4o\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"usage\": [{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"type\": \"tokens\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"metrics\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"input_tokens\": 100,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"output_tokens\": 50,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"total_tokens\": 150`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"context\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"billable_customer_id\": \"my-company\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Response:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,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:`9`,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:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"queued\"`}),_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:` \"events_queued\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_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:`\"1 transaction(s) queued for processing\"`}),_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:` \"results\"`}),_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:` \"transaction_index\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_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_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"abc123-def456-ghi789\"`})]}),`\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:`error-responses`,children:`Error Responses`}),`\n`,_jsx(Heading,{level:`3`,id:`validation-error-400`,children:`Validation Error (400)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,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:`13`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\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:`\"validation_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:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Request validation failed\"`}),_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:` \"details\"`}),_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:` \"field\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"context.billable_customer_id\"`}),_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:`\"required\"`}),_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:`\"billable_customer_id is required\"`})]}),`\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`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`unauthorized-401`,children:`Unauthorized (401)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"unauthorized\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Invalid or missing API key\"`})]}),`\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:`3`,id:`partial-success-207`,children:`Partial Success (207)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,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:`17`,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:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"partial_success\"`}),_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:` \"events_queued\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_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:` \"events_failed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_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:`\"1 transaction(s) queued, 1 transaction(s) failed\"`}),_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:` \"results\"`}),_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:` \"transaction_index\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_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_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"abc123\"`})]}),`\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:` \"transaction_index\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_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_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Validation failed\"`})]}),`\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`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`see-also`,children:`See Also`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/guides/transactions`,children:`Transactions Guide`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/api-reference/errors`,children:`Error Reference`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/api-reference/authentication`,children:`Authentication`})}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"POST /usage/transactions","openapi":"POST /usage/transactions","description":"Ingest AI usage transactions for cost tracking. Costs are calculated automatically based on the provider's pricing. Supports both single transaction and bulk submissions. Use this endpoint after each AI provider call to track cost.","href":"/api-reference/endpoint/create"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Request Formats","slug":"request-formats","depth":2,"children":[{"title":"Single Transaction","slug":"single-transaction","depth":3,"children":[]},{"title":"Bulk Request","slug":"bulk-request","depth":3,"children":[]}]},{"title":"Context","slug":"context","depth":2,"children":[]},{"title":"Response Codes","slug":"response-codes","depth":2,"children":[]},{"title":"Examples","slug":"examples","depth":2,"children":[{"title":"Basic Request","slug":"basic-request","depth":3,"children":[]}]},{"title":"Error Responses","slug":"error-responses","depth":2,"children":[{"title":"Validation Error (400)","slug":"validation-error-400","depth":3,"children":[]},{"title":"Unauthorized (401)","slug":"unauthorized-401","depth":3,"children":[]},{"title":"Partial Success (207)","slug":"partial-success-207","depth":3,"children":[]}]},{"title":"See Also","slug":"see-also","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"ingestUsage","summary":"Send AI usage data","description":"Ingest AI usage transactions for cost tracking. Costs are calculated automatically based on the provider's pricing. Supports both single transaction and bulk submissions. Use this endpoint after each AI provider call to track cost.","tags":["Usage"],"requestBody":"ba5e75a0-9f65-4eea-9d31-33b8a17a4935","responses":{"202":"17168cb3-172b-491d-834f-9dddfd424d4e","207":"47eb53c2-4e55-4397-a1b6-f5c438e6ccbd","400":"36da1897-6adb-4f8c-ad01-ef69b4e1a6d0","401":"1b27da1b-3e4e-4f53-9b2d-861bb327a7a7","500":"a9e7177b-60d3-48a0-a346-047b015637f2"},"method":"post","type":"path","servers":["ffa66c8e-4084-4f3d-9b55-2ce04e12f741"],"security":["653bad63-03c0-459c-8e0c-a79de74b5c7a"],"path":"/usage/transactions","baseUrlOptions":["https://ingest.fenra.io"],"title":"Send AI usage data","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"Single Transaction","description":"Either a single transaction or a bulk request containing multiple transactions","required":["provider","model","usage","context"],"properties":{"provider":{"type":"string","enum":["openai","gemini","bedrock","anthropic","xai","deepseek","custom"],"description":"AI provider. Fenra automatically applies the correct pricing for each provider. Use 'custom' for providers not yet supported, combined with custom pricing configuration in your dashboard.","isRequired":true,"uniqueKey":"oneOf.0.provider","typeLabel":"enum\u003cstring>"},"model":{"type":"string","minLength":1,"description":"The model identifier (e.g., 'gpt-4o', 'claude-3-opus', 'gemini-pro')","examples":["gpt-4o","claude-3-opus","gemini-1.5-pro"],"isRequired":true,"uniqueKey":"oneOf.0.model","typeLabel":"string"},"usage":{"type":"array","description":"Array of usage entries. Each usage type may appear at most once per transaction.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Tokens","required":["type","metrics"],"properties":{"type":{"type":"string","const":"tokens","isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.type","typeLabel":"string"},"metrics":{"type":"object","required":["input_tokens","output_tokens","total_tokens"],"properties":{"input_tokens":{"type":"integer","minimum":1,"description":"Number of input/prompt tokens. All providers (OpenAI, Anthropic, Gemini, xAI, Bedrock, DeepSeek)","isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.metrics.input_tokens","typeLabel":"integer"},"output_tokens":{"type":"integer","minimum":1,"description":"Number of output/completion tokens. All providers (OpenAI, Anthropic, Gemini, xAI, Bedrock, DeepSeek)","isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.metrics.output_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","minimum":1,"description":"Total tokens (input + output). All providers (OpenAI, Anthropic, Gemini, xAI, Bedrock, DeepSeek)","isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.metrics.total_tokens","typeLabel":"integer"},"cached_tokens":{"type":"integer","minimum":0,"description":"Number of cached tokens. OpenAI (prompt_tokens_details.cached_tokens), Gemini (cachedContentTokenCount), xAI (cached_tokens)","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.metrics.cached_tokens","typeLabel":"integer"},"cache_read_input_tokens":{"type":"integer","minimum":0,"description":"Number of tokens read from cache. Anthropic (cache_read_input_tokens)","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.metrics.cache_read_input_tokens","typeLabel":"integer"},"cache_creation_input_tokens":{"type":"integer","minimum":0,"description":"Number of tokens used to create cache. Anthropic (cache_creation_input_tokens)","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.metrics.cache_creation_input_tokens","typeLabel":"integer"},"reasoning_tokens":{"type":"integer","minimum":0,"description":"Number of reasoning tokens. OpenAI o1/o3/o4 models (completion_tokens_details.reasoning_tokens), xAI Grok-3/4 (reasoning_tokens)","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.metrics.reasoning_tokens","typeLabel":"integer"},"thinking_tokens":{"type":"integer","minimum":0,"description":"Number of thinking tokens. Anthropic extended thinking (thinking_tokens), Gemini (thoughts_token_count)","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.metrics.thinking_tokens","typeLabel":"integer"},"prompt_tokens":{"type":"integer","minimum":0,"description":"Alias for input_tokens. OpenAI legacy (prompt_tokens)","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.metrics.prompt_tokens","typeLabel":"integer"},"completion_tokens":{"type":"integer","minimum":0,"description":"Alias for output_tokens. OpenAI legacy (completion_tokens)","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.metrics.completion_tokens","typeLabel":"integer"},"prompt_text_tokens":{"type":"integer","minimum":0,"description":"Number of text tokens in prompt. OpenAI multimodal (input_tokens_details.text_tokens)","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.metrics.prompt_text_tokens","typeLabel":"integer"},"text_tokens":{"type":"integer","minimum":0,"description":"Number of text tokens. OpenAI, xAI multimodal (prompt_tokens_details.text_tokens)","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.metrics.text_tokens","typeLabel":"integer"},"audio_tokens":{"type":"integer","minimum":0,"description":"Number of audio tokens. OpenAI, xAI realtime/audio (prompt_tokens_details.audio_tokens)","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.metrics.audio_tokens","typeLabel":"integer"},"image_tokens":{"type":"integer","minimum":0,"description":"Number of image tokens. OpenAI, xAI vision (prompt_tokens_details.image_tokens)","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.metrics.image_tokens","typeLabel":"integer"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0.metrics","typeLabel":"object"}},"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.0","typeLabel":"Tokens · object"},{"type":"object","title":"Images","required":["type","metrics"],"properties":{"type":{"type":"string","const":"images","isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.1.type","typeLabel":"string"},"metrics":{"type":"object","required":["generated"],"properties":{"generated":{"type":"integer","minimum":0,"description":"Number of images generated. All providers (OpenAI DALL-E, GPT Image, Gemini Imagen, xAI Grok-2 Image)","isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.1.metrics.generated","typeLabel":"integer"},"size_px":{"type":"integer","minimum":0,"description":"Image size in pixels (width or height for square images). OpenAI DALL-E, Gemini Imagen (1024 = 1024x1024)","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.1.metrics.size_px","typeLabel":"integer"},"quality":{"type":"string","enum":["low","medium","high","standard","hd"],"description":"Image quality tier. OpenAI GPT Image 1/1.5 (low/medium/high), DALL-E (standard/hd)","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.1.metrics.quality","typeLabel":"enum\u003cstring>"},"width_px":{"type":"integer","minimum":1,"description":"Explicit width for non-square images. OpenAI, Gemini","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.1.metrics.width_px","typeLabel":"integer"},"height_px":{"type":"integer","minimum":1,"description":"Explicit height for non-square images. OpenAI, Gemini","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.1.metrics.height_px","typeLabel":"integer"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.1.metrics","typeLabel":"object"}},"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.1","typeLabel":"Images · object"},{"type":"object","title":"Audio","required":["type","metrics"],"properties":{"type":{"type":"string","const":"audio_seconds","isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.2.type","typeLabel":"string"},"metrics":{"type":"object","properties":{"input_seconds":{"type":"number","minimum":0,"description":"Duration of audio input in seconds. OpenAI Whisper transcription, xAI voice","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.2.metrics.input_seconds","typeLabel":"number"},"output_seconds":{"type":"number","minimum":0,"description":"Duration of audio output in seconds. OpenAI TTS, Gemini TTS","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.2.metrics.output_seconds","typeLabel":"number"},"total_seconds":{"type":"number","minimum":0,"description":"Total audio duration in seconds. All audio providers","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.2.metrics.total_seconds","typeLabel":"number"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.2.metrics","typeLabel":"object"}},"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.2","typeLabel":"Audio · object"},{"type":"object","title":"Video","required":["type","metrics"],"properties":{"type":{"type":"string","const":"video_seconds","isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.3.type","typeLabel":"string"},"metrics":{"type":"object","required":["processed_seconds"],"properties":{"processed_seconds":{"type":"number","minimum":0,"description":"Duration of video generated/processed in seconds. OpenAI Sora, Gemini Veo","isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.3.metrics.processed_seconds","typeLabel":"number"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.3.metrics","typeLabel":"object"}},"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.3","typeLabel":"Video · object"},{"type":"object","title":"Requests","required":["type","metrics"],"properties":{"type":{"type":"string","const":"requests","isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.4.type","typeLabel":"string"},"metrics":{"type":"object","required":["count"],"properties":{"count":{"type":"integer","minimum":0,"description":"Number of tool invocations. All providers","isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.4.metrics.count","typeLabel":"integer"},"request_type":{"type":"string","enum":["web_search","code_execution","file_search","x_search","live_search","google_grounding","maps_grounding","document_search","collections_search"],"description":"Type of tool invocation. Anthropic (web_search, code_execution), xAI (web_search, x_search, code_execution, document_search, collections_search), Gemini (google_grounding, maps_grounding, file_search)","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.4.metrics.request_type","typeLabel":"enum\u003cstring>"},"sources_used":{"type":"integer","minimum":0,"description":"Number of sources used. xAI Live Search (billed separately)","uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.4.metrics.sources_used","typeLabel":"integer"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.4.metrics","typeLabel":"object"}},"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.4","typeLabel":"Requests · object"},{"type":"object","title":"Custom","required":["type","metrics"],"properties":{"type":{"type":"string","const":"custom","isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.5.type","typeLabel":"string"},"metrics":{"type":"object","required":["units"],"properties":{"units":{"type":"number","minimum":0,"description":"Number of custom units consumed","isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.5.metrics.units","typeLabel":"number"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.5.metrics","typeLabel":"object"}},"uniqueKey":"oneOf.0.usage.items.[INDEX].oneOf.5","typeLabel":"Custom · object"}],"uniqueKey":"oneOf.0.usage.items.[INDEX]","typeLabel":"Tokens · object | Images · object | Audio · object | Video · object | Requests · object | Custom · object"},"isRequired":true,"uniqueKey":"oneOf.0.usage","typeLabel":"(Tokens · object | Images · object | Audio · object | Video · object | Requests · object | Custom · object)[]"},"context":{"type":"object","required":["billable_customer_id"],"properties":{"billable_customer_id":{"type":"string","minLength":1,"description":"Your internal identifier for grouping and billing. This is the primary dimension for cost attribution in your Fenra dashboard.","isRequired":true,"uniqueKey":"oneOf.0.context.billable_customer_id","typeLabel":"string"}},"additionalProperties":true,"description":"Only billable_customer_id is required. Add any additional fields (environment, feature, user_id, team, etc.) and they will appear in your dashboard for filtering, alerts, and reports.","isRequired":true,"uniqueKey":"oneOf.0.context","typeLabel":"object"},"model_tier":{"type":"string","description":"Optional model tier classification for custom pricing tiers","uniqueKey":"oneOf.0.model_tier","typeLabel":"string"},"provider_usage_raw":{"type":"object","description":"Optional raw usage data from the provider for debugging or auditing","additionalProperties":true,"uniqueKey":"oneOf.0.provider_usage_raw","typeLabel":"object"}},"uniqueKey":"oneOf.0","typeLabel":"Single Transaction · object"},{"type":"object","title":"Bulk Request","description":"Either a single transaction or a bulk request containing multiple transactions","required":["transactions"],"properties":{"transactions":{"type":"array","description":"Array of transactions to process","minItems":1,"items":{"title":"Single Transaction","type":"object","required":["provider","model","usage","context"],"properties":{"provider":{"type":"string","enum":["openai","gemini","bedrock","anthropic","xai","deepseek","custom"],"description":"AI provider. Fenra automatically applies the correct pricing for each provider. Use 'custom' for providers not yet supported, combined with custom pricing configuration in your dashboard.","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].provider","typeLabel":"enum\u003cstring>"},"model":{"type":"string","minLength":1,"description":"The model identifier (e.g., 'gpt-4o', 'claude-3-opus', 'gemini-pro')","examples":["gpt-4o","claude-3-opus","gemini-1.5-pro"],"isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].model","typeLabel":"string"},"usage":{"type":"array","description":"Array of usage entries. Each usage type may appear at most once per transaction.","minItems":1,"items":{"oneOf":[{"type":"object","title":"Tokens","required":["type","metrics"],"properties":{"type":{"type":"string","const":"tokens","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.type","typeLabel":"string"},"metrics":{"type":"object","required":["input_tokens","output_tokens","total_tokens"],"properties":{"input_tokens":{"type":"integer","minimum":1,"description":"Number of input/prompt tokens. All providers (OpenAI, Anthropic, Gemini, xAI, Bedrock, DeepSeek)","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.metrics.input_tokens","typeLabel":"integer"},"output_tokens":{"type":"integer","minimum":1,"description":"Number of output/completion tokens. All providers (OpenAI, Anthropic, Gemini, xAI, Bedrock, DeepSeek)","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.metrics.output_tokens","typeLabel":"integer"},"total_tokens":{"type":"integer","minimum":1,"description":"Total tokens (input + output). All providers (OpenAI, Anthropic, Gemini, xAI, Bedrock, DeepSeek)","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.metrics.total_tokens","typeLabel":"integer"},"cached_tokens":{"type":"integer","minimum":0,"description":"Number of cached tokens. OpenAI (prompt_tokens_details.cached_tokens), Gemini (cachedContentTokenCount), xAI (cached_tokens)","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.metrics.cached_tokens","typeLabel":"integer"},"cache_read_input_tokens":{"type":"integer","minimum":0,"description":"Number of tokens read from cache. Anthropic (cache_read_input_tokens)","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.metrics.cache_read_input_tokens","typeLabel":"integer"},"cache_creation_input_tokens":{"type":"integer","minimum":0,"description":"Number of tokens used to create cache. Anthropic (cache_creation_input_tokens)","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.metrics.cache_creation_input_tokens","typeLabel":"integer"},"reasoning_tokens":{"type":"integer","minimum":0,"description":"Number of reasoning tokens. OpenAI o1/o3/o4 models (completion_tokens_details.reasoning_tokens), xAI Grok-3/4 (reasoning_tokens)","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.metrics.reasoning_tokens","typeLabel":"integer"},"thinking_tokens":{"type":"integer","minimum":0,"description":"Number of thinking tokens. Anthropic extended thinking (thinking_tokens), Gemini (thoughts_token_count)","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.metrics.thinking_tokens","typeLabel":"integer"},"prompt_tokens":{"type":"integer","minimum":0,"description":"Alias for input_tokens. OpenAI legacy (prompt_tokens)","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.metrics.prompt_tokens","typeLabel":"integer"},"completion_tokens":{"type":"integer","minimum":0,"description":"Alias for output_tokens. OpenAI legacy (completion_tokens)","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.metrics.completion_tokens","typeLabel":"integer"},"prompt_text_tokens":{"type":"integer","minimum":0,"description":"Number of text tokens in prompt. OpenAI multimodal (input_tokens_details.text_tokens)","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.metrics.prompt_text_tokens","typeLabel":"integer"},"text_tokens":{"type":"integer","minimum":0,"description":"Number of text tokens. OpenAI, xAI multimodal (prompt_tokens_details.text_tokens)","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.metrics.text_tokens","typeLabel":"integer"},"audio_tokens":{"type":"integer","minimum":0,"description":"Number of audio tokens. OpenAI, xAI realtime/audio (prompt_tokens_details.audio_tokens)","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.metrics.audio_tokens","typeLabel":"integer"},"image_tokens":{"type":"integer","minimum":0,"description":"Number of image tokens. OpenAI, xAI vision (prompt_tokens_details.image_tokens)","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.metrics.image_tokens","typeLabel":"integer"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0.metrics","typeLabel":"object"}},"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.0","typeLabel":"Tokens · object"},{"type":"object","title":"Images","required":["type","metrics"],"properties":{"type":{"type":"string","const":"images","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.1.type","typeLabel":"string"},"metrics":{"type":"object","required":["generated"],"properties":{"generated":{"type":"integer","minimum":0,"description":"Number of images generated. All providers (OpenAI DALL-E, GPT Image, Gemini Imagen, xAI Grok-2 Image)","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.1.metrics.generated","typeLabel":"integer"},"size_px":{"type":"integer","minimum":0,"description":"Image size in pixels (width or height for square images). OpenAI DALL-E, Gemini Imagen (1024 = 1024x1024)","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.1.metrics.size_px","typeLabel":"integer"},"quality":{"type":"string","enum":["low","medium","high","standard","hd"],"description":"Image quality tier. OpenAI GPT Image 1/1.5 (low/medium/high), DALL-E (standard/hd)","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.1.metrics.quality","typeLabel":"enum\u003cstring>"},"width_px":{"type":"integer","minimum":1,"description":"Explicit width for non-square images. OpenAI, Gemini","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.1.metrics.width_px","typeLabel":"integer"},"height_px":{"type":"integer","minimum":1,"description":"Explicit height for non-square images. OpenAI, Gemini","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.1.metrics.height_px","typeLabel":"integer"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.1.metrics","typeLabel":"object"}},"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.1","typeLabel":"Images · object"},{"type":"object","title":"Audio","required":["type","metrics"],"properties":{"type":{"type":"string","const":"audio_seconds","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.2.type","typeLabel":"string"},"metrics":{"type":"object","properties":{"input_seconds":{"type":"number","minimum":0,"description":"Duration of audio input in seconds. OpenAI Whisper transcription, xAI voice","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.2.metrics.input_seconds","typeLabel":"number"},"output_seconds":{"type":"number","minimum":0,"description":"Duration of audio output in seconds. OpenAI TTS, Gemini TTS","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.2.metrics.output_seconds","typeLabel":"number"},"total_seconds":{"type":"number","minimum":0,"description":"Total audio duration in seconds. All audio providers","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.2.metrics.total_seconds","typeLabel":"number"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.2.metrics","typeLabel":"object"}},"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.2","typeLabel":"Audio · object"},{"type":"object","title":"Video","required":["type","metrics"],"properties":{"type":{"type":"string","const":"video_seconds","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.3.type","typeLabel":"string"},"metrics":{"type":"object","required":["processed_seconds"],"properties":{"processed_seconds":{"type":"number","minimum":0,"description":"Duration of video generated/processed in seconds. OpenAI Sora, Gemini Veo","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.3.metrics.processed_seconds","typeLabel":"number"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.3.metrics","typeLabel":"object"}},"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.3","typeLabel":"Video · object"},{"type":"object","title":"Requests","required":["type","metrics"],"properties":{"type":{"type":"string","const":"requests","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.4.type","typeLabel":"string"},"metrics":{"type":"object","required":["count"],"properties":{"count":{"type":"integer","minimum":0,"description":"Number of tool invocations. All providers","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.4.metrics.count","typeLabel":"integer"},"request_type":{"type":"string","enum":["web_search","code_execution","file_search","x_search","live_search","google_grounding","maps_grounding","document_search","collections_search"],"description":"Type of tool invocation. Anthropic (web_search, code_execution), xAI (web_search, x_search, code_execution, document_search, collections_search), Gemini (google_grounding, maps_grounding, file_search)","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.4.metrics.request_type","typeLabel":"enum\u003cstring>"},"sources_used":{"type":"integer","minimum":0,"description":"Number of sources used. xAI Live Search (billed separately)","uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.4.metrics.sources_used","typeLabel":"integer"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.4.metrics","typeLabel":"object"}},"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.4","typeLabel":"Requests · object"},{"type":"object","title":"Custom","required":["type","metrics"],"properties":{"type":{"type":"string","const":"custom","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.5.type","typeLabel":"string"},"metrics":{"type":"object","required":["units"],"properties":{"units":{"type":"number","minimum":0,"description":"Number of custom units consumed","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.5.metrics.units","typeLabel":"number"}},"additionalProperties":true,"isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.5.metrics","typeLabel":"object"}},"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX].oneOf.5","typeLabel":"Custom · object"}],"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage.items.[INDEX]","typeLabel":"Tokens · object | Images · object | Audio · object | Video · object | Requests · object | Custom · object"},"isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].usage","typeLabel":"(Tokens · object | Images · object | Audio · object | Video · object | Requests · object | Custom · object)[]"},"context":{"type":"object","required":["billable_customer_id"],"properties":{"billable_customer_id":{"type":"string","minLength":1,"description":"Your internal identifier for grouping and billing. This is the primary dimension for cost attribution in your Fenra dashboard.","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].context.billable_customer_id","typeLabel":"string"}},"additionalProperties":true,"description":"Only billable_customer_id is required. Add any additional fields (environment, feature, user_id, team, etc.) and they will appear in your dashboard for filtering, alerts, and reports.","isRequired":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].context","typeLabel":"object"},"model_tier":{"type":"string","description":"Optional model tier classification for custom pricing tiers","uniqueKey":"oneOf.1.transactions.items.[INDEX].model_tier","typeLabel":"string"},"provider_usage_raw":{"type":"object","description":"Optional raw usage data from the provider for debugging or auditing","additionalProperties":true,"uniqueKey":"oneOf.1.transactions.items.[INDEX].provider_usage_raw","typeLabel":"object"}},"uniqueKey":"oneOf.1.transactions.items.[INDEX]","typeLabel":"Single Transaction · object"},"isRequired":true,"uniqueKey":"oneOf.1.transactions","typeLabel":"Single Transaction · object[]"}},"uniqueKey":"oneOf.1","typeLabel":"Bulk Request · object"}],"uniqueKey":"","typeLabel":"Single Transaction · object | Bulk Request · object"},"examples":{"basicExample":{"title":"basicExample","description":"Minimal example with text generation tokens","value":{"provider":"openai","model":"gpt-4o","usage":[{"type":"tokens","metrics":{"input_tokens":150,"output_tokens":50,"total_tokens":200}}],"context":{"billable_customer_id":"acme-corp"}}},"withContext":{"title":"withContext","description":"Include environment, feature, and user tracking","value":{"provider":"openai","model":"gpt-4o","usage":[{"type":"tokens","metrics":{"input_tokens":500,"output_tokens":200,"total_tokens":700}}],"context":{"billable_customer_id":"acme-corp","environment":"production","feature":"chat-assistant","user_id":"user_abc123"}}},"reasoning":{"title":"reasoning","description":"Track reasoning tokens for OpenAI o1 and o3 models","value":{"provider":"openai","model":"o1-preview","usage":[{"type":"tokens","metrics":{"input_tokens":200,"output_tokens":1500,"total_tokens":1700,"reasoning_tokens":1200}}],"context":{"billable_customer_id":"acme-corp","feature":"code-review"}}},"imageGeneration":{"title":"imageGeneration","description":"Track DALL-E or similar image generation","value":{"provider":"openai","model":"dall-e-3","usage":[{"type":"images","metrics":{"generated":2,"size_px":1024}}],"context":{"billable_customer_id":"acme-corp","feature":"image-creator"}}},"audioGeneration":{"title":"audioGeneration","description":"Track speech-to-text transcription","value":{"provider":"openai","model":"whisper-1","usage":[{"type":"audio_seconds","metrics":{"input_seconds":125.5}}],"context":{"billable_customer_id":"acme-corp","feature":"voice-notes"}}},"textToSpeech":{"title":"textToSpeech","description":"Track TTS audio generation","value":{"provider":"openai","model":"tts-1-hd","usage":[{"type":"audio_seconds","metrics":{"output_seconds":45.2}}],"context":{"billable_customer_id":"acme-corp","feature":"podcast-generator"}}},"videoGeneration":{"title":"videoGeneration","description":"Track video analysis or generation","value":{"provider":"gemini","model":"gemini-1.5-pro","usage":[{"type":"video_seconds","metrics":{"processed_seconds":60}}],"context":{"billable_customer_id":"acme-corp","feature":"video-analyzer"}}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"17168cb3-172b-491d-834f-9dddfd424d4e":{"description":"All transactions queued successfully","headers":{"X-Request-Id":{"description":"Unique identifier for the request, useful for debugging and support","schema":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"}},"Idempotency-Key":{"description":"Message ID of the first successfully queued transaction, can be used for idempotency tracking","schema":{"type":"string","example":"abc123-def456-ghi789"}}},"content":{"application/json":{"schema":{"type":"object","required":["status","events_queued","message","results"],"properties":{"status":{"type":"string","const":"queued","description":"Status indicating all transactions were queued","isRequired":true,"uniqueKey":"status","typeLabel":"string"},"events_queued":{"type":"integer","minimum":1,"description":"Number of transactions successfully queued","isRequired":true,"uniqueKey":"events_queued","typeLabel":"integer"},"message":{"type":"string","description":"Human-readable success message","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"results":{"type":"array","items":{"type":"object","required":["transaction_index","message_id"],"properties":{"transaction_index":{"type":"integer","minimum":0,"description":"Index of the transaction in the request","isRequired":true,"uniqueKey":"results.items.[INDEX].transaction_index","typeLabel":"integer"},"message_id":{"type":"string","description":"SQS message ID for the queued transaction","isRequired":true,"uniqueKey":"results.items.[INDEX].message_id","typeLabel":"string"}},"uniqueKey":"results.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"results","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"status":"queued","events_queued":2,"message":"2 transaction(s) queued for processing","results":[{"transaction_index":0,"message_id":"abc123-def456"},{"transaction_index":1,"message_id":"ghi789-jkl012"}]},"examples":{"Example":{"title":"Example","value":{"status":"queued","events_queued":2,"message":"2 transaction(s) queued for processing","results":[{"transaction_index":0,"message_id":"abc123-def456"},{"transaction_index":1,"message_id":"ghi789-jkl012"}]}}},"exampleType":"examples"}},"exampleType":"examples"},"47eb53c2-4e55-4397-a1b6-f5c438e6ccbd":{"description":"Partial success - some transactions queued, some failed","headers":{"X-Request-Id":{"description":"Unique identifier for the request, useful for debugging and support","schema":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"}},"Idempotency-Key":{"description":"Message ID of the first successfully queued transaction, can be used for idempotency tracking","schema":{"type":"string","example":"abc123-def456-ghi789"}}},"content":{"application/json":{"schema":{"type":"object","required":["status","events_queued","events_failed","message","results"],"properties":{"status":{"type":"string","const":"partial_success","description":"Status indicating some transactions succeeded and some failed","isRequired":true,"uniqueKey":"status","typeLabel":"string"},"events_queued":{"type":"integer","minimum":0,"description":"Number of transactions successfully queued","isRequired":true,"uniqueKey":"events_queued","typeLabel":"integer"},"events_failed":{"type":"integer","minimum":1,"description":"Number of transactions that failed to queue","isRequired":true,"uniqueKey":"events_failed","typeLabel":"integer"},"message":{"type":"string","description":"Human-readable status message","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"results":{"type":"array","items":{"type":"object","required":["transaction_index","message_id"],"properties":{"transaction_index":{"type":"integer","minimum":0,"description":"Index of the transaction in the request","isRequired":true,"uniqueKey":"results.items.[INDEX].transaction_index","typeLabel":"integer"},"message_id":{"oneOf":[{"type":"string","description":"SQS message ID if successful, null if failed","isRequired":true,"uniqueKey":"results.items.[INDEX].message_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"SQS message ID if successful, null if failed","isRequired":true,"uniqueKey":"results.items.[INDEX].message_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"results.items.[INDEX].message_id","typeLabel":"string | null"},"error":{"type":"string","description":"Error message if the transaction failed to queue","uniqueKey":"results.items.[INDEX].error","typeLabel":"string"}},"uniqueKey":"results.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"results","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"status":"partial_success","events_queued":1,"events_failed":1,"message":"1 transaction(s) queued, 1 transaction(s) failed","results":[{"transaction_index":0,"message_id":"abc123-def456"},{"transaction_index":1,"message_id":null,"error":"Failed to queue transaction"}]},"examples":{"Example":{"title":"Example","value":{"status":"partial_success","events_queued":1,"events_failed":1,"message":"1 transaction(s) queued, 1 transaction(s) failed","results":[{"transaction_index":0,"message_id":"abc123-def456"},{"transaction_index":1,"message_id":null,"error":"Failed to queue transaction"}]}}},"exampleType":"examples"}},"exampleType":"examples"},"36da1897-6adb-4f8c-ad01-ef69b4e1a6d0":{"description":"Bad request - validation error or invalid JSON","headers":{"X-Request-Id":{"description":"Unique identifier for the request, useful for debugging and support","schema":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"}}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["validation_error","invalid_json","unauthorized","internal_error","partial_failure"],"description":"Error code for programmatic handling","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"array","items":{"type":"object","required":["field","code","message"],"properties":{"field":{"type":"string","description":"Path to the field that caused the error (e.g., 'provider', 'usage.0.metrics.input_tokens')","isRequired":true,"uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"code":{"type":"string","enum":["required","invalid_type","invalid_value","too_small","too_large","invalid_format"],"description":"Field error code for programmatic handling","isRequired":true,"uniqueKey":"error.details.items.[INDEX].code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message for this field","isRequired":true,"uniqueKey":"error.details.items.[INDEX].message","typeLabel":"string"}},"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"description":"Detailed field-level errors for validation failures","uniqueKey":"error.details","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"validationError":{"title":"validationError","value":{"error":{"code":"validation_error","message":"Request validation failed","details":[{"field":"provider","code":"invalid_value","message":"provider must be one of: openai, gemini, bedrock, anthropic, xai, deepseek, custom"}]}}},"invalidJson":{"title":"invalidJson","value":{"error":{"code":"invalid_json","message":"Request body is not valid JSON"}}}},"exampleType":"examples"}},"exampleType":"examples"},"1b27da1b-3e4e-4f53-9b2d-861bb327a7a7":{"description":"Unauthorized - missing or invalid API key","headers":{"X-Request-Id":{"description":"Unique identifier for the request, useful for debugging and support","schema":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"}}},"content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["validation_error","invalid_json","unauthorized","internal_error","partial_failure"],"description":"Error code for programmatic handling","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"array","items":{"type":"object","required":["field","code","message"],"properties":{"field":{"type":"string","description":"Path to the field that caused the error (e.g., 'provider', 'usage.0.metrics.input_tokens')","isRequired":true,"uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"code":{"type":"string","enum":["required","invalid_type","invalid_value","too_small","too_large","invalid_format"],"description":"Field error code for programmatic handling","isRequired":true,"uniqueKey":"error.details.items.[INDEX].code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message for this field","isRequired":true,"uniqueKey":"error.details.items.[INDEX].message","typeLabel":"string"}},"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"description":"Detailed field-level errors for validation failures","uniqueKey":"error.details","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"missingApiKey":{"title":"missingApiKey","value":{"error":{"code":"unauthorized","message":"X-Api-Key header is required"}}},"invalidApiKey":{"title":"invalidApiKey","value":{"error":{"code":"unauthorized","message":"Invalid or missing API key"}}}},"exampleType":"examples"}},"exampleType":"examples"},"a9e7177b-60d3-48a0-a346-047b015637f2":{"description":"Internal server error - all transactions failed","headers":{"X-Request-Id":{"description":"Unique identifier for the request, useful for debugging and support","schema":{"type":"string","format":"uuid","example":"550e8400-e29b-41d4-a716-446655440000"}}},"content":{"application/json":{"schema":{"type":"object","required":["error","events_failed","results"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["validation_error","invalid_json","unauthorized","internal_error","partial_failure"],"description":"Error code for programmatic handling","isRequired":true,"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"details":{"type":"array","items":{"type":"object","required":["field","code","message"],"properties":{"field":{"type":"string","description":"Path to the field that caused the error (e.g., 'provider', 'usage.0.metrics.input_tokens')","isRequired":true,"uniqueKey":"error.details.items.[INDEX].field","typeLabel":"string"},"code":{"type":"string","enum":["required","invalid_type","invalid_value","too_small","too_large","invalid_format"],"description":"Field error code for programmatic handling","isRequired":true,"uniqueKey":"error.details.items.[INDEX].code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message for this field","isRequired":true,"uniqueKey":"error.details.items.[INDEX].message","typeLabel":"string"}},"uniqueKey":"error.details.items.[INDEX]","typeLabel":"object"},"description":"Detailed field-level errors for validation failures","uniqueKey":"error.details","typeLabel":"object[]"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"},"events_failed":{"type":"integer","minimum":1,"description":"Number of transactions that failed to queue","isRequired":true,"uniqueKey":"events_failed","typeLabel":"integer"},"results":{"type":"array","items":{"type":"object","required":["transaction_index","message_id"],"properties":{"transaction_index":{"type":"integer","minimum":0,"description":"Index of the transaction in the request","isRequired":true,"uniqueKey":"results.items.[INDEX].transaction_index","typeLabel":"integer"},"message_id":{"oneOf":[{"type":"string","description":"SQS message ID if successful, null if failed","isRequired":true,"uniqueKey":"results.items.[INDEX].message_id.oneOf.0","typeLabel":"string"},{"type":"null","description":"SQS message ID if successful, null if failed","isRequired":true,"uniqueKey":"results.items.[INDEX].message_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"results.items.[INDEX].message_id","typeLabel":"string | null"},"error":{"type":"string","description":"Error message if the transaction failed to queue","uniqueKey":"results.items.[INDEX].error","typeLabel":"string"}},"uniqueKey":"results.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"results","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"internal_error","message":"Failed to queue all transactions"},"events_failed":2,"results":[{"transaction_index":0,"message_id":null,"error":"Failed to queue transaction"},{"transaction_index":1,"message_id":null,"error":"Failed to queue transaction"}]},"examples":{"Example":{"title":"Example","value":{"error":{"code":"internal_error","message":"Failed to queue all transactions"},"events_failed":2,"results":[{"transaction_index":0,"message_id":null,"error":"Failed to queue transaction"},{"transaction_index":1,"message_id":null,"error":"Failed to queue transaction"}]}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"653bad63-03c0-459c-8e0c-a79de74b5c7a":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"API key for authentication. Must be associated with an active organization.","scopes":[]}}},"servers":{"ffa66c8e-4084-4f3d-9b55-2ce04e12f741":{"url":"https://ingest.fenra.io","description":"Production server"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"API key for authentication. Must be associated with an active organization.","scopes":[]},"schema":{"title":"X-Api-Key","type":"string","description":"API key for authentication. Must be associated with an active organization.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ApiKeyAuth","name":"X-Api-Key"}],"title":"ApiKeyAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"fenra","siteName":"Fenra","title":"POST /usage/transactions - Fenra","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-21T13:40:08.388Z","originalFileLocation":"api-reference/endpoint/create.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Ingest AI usage transactions for cost tracking. Costs are calculated automatically based on the provider\u0026#x27;s pricing. Supports both single transaction and bulk submissions. Use this endpoint after each AI provider call to track cost.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Fenra\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/fenra/6xOmA_v6JZ_r0EuC/_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/fenra/6xOmA_v6JZ_r0EuC/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/fenra/6xOmA_v6JZ_r0EuC/_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/fenra/6xOmA_v6JZ_r0EuC/_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/fenra/6xOmA_v6JZ_r0EuC/_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/fenra/6xOmA_v6JZ_r0EuC/_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/fenra/6xOmA_v6JZ_r0EuC/_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/fenra/6xOmA_v6JZ_r0EuC/_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/fenra/6xOmA_v6JZ_r0EuC/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"POST /usage/transactions - Fenra\">\u003cmeta data-mint-head property=\"og:description\" content=\"Ingest AI usage transactions for cost tracking. Costs are calculated automatically based on the provider\u0026#x27;s pricing. Supports both single transaction and bulk submissions. Use this endpoint after each AI provider call to track cost.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Fenra\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.fenra.io/api-reference/endpoint/create\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://fenra.mintlify.site/_mintlify/api/og/v2?division=Endpoints\u0026amp;title=POST+%2Fusage%2Ftransactions\u0026amp;description=Ingest+AI+usage+transactions+for+cost+tracking.+Costs+are+calculated+automatically+based+on+the+provider%27s+pricing.+Supports+both+single+transaction+and+bulk+su\u0026amp;theme=6031cd35ddba330ccf17059c\u0026amp;signature=2c10d6f6d3c603007144d82de0776fed8e781ce14421234a31c84fefd12f7692\">\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=\"POST /usage/transactions - Fenra\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Ingest AI usage transactions for cost tracking. Costs are calculated automatically based on the provider\u0026#x27;s pricing. Supports both single transaction and bulk submissions. Use this endpoint after each AI provider call to track cost.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://fenra.mintlify.site/_mintlify/api/og/v2?division=Endpoints\u0026amp;title=POST+%2Fusage%2Ftransactions\u0026amp;description=Ingest+AI+usage+transactions+for+cost+tracking.+Costs+are+calculated+automatically+based+on+the+provider%27s+pricing.+Supports+both+single+transaction+and+bulk+su\u0026amp;theme=6031cd35ddba330ccf17059c\u0026amp;signature=2c10d6f6d3c603007144d82de0776fed8e781ce14421234a31c84fefd12f7692\">\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/fenra/6xOmA_v6JZ_r0EuC/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Fenra\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#654EDA\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.fenra.io/api-reference/endpoint/create\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoint/create.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.fenra.io/#organization\",\"name\":\"Fenra\",\"url\":\"https://docs.fenra.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/fenra/VOqg4VznN6ND94vF/logo/light.svg?fit=max\u0026auto=format\u0026n=VOqg4VznN6ND94vF\u0026q=85\u0026s=293c5d6b460336cf446e149b545b81e8\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.fenra.io#website\",\"name\":\"Fenra\",\"url\":\"https://docs.fenra.io\",\"publisher\":{\"@id\":\"https://docs.fenra.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.fenra.io/api-reference/endpoint/create#webpage\",\"url\":\"https://docs.fenra.io/api-reference/endpoint/create\",\"name\":\"POST /usage/transactions\",\"description\":\"Ingest AI usage transactions for cost tracking. Costs are calculated automatically based on the provider's pricing. Supports both single transaction and bulk submissions. Use this endpoint after each AI provider call to track cost.\",\"dateModified\":\"2026-01-21T13:40:08.388Z\",\"isPartOf\":{\"@id\":\"https://docs.fenra.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.fenra.io/api-reference/endpoint/create#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.fenra.io/api-reference/endpoint/create#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Fenra\",\"item\":\"https://docs.fenra.io\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"POST /usage/transactions\",\"item\":\"https://docs.fenra.io/api-reference/endpoint/create\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.fenra.io/api-reference/endpoint/create#apireference\",\"headline\":\"POST /usage/transactions\",\"name\":\"POST /usage/transactions\",\"description\":\"Ingest AI usage transactions for cost tracking. Costs are calculated automatically based on the provider's pricing. Supports both single transaction and bulk submissions. Use this endpoint after each AI provider call to track cost.\",\"url\":\"https://docs.fenra.io/api-reference/endpoint/create\",\"mainEntityOfPage\":{\"@id\":\"https://docs.fenra.io/api-reference/endpoint/create#webpage\"},\"dateModified\":\"2026-01-21T13:40:08.388Z\",\"publisher\":{\"@id\":\"https://docs.fenra.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.fenra.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Fenra\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Fenra\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/endpoint/create.md","siteName":"Fenra","nav":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/fenra-io"},{"anchor":"Support","icon":"envelope","href":"mailto:ajdin@fenra.io"}]},"tabs":[{"tab":"Documentation","icon":"book-open-cover","pages":[{"title":"Documentation","href":""}]},{"tab":"API Reference","icon":"terminal","groups":[{"group":"Overview","pages":[{"title":"API Reference","href":"/api-reference/introduction"},{"title":"Authentication","href":"/api-reference/authentication"},{"title":"Errors","description":"API error codes and how to handle them","href":"/api-reference/errors"}]},{"group":"Endpoints","pages":[{"title":"POST /usage/transactions","openapi":"POST /usage/transactions","href":"/api-reference/endpoint/create"}]}]}]},"basePath":"","title":"POST /usage/transactions - Fenra","buildId":"dpl_596ePT575z4qnAFksq1biRW97aLY","deploymentId":"dpl_596ePT575z4qnAFksq1biRW97aLY","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-C9Wu0MeN.js","utils-jWgu-6Qf.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DBD8f9qn.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-BGuX1ui5.js","snippetPresets-Evy63nQB.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BQHO1lnV.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-B6C8m-t_.js","shallow-BG4cT0fH.js","getApiPlaygroundDisplay-CgEPrE-D.js","CodeSnippet-CU8JyZ9N.js","CodeSnippets-BnxHU32T.js","Page-D6S0Yh6q.js","getPastedJson-CwiYOonh.js","icon-DYDpWmDf.js","MethodPill-C-J-l7_c.js","DuplicateIcon-B6ARwg9w.js","createIcon-Dsv4MtDq.js","DynamicMarkdown-CtasenyM.js","SectionHeading-YNcgYwjB.js","axios-vUo_bRtp.js","Markdown-CwLx6PAg.js","clsx-C3kuh_dz.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CmKHfscc.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-U3mI6Ljh.js"]}