{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}
{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}
{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}
{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}
{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}
{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}
{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The provided API key is invalid, expired, or revoked.",
"request_id": "8f14e45fceea167a5a36dedd4bea2543",
"param": "aspect_ratio"
}
}
Restituisce ciò che la credenziale chiamante — questa chiave API o connessione OAuth —
può spendere adesso, insieme ai totali dell’organizzazione da cui deriva. Richiede lo
scope usage.read. Per i dettagli sui prezzi, vedi Prezzi.
Spendibile dalla credenziale vs. totale dell’organizzazione
La risposta contiene due tipi di numeri. available e spendable_plan_credits rispondono
a «quanto può spendere questa credenziale»; plan_credits e topup_credits sono saldi
a livello di organizzazione.
Campo
Che cos’è
available
I credits che questa credenziale può spendere adesso — spendable_plan_credits + topup_credits. È il numero con cui confrontare gli estimated_credits di un job.
spendable_plan_credits
La parte del pool del piano dentro available: plan_credits limitato da scope.remaining. Uguale a plan_credits quando nulla limita questa credenziale.
plan_credits
Il pool mensile del piano residuo dell’organizzazione — non necessariamente spendibile per intero da questa credenziale. 0 quando il pool è esaurito, o quando l’abbonamento è annullato e oltre la fine del suo periodo (i top-up restano spendibili).
topup_credits
I credits residui da acquisti di top-up validi e non scaduti. I top-up sono esenti dai budget dei team, quindi sono sempre spendibili per intero.
period
Il periodo di fatturazione corrente dell’organizzazione. Il consumo dei budget dei team si azzera con esso.
scope
Il regime di budget sotto cui questa credenziale spende — vedi sotto.
Tre relazioni valgono sempre:
available == spendable_plan_credits + topup_credits
spendable_plan_credits <= plan_credits
per un’organizzazione senza team attivi, spendable_plan_credits == plan_credits
Se la tua organizzazione non ha team, per te non cambia nulla.scope.type è org,
spendable_plan_credits è uguale a plan_credits e available è ancora il pool del
piano più i top-up.
Un’organizzazione può riservare parti del suo pool mensile del piano come budget per
team, e ogni chiave API può essere assegnata a un team. Una credenziale spende allora da
esattamente un bucket, e le è disponibile solo il margine di quel bucket — ecco perché
available può essere inferiore ai plan_credits dell’organizzazione.
scope.type
Significato
Codice di errore in caso di scoperto
org
L’organizzazione non ha team attivi (il caso comune), oppure è un’organizzazione di sistema esente dal budgeting per team. Nulla limita questa credenziale, quindi budget, used e remaining sono tutti null.
L’organizzazione ha almeno un team attivo e questa credenziale non è assegnata a un team con budget — non ha team, oppure il suo team non ha un budget proprio. budget è l’allocazione mensile del piano meno tutti i budget dei team attivi, con minimo 0.
scope.team indica il team a cui la credenziale è assegnata, oppure è null quando non è
assegnata a nessuno. scope.remaining è budget - used, con minimo 0.Una chiave legata a un team il cui budget è il vincolo attivo:
L’organizzazione ha ancora 8031 credits di piano, ma al budget Marketing ne restano
1200: questa chiave può quindi spenderne solo 1200, più i 250 credits di top-up
esenti da budget, per un totale di 1450.
available è il predittore. Un job i cui estimated_credits sono al massimo pari ad
available non viene rifiutato con un 402 di credits insufficienti e, viceversa, un tale
402 significa che la stima ha superato available — in entrambi i casi il numero
della credenziale, non quello dell’organizzazione. Un’eccezione: un guasto operativo
nella detrazione stessa (per esempio una lettura del saldo degradata) viene segnalato
come il generico insufficient_credits
qualunque sia il regime, senza provare nulla su available — un semplice
insufficient_credits dove ti aspettavi un codice team-aware può quindi essere
transitorio; riprova prima di trattarlo come un saldo esaurito.
La previsione vale solo finché lo stato dei credits e dei budget non cambia tra la lettura
e l’invio. Un’altra credenziale della stessa organizzazione che spende, un lotto di top-up
che scade, una modifica dell’abbonamento, un budget di team modificato o una chiave
riassegnata a un altro team possono tutti spostare available — e persino cambiare
scope.type, e quindi il codice di errore che ricevi — senza alcuna spesa da parte
tua. subscription_inactive è un 402
distinto, non legato a questo confronto.
Quando un invio viene rifiutato, scope lo spiega:
scope.type indica il regime di budget, ed è questo a selezionare il codice di
errore (salvo il fallback operativo di cui sopra) — vedi la tabella sopra. Non
dice quale saldo si è esaurito: una chiave nel
regime team riceve insufficient_team_credits anche quando è il pool del piano
dell’organizzazione, e non il budget del team, a essere esaurito.
Per trovare il vincolo reale sotto un regime limitato (team o unallocated), confronta
plan_credits con scope.remaining — il minore dei due limita
spendable_plan_credits. Sotto org, scope.remaining è null e plan_credits è
l’unico vincolo possibile.
remaining: 0 significa che quel bucket è completamente speso per la period corrente.
Non è una precondizione dell’errore: un bucket con remaining: 100 e senza top-up
rifiuta comunque un job che costa 200.
Così una chiave senza team, in un’organizzazione il cui pool del piano è interamente
allocato ai team, riporta available: 0 con scope.type: "unallocated" e remaining: 0 —
ogni invio che costa credits verrà rifiutato con insufficient_unallocated_credits finché un budget non
viene abbassato, la chiave non viene assegnata a un team con margine, o non vengono
acquistati top-up. Vedi Errori per come
risolvere ciascun codice.
Organization API key (Authorization: Bearer samsa_sk_...) or OAuth 2.1 access token (Authorization: Bearer samsa_at_...).
Risposta
Successful Response
GET /credits body — what the CALLING credential can spend (ADR §10, SAM-1029).
Two kinds of number:
available / spendable_plan_credits answer "what can THIS API key or
OAuth connection spend right now" — capped by its team budget bucket
(scope), so a job estimated at or below available is not rejected
with insufficient_team_credits / insufficient_unallocated_credits.
plan_credits / topup_credits are the ORGANIZATION-wide balances.
All amounts are balances (not allocations), and
available == spendable_plan_credits + topup_credits always holds, as does
spendable_plan_credits <= plan_credits (they are equal whenever no team
budget applies).
Total credits the calling credential can spend right now — the sum of spendable_plan_credits and topup_credits. Capped by the credential's team budget bucket (see scope), so it can be lower than the organization-wide plan_credits.
Plan-pool credits the calling credential can spend right now: plan_credits capped by scope.remaining. Equal to plan_credits when no team budget applies.
The ORGANIZATION's remaining monthly subscription-pool credits — not necessarily all spendable by this credential (see spendable_plan_credits). 0 when the plan pool is exhausted or the subscription is canceled and past its period end (top-up credits stay spendable).
Remaining credits from valid (non-expired) top-up purchases. Top-ups are exempt from team budgets, so they are always fully spendable by any credential of the organization.
The credit bucket the calling credential spends from (SAM-1029).
Organizations can reserve parts of their monthly plan pool for teams. A
credential (API key or OAuth connection) spends from exactly ONE bucket, and
only that bucket's headroom is available to it — which is why available
can be lower than the organization-wide plan_credits. The shortfall rule
is cost > available (spendable_plan_credits + topup_credits): a submit
is refused with an insufficient-credit 402 when the deduction,
re-evaluating the same numbers at execution time, finds the estimated cost
above available — insufficient_credits under the uncapped org regime,
insufficient_team_credits under team, and
insufficient_unallocated_credits under unallocated (operational
failures inside the deduction fall back to the generic
insufficient_credits, whatever the regime). This response is a
point-in-time snapshot, not a reservation: concurrent spends, top-up lots
expiring, a canceled subscription's period ending, or a degraded balance
lookup can make the deduction-time numbers differ from the ones reported
here, and other checks can reject a request regardless of credits.
type names the budget regime and selects which of those codes a balance
shortfall raises — it does not say which balance ran out: under a capped
regime the smaller of plan_credits and remaining limits
spendable_plan_credits.
remaining: 0 means this bucket has no plan-pool headroom left for the
current period (spent down, or never allocated any); it is NOT a
precondition of the error — a bucket with remaining: 100 and no top-ups
still refuses a job costing 200.
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Samsa","description":"Developer documentation for the Samsa public API — image generation with trained models, Magic Edit, video generation, model training, and the MCP server.","colors":{"primary":"#15123A","light":"#F3F0EA","dark":"#15123A"},"logo":{"light":"https://mintcdn.com/samsa-6b52d36f/KpPcBLFywFmPfDV-/logo/light.svg?fit=max\u0026auto=format\u0026n=KpPcBLFywFmPfDV-\u0026q=85\u0026s=7959ddf7b4b354d12d95c8cdd42b4c61","dark":"https://mintcdn.com/samsa-6b52d36f/KpPcBLFywFmPfDV-/logo/dark.svg?fit=max\u0026auto=format\u0026n=KpPcBLFywFmPfDV-\u0026q=85\u0026s=74213957254837206e4bb0ce9e2096b6","href":"https://samsa.ai"},"favicon":"https://mintcdn.com/samsa-6b52d36f/KpPcBLFywFmPfDV-/favicon.svg?fit=max\u0026auto=format\u0026n=KpPcBLFywFmPfDV-\u0026q=85\u0026s=24292e198dbc5bbc4dcbc1a41e807c52","appearance":{"default":"system"},"navbar":{"links":[{"href":"mailto:support@samsa.ai","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.samsa.ai"}},"seo":{"organization":{"id":"https://samsa.ai/#organization","name":"Samsa","legalName":"Samsa Labs AG","url":"https://samsa.ai","logo":"https://samsa.ai/wp-content/uploads/2026/01/samsa_logo.webp","sameAs":["https://www.linkedin.com/company/samsa-ai/"]}},"contextual":{"options":["copy","chatgpt","claude","cursor","vscode",{"title":"Connect to Microsoft Copilot","description":"Install MCP Server in Microsoft Copilot","icon":"microsoft","href":"https://docs.samsa.ai/mcp-server/clients"}],"display":"header"},"thumbnails":{"appearance":"dark","background":"https://mintcdn.com/samsa-6b52d36f/KpPcBLFywFmPfDV-/images/thumbnail-world.webp?fit=max\u0026auto=format\u0026n=KpPcBLFywFmPfDV-\u0026q=85\u0026s=ad0e6f187da0ece3388c05736841babd"},"styling":{"latex":false},"navigation":{"languages":[{"language":"en","default":true,"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/samsa-ai","website":"https://samsa.ai"},"links":[{"header":"Information","items":[{"label":"Docs home","href":"/"},{"label":"Changelog","href":"/changelog"},{"label":"Dashboard","href":"https://app.samsa.ai"},{"label":"Pricing","href":"https://samsa.ai/pricing"},{"label":"Contact us","href":"https://samsa.ai/contact"}]},{"header":"Legal","items":[{"label":"Terms of Service","href":"https://samsa.ai/terms-of-service"},{"label":"Acceptable Use Policy","href":"https://samsa.ai/acceptable-use-policy"},{"label":"Privacy Policy","href":"https://samsa.ai/privacy-policy"},{"label":"Imprint","href":"https://samsa.ai/imprint"}]}]},"href":""},{"language":"de","footer":{"socials":{"linkedin":"https://www.linkedin.com/company/samsa-ai","website":"https://samsa.ai"},"links":[{"header":"Informationen","items":[{"label":"Doku-Startseite","href":"/de"},{"label":"Changelog","href":"/de/changelog"},{"label":"Dashboard","href":"https://app.samsa.ai"},{"label":"Preise","href":"https://samsa.ai/de/preise"},{"label":"Kontakt","href":"https://samsa.ai/de/kontakt"}]},{"header":"Rechtliches","items":[{"label":"AGB","href":"https://samsa.ai/de/agb"},{"label":"Nutzungsrichtlinie","href":"https://samsa.ai/de/nutzungsrichtlinie"},{"label":"Datenschutz","href":"https://samsa.ai/de/datenschutz"},{"label":"Impressum","href":"https://samsa.ai/de/impressum"}]}]},"href":"de"},{"language":"fr","footer":{"socials":{"linkedin":"https://www.linkedin.com/company/samsa-ai","website":"https://samsa.ai"},"links":[{"header":"Informations","items":[{"label":"Accueil documentation","href":"/fr"},{"label":"Changelog","href":"/fr/changelog"},{"label":"Dashboard","href":"https://app.samsa.ai"},{"label":"Tarifs","href":"https://samsa.ai/fr/prix"},{"label":"Contact","href":"https://samsa.ai/fr/contact"}]},{"header":"Légal","items":[{"label":"Conditions générales","href":"https://samsa.ai/fr/conditions-generales"},{"label":"Politique d'utilisation acceptable","href":"https://samsa.ai/fr/politique-utilisation-acceptable"},{"label":"Politique de confidentialité","href":"https://samsa.ai/fr/politique-de-confidentialite"},{"label":"Mentions légales","href":"https://samsa.ai/fr/mentions-legales"}]}]},"href":"fr"},{"language":"it","footer":{"socials":{"linkedin":"https://www.linkedin.com/company/samsa-ai","website":"https://samsa.ai"},"links":[{"header":"Informazioni","items":[{"label":"Home documentazione","href":"/it"},{"label":"Changelog","href":"/it/changelog"},{"label":"Dashboard","href":"https://app.samsa.ai"},{"label":"Prezzi","href":"https://samsa.ai/it/prezzi"},{"label":"Contatti","href":"https://samsa.ai/it/contatto"}]},{"header":"Legale","items":[{"label":"Termini e condizioni","href":"https://samsa.ai/it/termini-e-condizioni"},{"label":"Politica di utilizzo accettabile","href":"https://samsa.ai/it/politica-utilizzo-accettabile"},{"label":"Informativa sulla privacy","href":"https://samsa.ai/it/informativa-sulla-privacy"},{"label":"Note legali","href":"https://samsa.ai/it/impronta"}]}]},"href":"it"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"samsa-6b52d36f","hasAudioNarration":false,"actualSubdomain":"samsa-6b52d36f","customDomains":["docs.samsa.ai"],"gitSource":{"type":"github","owner":"samsa-ai","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"collectionId":"261105e6-9f7b-458a-8ad6-ddeee178a591","liveDeploymentHistoryId":"6ada3247fd1ebb929e8defb9","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ada3247fd1ebb929e8defb9"},"feedback":{"agentFeedback":true,"thumbs":false},"entitlements":{},"buildId":"6ada3247fd1ebb929e8defb9","clientVersion":"0.0.3965","searchFilterCounts":[{"language":"en","tag":"API reference","count":45},{"language":"de","tag":"API-Referenz","count":45},{"language":"fr","tag":"Référence API","count":45},{"language":"it","tag":"Riferimento API","count":45},{"language":"en","tag":"Endpoints","count":43},{"language":"de","tag":"Endpunkte","count":43},{"language":"fr","tag":"Points de terminaison","count":43},{"language":"it","tag":"Endpoint","count":43},{"language":"en","tag":"Image Operations","count":13},{"language":"de","tag":"Bildoperationen","count":13},{"language":"fr","tag":"Opérations d'images","count":13},{"language":"it","tag":"Operazioni sulle immagini","count":13},{"language":"en","tag":"Documentation","count":9},{"language":"de","tag":"Dokumentation","count":9},{"language":"fr","tag":"Documentation","count":9},{"language":"it","tag":"Documentazione","count":9},{"language":"en","tag":"Guides","count":7},{"language":"de","tag":"Leitfäden","count":7},{"language":"fr","tag":"Guides","count":7},{"language":"it","tag":"Guide","count":7},{"language":"en","tag":"Model Training","count":5},{"language":"en","tag":"Models","count":5},{"language":"de","tag":"Modelltraining","count":5},{"language":"de","tag":"Modelle","count":5},{"language":"fr","tag":"Entraînement de modèles","count":5},{"language":"fr","tag":"Modèles","count":5},{"language":"it","tag":"Addestramento di modelli","count":5},{"language":"it","tag":"Modelli","count":5},{"language":"en","tag":"Account \u0026 Usage","count":4},{"language":"en","tag":"Image Generation","count":4},{"language":"en","tag":"Video Generation","count":4},{"language":"de","tag":"Konto \u0026 Nutzung","count":4},{"language":"de","tag":"Bildgenerierung","count":4},{"language":"de","tag":"Videogenerierung","count":4},{"language":"fr","tag":"Compte \u0026 utilisation","count":4},{"language":"fr","tag":"Génération d'images","count":4},{"language":"fr","tag":"Génération de vidéos","count":4},{"language":"it","tag":"Account \u0026 utilizzo","count":4},{"language":"it","tag":"Generazione di immagini","count":4},{"language":"it","tag":"Generazione di video","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#navigation-items>div:not(:first-child):has(>.sidebar-group-header){border-top:1px solid rgb(17 24 39/.08);padding-top:1.25rem}:is(html.dark, .dark, [data-theme=\"dark\"]) #navigation-items>div:not(:first-child):has(>.sidebar-group-header){border-top-color:rgb(255 255 255/.1)}img.nav-logo{height:25px;margin-bottom:3px}:root{--samsa-ink:#15123a;--samsa-paper:#f3f0ea;--samsa-night:#0e0c16;--samsa-signal:#ff4f1a;--samsa-signal-text:#c43d0b;--samsa-ring:#c43d0b;--world-grain:url(\"/images/worlds/grain-128.ca7f55b1c0.webp\");--world-grain-size:128px;--world-dim:34.5 32.5 41.5}html.dark{--samsa-signal:#ff5a24;--samsa-signal-text:#ff8a5c;--samsa-ring:#ff5a24;--primary-dark:243 240 234}:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible{outline-style:solid!important;outline-width:2px!important;outline-color:var(--samsa-ring)!important}.prose a:not(.card,[data-client-link],[class*=samsa-hero__]):hover,.prose a:not(.card,[data-client-link],[class*=samsa-hero__]):hover code{color:var(--samsa-signal-text);border-bottom-color:var(--samsa-signal-text)}a:has(>.bg-primary-dark):hover>.bg-primary-dark,button:has(>.bg-primary-dark):hover>.bg-primary-dark{background-color:var(--samsa-signal);opacity:1!important}html.dark a:has(>.bg-primary-dark) :is(.text-white, [class*=\"text-white/\"]),html.dark button:has(>.bg-primary-dark) :is(.text-white, [class*=\"text-white/\"]){color:var(--samsa-night)}html.dark a:has(>.bg-primary-dark):hover :is(.text-white, [class*=\"text-white/\"]),html.dark button:has(>.bg-primary-dark):hover :is(.text-white, [class*=\"text-white/\"]){color:#fff}[data-component-part=card-icon] svg[class]{background-color:var(--samsa-signal-text)}[data-component-part=card-icon] svg:not([style*=mask]){background-color:transparent;color:var(--samsa-signal-text);fill:currentColor}.card:hover [data-component-part=card-title]{color:var(--samsa-signal-text)}@media (min-resolution:1.25dppx){:root{--world-grain-size:102.4px}}@media (min-resolution:1.5dppx){:root{--world-grain-size:85.333px}}@media (min-resolution:1.75dppx){:root{--world-grain-size:73.143px}}@media (min-resolution:2dppx){:root{--world-grain-size:64px}}@media (min-resolution:2.25dppx){:root{--world-grain-size:56.889px}}@media (min-resolution:2.5dppx){:root{--world-grain-size:51.2px}}@media (min-resolution:2.625dppx){:root{--world-grain-size:48.762px}}@media (min-resolution:2.75dppx){:root{--world-grain-size:46.545px}}@media (min-resolution:3dppx){:root{--world-grain-size:42.667px}}@media (min-resolution:3.5dppx){:root{--world-grain-size:36.571px}}@media (min-resolution:4dppx){:root{--world-grain-size:32px}}#footer,.samsa-hero{--world:image-set(\n url(\"/images/worlds/orchid-jungle-1600.c6a419e4ef.avif\") type(\"image/avif\"),\n url(\"/images/worlds/orchid-jungle-1600.7e5329f561.webp\") type(\"image/webp\")\n );--world-webp:url(\"/images/worlds/orchid-jungle-1600.7e5329f561.webp\");--world-base:#41403b;--world-vig:47 43 68}@media (max-width:767px){#footer,.samsa-hero{--world:image-set(\n url(\"/images/worlds/orchid-jungle-800.f9ec57f3b4.avif\") type(\"image/avif\"),\n url(\"/images/worlds/orchid-jungle-800.55128c3346.webp\") type(\"image/webp\")\n );--world-webp:url(\"/images/worlds/orchid-jungle-800.55128c3346.webp\")}}.samsa-hero{--world-x:30%;--world-y:60%;--world-zoom:1.3;--world-shade:0;--world-scrim:radial-gradient(\n 72% 140% at 22% 50%,\n rgb(var(--world-dim) / 0.56),\n rgb(var(--world-dim) / 0.36) 60%,\n rgb(var(--world-dim) / 0)\n );margin:1.75rem 0 2.75rem;padding:2.25rem 2rem;border-radius:1rem;color:#f3f0ea}#footer,.samsa-hero{--vig:0.25;--world-scrim:linear-gradient(transparent, transparent);position:relative;isolation:isolate;overflow:hidden;background-color:var(--world-base);-webkit-mask-image:linear-gradient(#000 0 0);mask-image:linear-gradient(#000 0 0)}#footer::before,.samsa-hero::before{--world-vignette:radial-gradient(\n farthest-corner ellipse at 50% 50%,\n rgb(var(--world-vig) / 0) 30%,\n rgb(var(--world-vig) / calc(var(--vig) * 0.0138)) 40%,\n rgb(var(--world-vig) / calc(var(--vig) * 0.0635)) 50%,\n rgb(var(--world-vig) / calc(var(--vig) * 0.155)) 60%,\n rgb(var(--world-vig) / calc(var(--vig) * 0.292)) 70%,\n rgb(var(--world-vig) / calc(var(--vig) * 0.477)) 80%,\n rgb(var(--world-vig) / calc(var(--vig) * 0.7124)) 90%,\n rgb(var(--world-vig) / var(--vig)) 100%\n );--world-shade-layer:linear-gradient(\n rgb(var(--world-dim) / var(--world-shade, 0)),\n rgb(var(--world-dim) / var(--world-shade, 0))\n );content:\"\";position:absolute;inset:0;z-index:-2;pointer-events:none;background-image:var(--world-shade-layer),var(--world-scrim),var(--world-vignette),var(--world-webp);background-position:var(--world-x, 50%) var(--world-y, 50%);background-size:calc(100%/var(--world-zoom, 1)) calc(100%/var(--world-zoom, 1)),calc(100%/var(--world-zoom, 1)) calc(100%/var(--world-zoom, 1)),calc(100%/var(--world-zoom, 1)) calc(100%/var(--world-zoom, 1)),cover;background-repeat:no-repeat;transform-origin:var(--world-x, 50%) var(--world-y, 50%);scale:var(--world-zoom, 1)}@supports (background-image:image-set(url(data:,x) type(\"image/avif\"))){#footer::before,.samsa-hero::before{background-image:var(--world-shade-layer),var(--world-scrim),var(--world-vignette),var(--world)}}#footer::after,.samsa-hero::after{content:\"\";position:absolute;inset:0;z-index:-1;pointer-events:none;border-radius:inherit;background:var(--world-grain) 0 0/var(--world-grain-size) var(--world-grain-size);mix-blend-mode:difference}.samsa-hero__title{margin:0 0 .55rem;max-width:22ch;font-size:1.8rem;font-weight:650;line-height:1.15;letter-spacing:-.021em;color:#f3f0ea}.samsa-hero__lede{margin:0 0 1.35rem;max-width:46ch;font-size:.95rem;line-height:1.6;color:#f3f0ea}.samsa-hero__actions{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem 1.25rem}.samsa-hero__cta,.samsa-hero__link{text-decoration:none;font-size:.875rem;font-weight:600;border-radius:.6rem}.samsa-hero__cta{display:inline-flex;align-items:center;padding:.58rem 1.1rem;border:0;background:#f3f0ea;color:#0e0c16;transition:background-color .15s ease,color .15s ease}.samsa-hero__cta:hover{background:#ff5a24;color:#fff}.samsa-hero .samsa-hero__link{color:#f3f0ea;border-bottom:2px solid rgb(243 240 234/.45);border-radius:0;padding-bottom:2px;transition:border-color .15s ease,box-shadow .15s ease}.samsa-hero .samsa-hero__link:hover{color:#f3f0ea;border-bottom-color:#ff5a24;box-shadow:0 1px 0 #ff5a24}.samsa-hero__cta:focus-visible,.samsa-hero__link:focus-visible{outline:2px solid #ff5a24!important;outline-offset:3px}@media (max-width:640px){.samsa-hero{--world-x:40%;--world-y:55%;--world-zoom:1.15;--world-scrim:radial-gradient(\n 150% 90% at 40% 35%,\n rgb(var(--world-dim) / 0.5),\n rgb(var(--world-dim) / 0.32) 60%,\n rgb(var(--world-dim) / 0.1)\n );padding:1.75rem 1.35rem}.samsa-hero__title{font-size:1.5rem}}#footer{--world-x:35%;--world-y:55%;--world-zoom:1.5;--world-shade:0.06;--vig:0.35;--foot-glass:rgb(255 255 255 / 0.72);--foot-glass-solid:rgb(255 255 255 / 0.96);--foot-edge:rgb(21 18 58 / 0.08);--foot-rim:rgb(255 255 255 / 0.9);--foot-heading:#15123a;--foot-text:#3f3c56;--foot-quiet:#5e5a72;--foot-hover:#c43d0b;--foot-chip:rgb(21 18 58 / 0.08);margin:2.5rem 1rem 1rem;padding:2.5rem 1rem;border:0;border-radius:28px}html.dark #footer{--foot-glass:rgb(28 26 40 / 0.66);--foot-glass-solid:rgb(26 24 36 / 0.97);--foot-edge:rgb(0 0 0 / 0.4);--foot-rim:rgb(255 255 255 / 0.12);--foot-heading:#f3f0ea;--foot-text:#c2bdd1;--foot-quiet:#a7a2b8;--foot-hover:#ff8a5c;--foot-chip:rgb(255 255 255 / 0.12)}@media (min-width:768px){#footer{margin:3rem 1.5rem 1.5rem;padding:4rem 2rem;border-radius:36px}}#footer>div{position:relative;padding:2.5rem 1.75rem 1.75rem;border-radius:24px;background:var(--foot-glass);box-shadow:0 0 0 1px var(--foot-edge),0 30px 60px -28px rgb(21 18 58/.32);-webkit-backdrop-filter:blur(32px) saturate(1.8) brightness(1.12);backdrop-filter:blur(32px) saturate(1.8) brightness(1.12)}@media (min-width:768px){#footer>div{padding:3rem 3rem 2rem}}@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){#footer>div{background:var(--foot-glass-solid)}}#footer>div::before{content:\"\";position:absolute;inset:0;border-radius:inherit;padding:1px;background:linear-gradient(180deg,var(--foot-rim),transparent 40%);-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none}#footer p{color:var(--foot-heading)}#footer a:hover,#footer a[href*=\"mintlify.com\"]:hover{color:var(--foot-hover)}#footer svg[style*=mask]{background-color:var(--foot-text)}#footer a:hover svg[style*=mask]{background-color:var(--foot-hover)}#footer a,#footer a[href*=\"mintlify.com\"]{color:var(--foot-text)}#footer [class*=h-px]{background-color:var(--foot-edge)}#footer button[data-testid^=mode-switch]{color:var(--foot-quiet);background-color:transparent}#footer button[data-testid^=mode-switch][aria-pressed=true]{color:var(--foot-heading);background-color:var(--foot-chip)}#footer button[data-testid^=mode-switch]:hover{color:var(--foot-hover)}"}],"page":{"pagePath":"it/api-reference/account/credits","slug":"/it/api-reference/account/credits","pageMetadata":{"title":"Ottieni i credits","description":"Leggi il saldo di credits che questa chiave API può spendere.","openapi":"api-reference/openapi.json GET /credits","href":"/it/api-reference/account/credits"},"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: \"Leggi il saldo di credits che questa chiave API può spendere.\"\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`,em:`em`,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,Note,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Restituisce ciò che la `,_jsx(_components.strong,{children:`credenziale chiamante`}),` — questa chiave API o connessione OAuth —\npuò spendere adesso, insieme ai totali dell’organizzazione da cui deriva. Richiede lo\nscope `,_jsx(_components.code,{children:`usage.read`}),`. Per i dettagli sui prezzi, vedi `,_jsx(_components.a,{href:`/it/guides/pricing`,children:`Prezzi`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`spendibile-dalla-credenziale-vs-totale-dell’organizzazione`,children:`Spendibile dalla credenziale vs. totale dell’organizzazione`}),`\n`,_jsxs(_components.p,{children:[`La risposta contiene due tipi di numeri. `,_jsx(_components.code,{children:`available`}),` e `,_jsx(_components.code,{children:`spendable_plan_credits`}),` rispondono\na «quanto può spendere `,_jsx(_components.em,{children:`questa`}),` credenziale»; `,_jsx(_components.code,{children:`plan_credits`}),` e `,_jsx(_components.code,{children:`topup_credits`}),` sono saldi\na livello di organizzazione.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Campo`}),_jsx(_components.th,{children:`Che cos’è`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`available`})}),_jsxs(_components.td,{children:[`I credits che questa credenziale può spendere `,_jsx(_components.strong,{children:`adesso`}),` — `,_jsx(_components.code,{children:`spendable_plan_credits + topup_credits`}),`. È il numero con cui confrontare gli `,_jsx(_components.code,{children:`estimated_credits`}),` di un job.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`spendable_plan_credits`})}),_jsxs(_components.td,{children:[`La parte del pool del piano dentro `,_jsx(_components.code,{children:`available`}),`: `,_jsx(_components.code,{children:`plan_credits`}),` limitato da `,_jsx(_components.code,{children:`scope.remaining`}),`. Uguale a `,_jsx(_components.code,{children:`plan_credits`}),` quando nulla limita questa credenziale.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`plan_credits`})}),_jsxs(_components.td,{children:[`Il pool mensile del piano residuo `,_jsx(_components.strong,{children:`dell’organizzazione`}),` — non necessariamente spendibile per intero da questa credenziale. `,_jsx(_components.code,{children:`0`}),` quando il pool è esaurito, o quando l’abbonamento è annullato e oltre la fine del suo periodo (i top-up restano spendibili).`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`topup_credits`})}),_jsx(_components.td,{children:`I credits residui da acquisti di top-up validi e non scaduti. I top-up sono esenti dai budget dei team, quindi sono sempre spendibili per intero.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`period`})}),_jsx(_components.td,{children:`Il periodo di fatturazione corrente dell’organizzazione. Il consumo dei budget dei team si azzera con esso.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`scope`})}),_jsx(_components.td,{children:`Il regime di budget sotto cui questa credenziale spende — vedi sotto.`})]})]})]}),`\n`,_jsx(_components.p,{children:`Tre relazioni valgono sempre:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`available == spendable_plan_credits + topup_credits`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`spendable_plan_credits \u003c= plan_credits`})}),`\n`,_jsxs(_components.li,{children:[`per un’organizzazione senza team attivi, `,_jsx(_components.code,{children:`spendable_plan_credits == plan_credits`})]}),`\n`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Se la tua organizzazione non ha team, per te non cambia nulla.`}),` `,_jsx(_components.code,{children:`scope.type`}),` è `,_jsx(_components.code,{children:`org`}),`,\n`,_jsx(_components.code,{children:`spendable_plan_credits`}),` è uguale a `,_jsx(_components.code,{children:`plan_credits`}),` e `,_jsx(_components.code,{children:`available`}),` è ancora il pool del\npiano più i top-up.`]})}),`\n`,_jsxs(Heading,{level:`2`,id:`il-regime-di-budget-scope`,children:[`Il regime di budget (`,_jsx(_components.code,{children:`scope`}),`)`]}),`\n`,_jsxs(_components.p,{children:[`Un’organizzazione può riservare parti del suo pool mensile del piano come `,_jsx(_components.strong,{children:`budget`}),` per\nteam, e ogni chiave API può essere assegnata a un team. Una credenziale spende allora da\nesattamente un bucket, e le è disponibile solo il margine di quel bucket — ecco perché\n`,_jsx(_components.code,{children:`available`}),` può essere inferiore ai `,_jsx(_components.code,{children:`plan_credits`}),` dell’organizzazione.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`scope.type`})}),_jsx(_components.th,{children:`Significato`}),_jsx(_components.th,{children:`Codice di errore in caso di scoperto`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`org`})}),_jsxs(_components.td,{children:[`L’organizzazione non ha team attivi (il caso comune), oppure è un’organizzazione di sistema esente dal budgeting per team. Nulla limita questa credenziale, quindi `,_jsx(_components.code,{children:`budget`}),`, `,_jsx(_components.code,{children:`used`}),` e `,_jsx(_components.code,{children:`remaining`}),` sono tutti `,_jsx(_components.code,{children:`null`}),`.`]}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/it/guides/errors#insufficient_credits`,children:_jsx(_components.code,{children:`insufficient_credits`})})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`team`})}),_jsx(_components.td,{children:`La credenziale è assegnata a un team attivo che ha un proprio budget mensile.`}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/it/guides/errors#insufficient_team_credits`,children:_jsx(_components.code,{children:`insufficient_team_credits`})})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`unallocated`})}),_jsxs(_components.td,{children:[`L’organizzazione ha almeno un team attivo e questa credenziale `,_jsx(_components.strong,{children:`non`}),` è assegnata a un team con budget — non ha team, oppure il suo team non ha un budget proprio. `,_jsx(_components.code,{children:`budget`}),` è l’allocazione mensile del piano meno tutti i budget dei team attivi, con minimo `,_jsx(_components.code,{children:`0`}),`.`]}),_jsx(_components.td,{children:_jsx(_components.a,{href:`/it/guides/errors#insufficient_unallocated_credits`,children:_jsx(_components.code,{children:`insufficient_unallocated_credits`})})})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`scope.team`}),` indica il team a cui la credenziale è assegnata, oppure è `,_jsx(_components.code,{children:`null`}),` quando non è\nassegnata a nessuno. `,_jsx(_components.code,{children:`scope.remaining`}),` è `,_jsx(_components.code,{children:`budget - used`}),`, con minimo `,_jsx(_components.code,{children:`0`}),`.`]}),`\n`,_jsx(_components.p,{children:`Una chiave legata a un team il cui budget è il vincolo attivo:`}),`\n`,_jsx(CodeBlock,{filename:`Response`,numberOfLines:`20`,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:`20`,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:` \"available\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1450`}),_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:` \"spendable_plan_credits\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1200`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"plan_credits\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8031`}),_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:` \"topup_credits\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`250`}),_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:` \"period\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"start\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-07-01T00:00:00+00:00\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"end\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-08-01T00:00:00+00:00\"`})]}),`\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:` \"scope\"`}),_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:`\"team\"`}),_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:` \"team\"`}),_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:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"7f3c1e28-9b4d-4a61-8e52-0c7d6b5a4f39\"`}),_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:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Marketing\"`})]}),`\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:` \"budget\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10000`}),_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:` \"used\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8800`}),_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:` \"remaining\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1200`})]}),`\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`,_jsxs(_components.p,{children:[`L’organizzazione ha ancora `,_jsx(_components.code,{children:`8031`}),` credits di piano, ma al budget Marketing ne restano\n`,_jsx(_components.code,{children:`1200`}),`: questa chiave può quindi spenderne solo `,_jsx(_components.code,{children:`1200`}),`, più i `,_jsx(_components.code,{children:`250`}),` credits di top-up\nesenti da budget, per un totale di `,_jsx(_components.code,{children:`1450`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`prevedere-e-diagnosticare-un-402`,children:`Prevedere e diagnosticare un 402`}),`\n`,_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`available`}),` è il predittore.`]}),` Un job i cui `,_jsx(_components.code,{children:`estimated_credits`}),` sono al massimo pari ad\n`,_jsx(_components.code,{children:`available`}),` non viene rifiutato con un `,_jsx(_components.code,{children:`402`}),` di credits insufficienti e, viceversa, un tale\n`,_jsx(_components.code,{children:`402`}),` significa che la stima ha superato `,_jsx(_components.code,{children:`available`}),` — in `,_jsx(_components.strong,{children:`entrambi i casi`}),` il numero\ndella credenziale, non quello dell’organizzazione. Un’eccezione: un `,_jsx(_components.strong,{children:`guasto operativo\nnella detrazione stessa`}),` (per esempio una lettura del saldo degradata) viene segnalato\ncome il generico `,_jsx(_components.a,{href:`/it/guides/errors#insufficient_credits`,children:_jsx(_components.code,{children:`insufficient_credits`})}),`\nqualunque sia il regime, senza provare nulla su `,_jsx(_components.code,{children:`available`}),` — un semplice\n`,_jsx(_components.code,{children:`insufficient_credits`}),` dove ti aspettavi un codice team-aware può quindi essere\ntransitorio; riprova prima di trattarlo come un saldo esaurito.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`La previsione vale solo finché lo stato dei credits e dei budget non cambia tra la lettura\ne l’invio. Un’altra credenziale della stessa organizzazione che spende, un lotto di top-up\nche scade, una modifica dell’abbonamento, un budget di team modificato o una chiave\nriassegnata a un altro team possono tutti spostare `,_jsx(_components.code,{children:`available`}),` — e persino cambiare\n`,_jsx(_components.code,{children:`scope.type`}),`, e quindi il codice di errore che ricevi — senza alcuna spesa da parte\ntua. `,_jsx(_components.a,{href:`/it/guides/errors#subscription_inactive`,children:_jsx(_components.code,{children:`subscription_inactive`})}),` è un `,_jsx(_components.code,{children:`402`}),`\ndistinto, non legato a questo confronto.`]})}),`\n`,_jsxs(_components.p,{children:[`Quando un invio viene rifiutato, `,_jsx(_components.code,{children:`scope`}),` lo spiega:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`scope.type`}),` indica il regime di budget, ed è questo a selezionare il codice di\nerrore`]}),` (salvo il fallback operativo di cui sopra) — vedi la tabella sopra. `,_jsx(_components.strong,{children:`Non`}),`\ndice quale saldo si è esaurito: una chiave nel\nregime `,_jsx(_components.code,{children:`team`}),` riceve `,_jsx(_components.code,{children:`insufficient_team_credits`}),` anche quando è il pool del piano\ndell’organizzazione, e non il budget del team, a essere esaurito.`]}),`\n`,_jsxs(_components.li,{children:[`Per trovare il vincolo reale sotto un regime limitato (`,_jsx(_components.code,{children:`team`}),` o `,_jsx(_components.code,{children:`unallocated`}),`), confronta\n`,_jsx(_components.code,{children:`plan_credits`}),` con `,_jsx(_components.code,{children:`scope.remaining`}),` — il minore dei due limita\n`,_jsx(_components.code,{children:`spendable_plan_credits`}),`. Sotto `,_jsx(_components.code,{children:`org`}),`, `,_jsx(_components.code,{children:`scope.remaining`}),` è `,_jsx(_components.code,{children:`null`}),` e `,_jsx(_components.code,{children:`plan_credits`}),` è\nl’unico vincolo possibile.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`remaining: 0`}),` significa che quel bucket è completamente speso per la `,_jsx(_components.code,{children:`period`}),` corrente.\n`,_jsx(_components.strong,{children:`Non`}),` è una precondizione dell’errore: un bucket con `,_jsx(_components.code,{children:`remaining: 100`}),` e senza top-up\nrifiuta comunque un job che costa `,_jsx(_components.code,{children:`200`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Così una chiave senza team, in un’organizzazione il cui pool del piano è interamente\nallocato ai team, riporta `,_jsx(_components.code,{children:`available: 0`}),` con `,_jsx(_components.code,{children:`scope.type: \"unallocated\"`}),` e `,_jsx(_components.code,{children:`remaining: 0`}),` —\nogni invio che costa credits verrà rifiutato con `,_jsx(_components.code,{children:`insufficient_unallocated_credits`}),` finché un budget non\nviene abbassato, la chiave non viene assegnata a un team con margine, o non vengono\nacquistati top-up. Vedi `,_jsx(_components.a,{href:`/it/guides/errors#insufficient_team_credits`,children:`Errori`}),` per come\nrisolvere ciascun codice.`]})]})}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":"Ottieni i credits","description":"Leggi il saldo di credits che questa chiave API può spendere.","openapi":"api-reference/openapi.json GET /credits","href":"/it/api-reference/account/credits"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Spendibile dalla credenziale vs. totale dell’organizzazione","slug":"spendibile-dalla-credenziale-vs-totale-dell’organizzazione","depth":2,"children":[]},{"title":"Il regime di budget (scope)","slug":"il-regime-di-budget-scope","depth":2,"children":[]},{"title":"Prevedere e diagnosticare un 402","slug":"prevedere-e-diagnosticare-un-402","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Usage"],"summary":"Read the credit balance this API key can spend","description":"Leggi il saldo di credits che questa chiave API può spendere.","operationId":"read_credits_credits_get","responses":{"200":"56f0e1bb-5d46-42ba-b3a3-6ef5ad94088c","401":"799f0221-d074-4fa8-9dd3-f857c21d7a5e","402":"dc4638d0-1838-4b67-801b-7416361f2b39","403":"6c6ee31f-94f4-4e87-a159-803f0fae2742","404":"135dca67-9dcc-4a90-9d0a-b8c357ab4a51","422":"9ebf64c3-1496-4647-bd58-a92f50e1c49c","429":"944beaff-1625-4922-a656-e07c8bc9f9e3","500":"61e36723-b8a8-4438-b107-26243e830733"},"method":"get","type":"path","servers":["a08679d8-4c66-4164-bad0-0564dfe6f3df"],"security":["8098c6f5-b81c-4b34-bd5b-3b5f75d9bd79"],"path":"/credits","baseUrlOptions":["https://api.samsa.ai/public/v1"],"title":"Read the credit balance this API key can spend","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"responses":{"56f0e1bb-5d46-42ba-b3a3-6ef5ad94088c":{"description":"Successful Response","content":{"application/json":{"schema":{"properties":{"available":{"type":"integer","title":"Available","description":"Total credits the calling credential can spend right now — the sum of `spendable_plan_credits` and `topup_credits`. Capped by the credential's team budget bucket (see `scope`), so it can be lower than the organization-wide `plan_credits`.","examples":[1450],"isRequired":true,"uniqueKey":"available","typeLabel":"integer"},"spendable_plan_credits":{"type":"integer","title":"Spendable Plan Credits","description":"Plan-pool credits the calling credential can spend right now: `plan_credits` capped by `scope.remaining`. Equal to `plan_credits` when no team budget applies.","examples":[1200],"isRequired":true,"uniqueKey":"spendable_plan_credits","typeLabel":"integer"},"plan_credits":{"type":"integer","title":"Plan Credits","description":"The ORGANIZATION's remaining monthly subscription-pool credits — not necessarily all spendable by this credential (see `spendable_plan_credits`). 0 when the plan pool is exhausted or the subscription is canceled and past its period end (top-up credits stay spendable).","examples":[1200],"isRequired":true,"uniqueKey":"plan_credits","typeLabel":"integer"},"topup_credits":{"type":"integer","title":"Topup Credits","description":"Remaining credits from valid (non-expired) top-up purchases. Top-ups are exempt from team budgets, so they are always fully spendable by any credential of the organization.","examples":[250],"isRequired":true,"uniqueKey":"topup_credits","typeLabel":"integer"},"period":{"properties":{"start":{"type":"string","format":"date-time","title":"Start","examples":["2026-07-01T00:00:00+00:00"],"isRequired":true,"uniqueKey":"period.start","typeLabel":"string\u003cdate-time>"},"end":{"type":"string","format":"date-time","title":"End","examples":["2026-08-01T00:00:00+00:00"],"isRequired":true,"uniqueKey":"period.end","typeLabel":"string\u003cdate-time>"}},"type":"object","required":["start","end"],"title":"BillingPeriod","description":"The org subscription's current billing-period bounds (ISO-8601).","isRequired":true,"uniqueKey":"period","typeLabel":"BillingPeriod · object"},"scope":{"properties":{"type":{"type":"string","enum":["org","team","unallocated"],"title":"PublicCreditsScopeType","description":"`org` — the organization has no ACTIVE teams (the common case; soft-deleted teams do not count), or it is a system organization exempt from team budgeting; either way the whole plan pool is available and `budget`/`used`/`remaining` are `null` because no cap exists. `team` — the credential is bound to an active team with its own monthly budget. `unallocated` — the credential spends the part of the plan pool that is NOT reserved for any team (credentials with no team, or bound to a team without a budget).","examples":["unallocated"],"isRequired":true,"uniqueKey":"scope.type","typeLabel":"enum\u003cstring>"},"team":{"oneOf":[{"type":"object","title":"PublicCreditsTeamRef","description":"The team the credential is bound to, or `null` when it is bound to none. Present on `type=unallocated` too when the bound team has no budget of its own.","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid","title":"Id","isRequired":true,"uniqueKey":"scope.team.oneOf.0.id","typeLabel":"string\u003cuuid>"},"name":{"type":"string","title":"Name","examples":["Marketing"],"isRequired":true,"uniqueKey":"scope.team.oneOf.0.name","typeLabel":"string"}},"uniqueKey":"scope.team.oneOf.0","typeLabel":"PublicCreditsTeamRef · object"},{"type":"null","description":"The team the credential is bound to, or `null` when it is bound to none. Present on `type=unallocated` too when the bound team has no budget of its own.","uniqueKey":"scope.team.oneOf.1","typeLabel":"null"}],"uniqueKey":"scope.team","typeLabel":"PublicCreditsTeamRef · object | null"},"budget":{"oneOf":[{"type":"integer","title":"Budget","description":"Credits allocated to this bucket for the current billing period. `null` for `type=org` (no cap). For `unallocated` this is the monthly plan allocation minus the sum of all active team budgets, floored at 0 (`max(0, …)` — team allocations can exceed the plan pool).","example":2000,"uniqueKey":"scope.budget.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Budget","description":"Credits allocated to this bucket for the current billing period. `null` for `type=org` (no cap). For `unallocated` this is the monthly plan allocation minus the sum of all active team budgets, floored at 0 (`max(0, …)` — team allocations can exceed the plan pool).","example":2000,"uniqueKey":"scope.budget.oneOf.1","typeLabel":"null"}],"uniqueKey":"scope.budget","typeLabel":"integer | null"},"used":{"oneOf":[{"type":"integer","title":"Used","description":"Credits already spent from this bucket in the current billing period, net of refunds. `null` for `type=org`.","example":500,"uniqueKey":"scope.used.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Used","description":"Credits already spent from this bucket in the current billing period, net of refunds. `null` for `type=org`.","example":500,"uniqueKey":"scope.used.oneOf.1","typeLabel":"null"}],"uniqueKey":"scope.used","typeLabel":"integer | null"},"remaining":{"oneOf":[{"type":"integer","title":"Remaining","description":"Headroom left in this bucket (`budget - used`, floored at 0) — the ceiling this credential's plan-pool spend is capped at. `null` for `type=org` (no cap).","example":1500,"uniqueKey":"scope.remaining.oneOf.0","typeLabel":"integer"},{"type":"null","title":"Remaining","description":"Headroom left in this bucket (`budget - used`, floored at 0) — the ceiling this credential's plan-pool spend is capped at. `null` for `type=org` (no cap).","example":1500,"uniqueKey":"scope.remaining.oneOf.1","typeLabel":"null"}],"uniqueKey":"scope.remaining","typeLabel":"integer | null"}},"type":"object","required":["type"],"title":"PublicCreditsScope","description":"The credit bucket the calling credential spends from (SAM-1029).\n\nOrganizations can reserve parts of their monthly plan pool for teams. A\ncredential (API key or OAuth connection) spends from exactly ONE bucket, and\nonly that bucket's headroom is available to it — which is why `available`\ncan be lower than the organization-wide `plan_credits`. The shortfall rule\nis `cost > available` (`spendable_plan_credits + topup_credits`): a submit\nis refused with an insufficient-credit 402 when the deduction,\nre-evaluating the same numbers at execution time, finds the estimated cost\nabove `available` — `insufficient_credits` under the uncapped `org` regime,\n`insufficient_team_credits` under `team`, and\n`insufficient_unallocated_credits` under `unallocated` (operational\nfailures inside the deduction fall back to the generic\n`insufficient_credits`, whatever the regime). This response is a\npoint-in-time snapshot, not a reservation: concurrent spends, top-up lots\nexpiring, a canceled subscription's period ending, or a degraded balance\nlookup can make the deduction-time numbers differ from the ones reported\nhere, and other checks can reject a request regardless of credits.\n`type` names the budget regime and selects which of those codes a balance\nshortfall raises — it does not say which balance ran out: under a capped\nregime the smaller of `plan_credits` and `remaining` limits\n`spendable_plan_credits`.\n`remaining: 0` means this bucket has no plan-pool headroom left for the\ncurrent period (spent down, or never allocated any); it is NOT a\nprecondition of the error — a bucket with `remaining: 100` and no top-ups\nstill refuses a job costing 200.","isRequired":true,"uniqueKey":"scope","typeLabel":"PublicCreditsScope · object"}},"type":"object","required":["available","spendable_plan_credits","plan_credits","topup_credits","period","scope"],"title":"PublicCreditsResponse","description":"``GET /credits`` body — what the CALLING credential can spend (ADR §10, SAM-1029).\n\nTwo kinds of number:\n\n* ``available`` / ``spendable_plan_credits`` answer \"what can THIS API key or\n OAuth connection spend right now\" — capped by its team budget bucket\n (``scope``), so a job estimated at or below ``available`` is not rejected\n with ``insufficient_team_credits`` / ``insufficient_unallocated_credits``.\n* ``plan_credits`` / ``topup_credits`` are the ORGANIZATION-wide balances.\n\nAll amounts are balances (not allocations), and\n``available == spendable_plan_credits + topup_credits`` always holds, as does\n``spendable_plan_credits \u003c= plan_credits`` (they are equal whenever no team\nbudget applies).","uniqueKey":"","typeLabel":"PublicCreditsResponse · object"},"examples":{"Example":{"title":"Example","value":{"available":1450,"spendable_plan_credits":1200,"plan_credits":1200,"topup_credits":250,"period":{"start":"2026-07-01T00:00:00+00:00","end":"2026-08-01T00:00:00+00:00"},"scope":{"type":"unallocated","team":{"id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","name":"Marketing"},"budget":2000,"used":500,"remaining":1500}}}},"exampleType":"generated"}},"exampleType":"generated"},"799f0221-d074-4fa8-9dd3-f857c21d7a5e":{"description":"Missing, invalid, expired, or revoked API key.","content":{"application/json":{"schema":{"properties":{"error":{"properties":{"type":{"type":"string","title":"Type","examples":["authentication_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"type":"string","title":"Code","examples":["invalid_api_key"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","title":"Message","examples":["The provided API key is invalid, expired, or revoked."],"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","title":"Request Id","examples":["8f14e45fceea167a5a36dedd4bea2543"],"isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string"},"param":{"oneOf":[{"type":"string","title":"Param","description":"Present on validation errors — names the offending field.","example":"aspect_ratio","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","title":"Param","description":"Present on validation errors — names the offending field.","example":"aspect_ratio","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"type":"object","required":["type","code","message","request_id"],"title":"ErrorDetail","description":"The ``error`` object of the public envelope (ADR §5).","isRequired":true,"uniqueKey":"error","typeLabel":"ErrorDetail · object"}},"type":"object","required":["error"],"title":"ErrorEnvelope","description":"The complete public error body — an ``error`` object wrapper (ADR §5).","uniqueKey":"","typeLabel":"ErrorEnvelope · object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"The provided API key is invalid, expired, or revoked.","request_id":"8f14e45fceea167a5a36dedd4bea2543","param":"aspect_ratio"}}}},"exampleType":"generated"}},"exampleType":"generated"},"dc4638d0-1838-4b67-801b-7416361f2b39":{"description":"Insufficient credits or inactive subscription.","content":{"application/json":{"schema":{"properties":{"error":{"properties":{"type":{"type":"string","title":"Type","examples":["authentication_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"type":"string","title":"Code","examples":["invalid_api_key"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","title":"Message","examples":["The provided API key is invalid, expired, or revoked."],"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","title":"Request Id","examples":["8f14e45fceea167a5a36dedd4bea2543"],"isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string"},"param":{"oneOf":[{"type":"string","title":"Param","description":"Present on validation errors — names the offending field.","example":"aspect_ratio","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","title":"Param","description":"Present on validation errors — names the offending field.","example":"aspect_ratio","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"type":"object","required":["type","code","message","request_id"],"title":"ErrorDetail","description":"The ``error`` object of the public envelope (ADR §5).","isRequired":true,"uniqueKey":"error","typeLabel":"ErrorDetail · object"}},"type":"object","required":["error"],"title":"ErrorEnvelope","description":"The complete public error body — an ``error`` object wrapper (ADR §5).","uniqueKey":"","typeLabel":"ErrorEnvelope · object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"The provided API key is invalid, expired, or revoked.","request_id":"8f14e45fceea167a5a36dedd4bea2543","param":"aspect_ratio"}}}},"exampleType":"generated"}},"exampleType":"generated"},"6c6ee31f-94f4-4e87-a159-803f0fae2742":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"properties":{"error":{"properties":{"type":{"type":"string","title":"Type","examples":["authentication_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"type":"string","title":"Code","examples":["invalid_api_key"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","title":"Message","examples":["The provided API key is invalid, expired, or revoked."],"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","title":"Request Id","examples":["8f14e45fceea167a5a36dedd4bea2543"],"isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string"},"param":{"oneOf":[{"type":"string","title":"Param","description":"Present on validation errors — names the offending field.","example":"aspect_ratio","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","title":"Param","description":"Present on validation errors — names the offending field.","example":"aspect_ratio","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"type":"object","required":["type","code","message","request_id"],"title":"ErrorDetail","description":"The ``error`` object of the public envelope (ADR §5).","isRequired":true,"uniqueKey":"error","typeLabel":"ErrorDetail · object"}},"type":"object","required":["error"],"title":"ErrorEnvelope","description":"The complete public error body — an ``error`` object wrapper (ADR §5).","uniqueKey":"","typeLabel":"ErrorEnvelope · object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"The provided API key is invalid, expired, or revoked.","request_id":"8f14e45fceea167a5a36dedd4bea2543","param":"aspect_ratio"}}}},"exampleType":"generated"}},"exampleType":"generated"},"135dca67-9dcc-4a90-9d0a-b8c357ab4a51":{"description":"Resource not found.","content":{"application/json":{"schema":{"properties":{"error":{"properties":{"type":{"type":"string","title":"Type","examples":["authentication_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"type":"string","title":"Code","examples":["invalid_api_key"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","title":"Message","examples":["The provided API key is invalid, expired, or revoked."],"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","title":"Request Id","examples":["8f14e45fceea167a5a36dedd4bea2543"],"isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string"},"param":{"oneOf":[{"type":"string","title":"Param","description":"Present on validation errors — names the offending field.","example":"aspect_ratio","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","title":"Param","description":"Present on validation errors — names the offending field.","example":"aspect_ratio","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"type":"object","required":["type","code","message","request_id"],"title":"ErrorDetail","description":"The ``error`` object of the public envelope (ADR §5).","isRequired":true,"uniqueKey":"error","typeLabel":"ErrorDetail · object"}},"type":"object","required":["error"],"title":"ErrorEnvelope","description":"The complete public error body — an ``error`` object wrapper (ADR §5).","uniqueKey":"","typeLabel":"ErrorEnvelope · object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"The provided API key is invalid, expired, or revoked.","request_id":"8f14e45fceea167a5a36dedd4bea2543","param":"aspect_ratio"}}}},"exampleType":"generated"}},"exampleType":"generated"},"9ebf64c3-1496-4647-bd58-a92f50e1c49c":{"description":"Request validation failed.","content":{"application/json":{"schema":{"properties":{"error":{"properties":{"type":{"type":"string","title":"Type","examples":["authentication_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"type":"string","title":"Code","examples":["invalid_api_key"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","title":"Message","examples":["The provided API key is invalid, expired, or revoked."],"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","title":"Request Id","examples":["8f14e45fceea167a5a36dedd4bea2543"],"isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string"},"param":{"oneOf":[{"type":"string","title":"Param","description":"Present on validation errors — names the offending field.","example":"aspect_ratio","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","title":"Param","description":"Present on validation errors — names the offending field.","example":"aspect_ratio","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"type":"object","required":["type","code","message","request_id"],"title":"ErrorDetail","description":"The ``error`` object of the public envelope (ADR §5).","isRequired":true,"uniqueKey":"error","typeLabel":"ErrorDetail · object"}},"type":"object","required":["error"],"title":"ErrorEnvelope","description":"The complete public error body — an ``error`` object wrapper (ADR §5).","uniqueKey":"","typeLabel":"ErrorEnvelope · object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"The provided API key is invalid, expired, or revoked.","request_id":"8f14e45fceea167a5a36dedd4bea2543","param":"aspect_ratio"}}}},"exampleType":"generated"}},"exampleType":"generated"},"944beaff-1625-4922-a656-e07c8bc9f9e3":{"description":"Rate limit exceeded.","content":{"application/json":{"schema":{"properties":{"error":{"properties":{"type":{"type":"string","title":"Type","examples":["authentication_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"type":"string","title":"Code","examples":["invalid_api_key"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","title":"Message","examples":["The provided API key is invalid, expired, or revoked."],"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","title":"Request Id","examples":["8f14e45fceea167a5a36dedd4bea2543"],"isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string"},"param":{"oneOf":[{"type":"string","title":"Param","description":"Present on validation errors — names the offending field.","example":"aspect_ratio","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","title":"Param","description":"Present on validation errors — names the offending field.","example":"aspect_ratio","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"type":"object","required":["type","code","message","request_id"],"title":"ErrorDetail","description":"The ``error`` object of the public envelope (ADR §5).","isRequired":true,"uniqueKey":"error","typeLabel":"ErrorDetail · object"}},"type":"object","required":["error"],"title":"ErrorEnvelope","description":"The complete public error body — an ``error`` object wrapper (ADR §5).","uniqueKey":"","typeLabel":"ErrorEnvelope · object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"The provided API key is invalid, expired, or revoked.","request_id":"8f14e45fceea167a5a36dedd4bea2543","param":"aspect_ratio"}}}},"exampleType":"generated"}},"exampleType":"generated"},"61e36723-b8a8-4438-b107-26243e830733":{"description":"Internal server error.","content":{"application/json":{"schema":{"properties":{"error":{"properties":{"type":{"type":"string","title":"Type","examples":["authentication_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"code":{"type":"string","title":"Code","examples":["invalid_api_key"],"isRequired":true,"uniqueKey":"error.code","typeLabel":"string"},"message":{"type":"string","title":"Message","examples":["The provided API key is invalid, expired, or revoked."],"isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"request_id":{"type":"string","title":"Request Id","examples":["8f14e45fceea167a5a36dedd4bea2543"],"isRequired":true,"uniqueKey":"error.request_id","typeLabel":"string"},"param":{"oneOf":[{"type":"string","title":"Param","description":"Present on validation errors — names the offending field.","example":"aspect_ratio","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","title":"Param","description":"Present on validation errors — names the offending field.","example":"aspect_ratio","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"type":"object","required":["type","code","message","request_id"],"title":"ErrorDetail","description":"The ``error`` object of the public envelope (ADR §5).","isRequired":true,"uniqueKey":"error","typeLabel":"ErrorDetail · object"}},"type":"object","required":["error"],"title":"ErrorEnvelope","description":"The complete public error body — an ``error`` object wrapper (ADR §5).","uniqueKey":"","typeLabel":"ErrorEnvelope · object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"The provided API key is invalid, expired, or revoked.","request_id":"8f14e45fceea167a5a36dedd4bea2543","param":"aspect_ratio"}}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"8098c6f5-b81c-4b34-bd5b-3b5f75d9bd79":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Organization API key (`Authorization: Bearer samsa_sk_...`) or OAuth 2.1 access token (`Authorization: Bearer samsa_at_...`).","scopes":[],"schemeName":"BearerAuth"}}},"servers":{"a08679d8-4c66-4164-bad0-0564dfe6f3df":{"url":"https://api.samsa.ai/public/v1"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"Organization API key (`Authorization: Bearer samsa_sk_...`) or OAuth 2.1 access token (`Authorization: Bearer samsa_at_...`).","scopes":[],"schemeName":"BearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Organization API key (`Authorization: Bearer samsa_sk_...`) or OAuth 2.1 access token (`Authorization: Bearer samsa_at_...`).","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerAuth","name":"Authorization"}],"title":"BearerAuth"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"samsa-6b52d36f","siteName":"Samsa","title":"Ottieni i credits - Samsa","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/api-reference/account/credits","matchLevel":1},"de":{"href":"/de/api-reference/account/credits","matchLevel":1},"fr":{"href":"/fr/api-reference/account/credits","matchLevel":1},"it":{"href":"/it/api-reference/account/credits","matchLevel":0}}},"lastModified":"2026-08-12T20:57:33.618Z","originalFileLocation":"it/api-reference/account/credits.mdx","locale":"it"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Leggi il saldo di credits che questa chiave API può spendere.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Samsa\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/samsa-6b52d36f/d_WeLiSBvKQ9voQx/_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/samsa-6b52d36f/d_WeLiSBvKQ9voQx/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/samsa-6b52d36f/d_WeLiSBvKQ9voQx/_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/samsa-6b52d36f/d_WeLiSBvKQ9voQx/_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/samsa-6b52d36f/d_WeLiSBvKQ9voQx/_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/samsa-6b52d36f/d_WeLiSBvKQ9voQx/_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/samsa-6b52d36f/d_WeLiSBvKQ9voQx/_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/samsa-6b52d36f/d_WeLiSBvKQ9voQx/_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/samsa-6b52d36f/d_WeLiSBvKQ9voQx/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Ottieni i credits - Samsa\">\u003cmeta data-mint-head property=\"og:description\" content=\"Leggi il saldo di credits che questa chiave API può spendere.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Samsa\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.samsa.ai/it/api-reference/account/credits\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://samsa-6b52d36f.mintlify.app/_mintlify/api/og/v2?division=Account+%26+utilizzo\u0026amp;title=Ottieni+i+credits\u0026amp;description=Leggi+il+saldo+di+credits+che+questa+chiave+API+pu%C3%B2+spendere.\u0026amp;theme=bea4a9a10b0b9a420fea38c2\u0026amp;signature=1e36d29bd9c3798ca43045e4e9db793b5ef24983e8317616d3a6947953457e94\">\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=\"Ottieni i credits - Samsa\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Leggi il saldo di credits che questa chiave API può spendere.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://samsa-6b52d36f.mintlify.app/_mintlify/api/og/v2?division=Account+%26+utilizzo\u0026amp;title=Ottieni+i+credits\u0026amp;description=Leggi+il+saldo+di+credits+che+questa+chiave+API+pu%C3%B2+spendere.\u0026amp;theme=bea4a9a10b0b9a420fea38c2\u0026amp;signature=1e36d29bd9c3798ca43045e4e9db793b5ef24983e8317616d3a6947953457e94\">\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/samsa-6b52d36f/d_WeLiSBvKQ9voQx/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Samsa\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#15123A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.samsa.ai/it/api-reference/account/credits\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/it/api-reference/account/credits.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"it\" href=\"https://docs.samsa.ai/it/api-reference/account/credits\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.samsa.ai/api-reference/account/credits\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"de\" href=\"https://docs.samsa.ai/de/api-reference/account/credits\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"fr\" href=\"https://docs.samsa.ai/fr/api-reference/account/credits\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.samsa.ai/api-reference/account/credits\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://samsa.ai/#organization\",\"name\":\"Samsa\",\"legalName\":\"Samsa Labs AG\",\"url\":\"https://samsa.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://samsa.ai/wp-content/uploads/2026/01/samsa_logo.webp\"},\"sameAs\":[\"https://www.linkedin.com/company/samsa-ai/\"]},{\"@type\":\"WebSite\",\"@id\":\"https://docs.samsa.ai#website\",\"name\":\"Samsa\",\"url\":\"https://docs.samsa.ai\",\"publisher\":{\"@id\":\"https://samsa.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.samsa.ai/it/api-reference/account/credits#webpage\",\"url\":\"https://docs.samsa.ai/it/api-reference/account/credits\",\"name\":\"Ottieni i credits\",\"description\":\"Leggi il saldo di credits che questa chiave API può spendere.\",\"dateModified\":\"2026-08-12T20:57:33.618Z\",\"isPartOf\":{\"@id\":\"https://docs.samsa.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.samsa.ai/it/api-reference/account/credits#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.samsa.ai/it/api-reference/account/credits#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoint\",\"item\":\"https://docs.samsa.ai/it/api-reference/images/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Account \u0026 utilizzo\",\"item\":\"https://docs.samsa.ai/it/api-reference/account/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Ottieni i credits\",\"item\":\"https://docs.samsa.ai/it/api-reference/account/credits\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.samsa.ai/it/api-reference/account/credits#apireference\",\"headline\":\"Ottieni i credits\",\"name\":\"Ottieni i credits\",\"description\":\"Leggi il saldo di credits che questa chiave API può spendere.\",\"url\":\"https://docs.samsa.ai/it/api-reference/account/credits\",\"mainEntityOfPage\":{\"@id\":\"https://docs.samsa.ai/it/api-reference/account/credits#webpage\"},\"dateModified\":\"2026-08-12T20:57:33.618Z\",\"publisher\":{\"@id\":\"https://samsa.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.samsa.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Samsa\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Samsa","nav":{"global":null,"languages":[{"language":"en","default":true,"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/samsa-ai","website":"https://samsa.ai"},"links":[{"header":"Information","items":[{"label":"Docs home","href":"/"},{"label":"Changelog","href":"/changelog"},{"label":"Dashboard","href":"https://app.samsa.ai"},{"label":"Pricing","href":"https://samsa.ai/pricing"},{"label":"Contact us","href":"https://samsa.ai/contact"}]},{"header":"Legal","items":[{"label":"Terms of Service","href":"https://samsa.ai/terms-of-service"},{"label":"Acceptable Use Policy","href":"https://samsa.ai/acceptable-use-policy"},{"label":"Privacy Policy","href":"https://samsa.ai/privacy-policy"},{"label":"Imprint","href":"https://samsa.ai/imprint"}]}]},"pages":[{"title":"en","href":"/api-reference/account/credits"}]},{"language":"de","footer":{"socials":{"linkedin":"https://www.linkedin.com/company/samsa-ai","website":"https://samsa.ai"},"links":[{"header":"Informationen","items":[{"label":"Doku-Startseite","href":"/de"},{"label":"Changelog","href":"/de/changelog"},{"label":"Dashboard","href":"https://app.samsa.ai"},{"label":"Preise","href":"https://samsa.ai/de/preise"},{"label":"Kontakt","href":"https://samsa.ai/de/kontakt"}]},{"header":"Rechtliches","items":[{"label":"AGB","href":"https://samsa.ai/de/agb"},{"label":"Nutzungsrichtlinie","href":"https://samsa.ai/de/nutzungsrichtlinie"},{"label":"Datenschutz","href":"https://samsa.ai/de/datenschutz"},{"label":"Impressum","href":"https://samsa.ai/de/impressum"}]}]},"pages":[{"title":"de","href":"/de/api-reference/account/credits"}]},{"language":"fr","footer":{"socials":{"linkedin":"https://www.linkedin.com/company/samsa-ai","website":"https://samsa.ai"},"links":[{"header":"Informations","items":[{"label":"Accueil documentation","href":"/fr"},{"label":"Changelog","href":"/fr/changelog"},{"label":"Dashboard","href":"https://app.samsa.ai"},{"label":"Tarifs","href":"https://samsa.ai/fr/prix"},{"label":"Contact","href":"https://samsa.ai/fr/contact"}]},{"header":"Légal","items":[{"label":"Conditions générales","href":"https://samsa.ai/fr/conditions-generales"},{"label":"Politique d'utilisation acceptable","href":"https://samsa.ai/fr/politique-utilisation-acceptable"},{"label":"Politique de confidentialité","href":"https://samsa.ai/fr/politique-de-confidentialite"},{"label":"Mentions légales","href":"https://samsa.ai/fr/mentions-legales"}]}]},"pages":[{"title":"fr","href":"/fr/api-reference/account/credits"}]},{"language":"it","footer":{"socials":{"linkedin":"https://www.linkedin.com/company/samsa-ai","website":"https://samsa.ai"},"links":[{"header":"Informazioni","items":[{"label":"Home documentazione","href":"/it"},{"label":"Changelog","href":"/it/changelog"},{"label":"Dashboard","href":"https://app.samsa.ai"},{"label":"Prezzi","href":"https://samsa.ai/it/prezzi"},{"label":"Contatti","href":"https://samsa.ai/it/contatto"}]},{"header":"Legale","items":[{"label":"Termini e condizioni","href":"https://samsa.ai/it/termini-e-condizioni"},{"label":"Politica di utilizzo accettabile","href":"https://samsa.ai/it/politica-utilizzo-accettabile"},{"label":"Informativa sulla privacy","href":"https://samsa.ai/it/informativa-sulla-privacy"},{"label":"Note legali","href":"https://samsa.ai/it/impronta"}]}]},"tabs":[{"tab":"Documentazione","pages":[{"title":"Documentazione","href":"/it"}]},{"tab":"Riferimento API","groups":[{"group":"Panoramica","pages":[{"title":"Samsa API","href":"/it/api"},{"title":"Riferimento API","href":"/it/api-reference/introduction"}]},{"group":"Endpoint","pages":[{"group":"Generazione di immagini","pages":[{"title":"Generazione di immagini","sidebarTitle":"Panoramica","href":"/it/api-reference/images/overview"},{"title":"Genera immagini","openapi":"api-reference/openapi.json POST /images/generations","href":"/it/api-reference/images/generate"},{"title":"Ottieni una generazione di immagini","openapi":"api-reference/openapi.json GET /images/generations/{generation_id}","href":"/it/api-reference/images/get-generation"},{"title":"Elenca gli engine di immagini","openapi":"api-reference/openapi.json GET /images/models","href":"/it/api-reference/images/list-engines"}]},{"group":"Caricamento di immagini","pages":[{"title":"Caricamento di immagini","sidebarTitle":"Panoramica","href":"/it/api-reference/uploads/overview"},{"title":"Prepara un upload di immagine","openapi":"api-reference/openapi.json POST /images/uploads/prepare","href":"/it/api-reference/uploads/prepare"},{"title":"Completa un upload di immagine","openapi":"api-reference/openapi.json POST /images/uploads/{image_id}/complete","href":"/it/api-reference/uploads/complete"}]},{"group":"Modifica di immagini","pages":[{"title":"Modifica di immagini","sidebarTitle":"Panoramica","href":"/it/api-reference/edits/overview"},{"title":"Modifica un'immagine","openapi":"api-reference/openapi.json POST /images/edits","href":"/it/api-reference/edits/create"},{"title":"Ottieni una modifica di immagine","openapi":"api-reference/openapi.json GET /images/edits/{edit_id}","href":"/it/api-reference/edits/get-edit"}]},{"group":"Operazioni sulle immagini","pages":[{"title":"Operazioni sulle immagini","sidebarTitle":"Panoramica","href":"/it/api-reference/image-ops/overview"},{"title":"Trasformare immagini (img2img)","openapi":"api-reference/openapi.json POST /images/img2img","href":"/it/api-reference/image-ops/img2img"},{"title":"Recuperare un job img2img","openapi":"api-reference/openapi.json GET /images/img2img/{img2img_id}","href":"/it/api-reference/image-ops/get-img2img"},{"title":"Generare variazioni","openapi":"api-reference/openapi.json POST /images/variations","href":"/it/api-reference/image-ops/variations"},{"title":"Recuperare un job di variazioni","openapi":"api-reference/openapi.json GET /images/variations/{variation_id}","href":"/it/api-reference/image-ops/get-variations"},{"title":"Ingrandire un'immagine","openapi":"api-reference/openapi.json POST /images/upscales","href":"/it/api-reference/image-ops/upscale"},{"title":"Recuperare un job di upscale","openapi":"api-reference/openapi.json GET /images/upscales/{upscale_id}","href":"/it/api-reference/image-ops/get-upscale"},{"title":"Ridimensionare un'immagine","openapi":"api-reference/openapi.json POST /images/resizes","href":"/it/api-reference/image-ops/resize"},{"title":"Recuperare un job di ridimensionamento","openapi":"api-reference/openapi.json GET /images/resizes/{resize_id}","href":"/it/api-reference/image-ops/get-resize"},{"title":"Rimuovere uno sfondo","openapi":"api-reference/openapi.json POST /images/background-removals","href":"/it/api-reference/image-ops/remove-background"},{"title":"Recuperare un job di rimozione dello sfondo","openapi":"api-reference/openapi.json GET /images/background-removals/{background_removal_id}","href":"/it/api-reference/image-ops/get-background-removal"},{"title":"Vettorizzare un'immagine","openapi":"api-reference/openapi.json POST /images/vectorizations","href":"/it/api-reference/image-ops/vectorize"},{"title":"Recuperare un job di vettorizzazione","openapi":"api-reference/openapi.json GET /images/vectorizations/{vectorization_id}","href":"/it/api-reference/image-ops/get-vectorization"}]},{"group":"Generazione di video","pages":[{"title":"Generazione di video","sidebarTitle":"Panoramica","href":"/it/api-reference/videos/overview"},{"title":"Genera un video","openapi":"api-reference/openapi.json POST /videos/generations","href":"/it/api-reference/videos/generate"},{"title":"Ottieni una generazione di video","openapi":"api-reference/openapi.json GET /videos/generations/{generation_id}","href":"/it/api-reference/videos/get-generation"},{"title":"Elenca gli engine video","openapi":"api-reference/openapi.json GET /videos/models","href":"/it/api-reference/videos/list-engines"}]},{"group":"Miglioramento dei prompt","pages":[{"title":"Miglioramento dei prompt","sidebarTitle":"Panoramica","href":"/it/api-reference/prompts/overview"},{"title":"Migliorare un prompt","openapi":"api-reference/openapi.json POST /prompts/improve","href":"/it/api-reference/prompts/improve"}]},{"group":"Addestramento di modelli","pages":[{"title":"Addestramento di modelli","sidebarTitle":"Panoramica","href":"/it/api-reference/model-training/overview"},{"title":"Crea un modello","openapi":"api-reference/openapi.json POST /models","href":"/it/api-reference/model-training/create"},{"title":"Prepara l'upload di un modello","openapi":"api-reference/openapi.json POST /models/prepare","href":"/it/api-reference/model-training/prepare"},{"title":"Completa l'upload di un modello","openapi":"api-reference/openapi.json POST /models/{model_id}/complete","href":"/it/api-reference/model-training/complete"},{"title":"Ottieni lo stato del modello","openapi":"api-reference/openapi.json GET /models/{model_id}/status","href":"/it/api-reference/model-training/status"}]},{"group":"Modelli","pages":[{"title":"Modelli","sidebarTitle":"Panoramica","href":"/it/api-reference/models/overview"},{"title":"Elenca i modelli","openapi":"api-reference/openapi.json GET /models","href":"/it/api-reference/models/list"},{"title":"Ottieni un modello","openapi":"api-reference/openapi.json GET /models/{model_id}","href":"/it/api-reference/models/get"},{"title":"Aggiorna un modello","openapi":"api-reference/openapi.json PATCH /models/{model_id}","href":"/it/api-reference/models/update"},{"title":"Elimina un modello","openapi":"api-reference/openapi.json DELETE /models/{model_id}","href":"/it/api-reference/models/delete"}]},{"group":"Account \u0026 utilizzo","pages":[{"title":"Account \u0026 utilizzo","sidebarTitle":"Panoramica","href":"/it/api-reference/account/overview"},{"title":"Ottieni la chiave corrente (me)","description":"Ispeziona la chiave autenticata, la sua organizzazione e i credits disponibili.","openapi":"api-reference/openapi.json GET /me","href":"/it/api-reference/account/me"},{"title":"Ottieni i credits","openapi":"api-reference/openapi.json GET /credits","href":"/it/api-reference/account/credits"},{"title":"Ottieni l'utilizzo","description":"Leggi l'utilizzo dell'API della tua organizzazione, raggruppato per azione o per giorno.","openapi":"api-reference/openapi.json GET /usage","href":"/it/api-reference/account/usage"}]}]}]},{"tab":"MCP server","pages":[{"title":"MCP server","href":"/it/mcp-server"}]},{"tab":"Verifica dei contenuti","pages":[{"title":"Verifica dei contenuti","href":"/it/content-verification/overview"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/it/changelog"}]}]}]},"title":"Ottieni i credits - Samsa","buildId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","deploymentId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-Bbp7I60D.js","utils-C3RIvJha.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DqD-vLt8.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B31Loprg.js","snippetPresets-DKpk-b8t.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-Cj65AhOR.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BXtn5gcC.js","shallow-RY2b03Cp.js","getApiPlaygroundDisplay-B0jeiPk3.js","CodeSnippet-CYgBjjwn.js","CodeSnippets-DOngDrYB.js","Page-n7I5XbKb.js","getPastedJson-DRQbJx-T.js","icon-CQiQCicY.js","MethodPill-BKTLdNtu.js","DuplicateIcon-B9jpAdat.js","createIcon-DCddRrXv.js","DynamicMarkdown-a8hUKrw6.js","SectionHeading-eECVV2eH.js","axios-vUo_bRtp.js","Markdown--GF7ZIpf.js","clsx-DZLdJUrt.js","lib--scc4DXi.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-2LoAhjKH.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Zwc0ZncM.js"]}