Skip to main content

synth_ai.research.account

client.research.account — org account, billing, usage, and BYOK reads. These backend routes live under /api/v1 (and /api/members), not under /smr, so this namespace calls them through the session client’s internal _request_json layer, which applies the same base URL and Authorization: Bearer <api_key> header as every other SDK call. Mutations are limited to BYOK key management and subscription.cancel.

Classes

AccountBalance

Typed BalanceResponse (org_id, balance_cents, balance_dollars). Methods:

from_wire

AccountTierLimits

Typed TierLimitsResponse (tier name plus its limits payload). Methods:

from_wire

AccountByokStatus

Typed BYOK status (byok_enabled, plan_type, provider key coverage). Methods:

from_wire

AccountReadinessCta

Typed AccountReadinessCta (call-to-action for a failing check). Methods:

from_wire

AccountReadinessCheck

Typed AccountReadinessCheck (one readiness gate with optional CTA). Methods:

from_wire

AccountReadiness

Typed AccountReadinessResponse (org-level launch readiness with CTAs). Methods:

from_wire

AccountIdentity

Typed MeResponse (org and user resolution for the API key). Methods:

from_wire

ResearchAccountBalanceAPI

Org credit balance and usage summary. Methods:

get

Read the current credit balance. Backend route: GET /api/v1/balance/current.

usage

Read the token/GPU usage summary. Backend route: GET /api/v1/balance/usage.

ResearchAccountCreditsAPI

Credits ledger reads. Methods:

transactions

List purchase/usage transactions, most recent first. Backend route: GET /api/v1/credits/transactions (query cursor, limit).

ResearchAccountTiersAPI

Default rate limits per subscription tier. Methods:

list

List default limits for all tiers. Backend route: GET /api/v1/usage/tiers.

get

Read default limits for one tier. Backend route: GET /api/v1/usage/tiers/&#123;tier&#125;.

ResearchAccountByokAPI

Bring-your-own-key provider key management. Methods:

list

List stored provider key metadata. Backend route: GET /api/v1/byok/keys.

create

Store a provider key (ciphertext encrypted with crypto.public_key). Backend route: POST /api/v1/byok/keys.

get

Read stored key metadata for one provider. Backend route: GET /api/v1/byok/keys/&#123;provider&#125;.

delete

Delete the stored key for one provider. Backend route: DELETE /api/v1/byok/keys/&#123;provider&#125;.

validate

Validate the stored key against the provider’s API. Backend route: POST /api/v1/byok/keys/&#123;provider&#125;/validate.

status

Read BYOK enablement and provider key coverage. Backend route: GET /api/v1/byok/status.

ApiKeyRedactedRow

Typed redacted key row (prefix + last4 only; never the secret). Methods:

from_wire

MintedApiKey

ONE-TIME mint/rotate result. key is the full sk_synth_user_... secret and is shown exactly once — the backend never returns it again (listings are redacted). Store it immediately; treat this object as sensitive material. Methods:

from_wire

ApiKeyDeactivated

Typed delete result (soft deactivation; the row is kept inactive). Methods:

from_wire

ResearchAccountKeysAPI

Synth API-key lifecycle (list redacted, mint, rotate, deactivate). Requires backend routes /api/v1/auth/keys (backend PR feat/api-key-lifecycle-routes-20260720); the caller’s API key is the principal, and every operation is scoped to that key’s (user, org). Methods:

list

List the caller’s active keys, redacted (prefix + last4 only). Backend route: GET /api/v1/auth/keys.

create

Mint a new key; the full secret is returned exactly once. Backend route: POST /api/v1/auth/keys. Returns 409 if an active key already exists (use :meth:rotate). name is refused by the backend today (no name column); pass it only once naming ships.

rotate

Rotate: deactivate key_id and mint a replacement. The old secret stops validating within the backend auth-cache TTL. Backend route: POST /api/v1/auth/keys/&#123;key_id&#125;/rotate. The new secret is returned exactly once.

delete

Deactivate key_id (soft delete; the backend keeps the row inactive). Backend route: DELETE /api/v1/auth/keys/&#123;key_id&#125;.

ResearchAccountMembersAPI

Org member listing. Methods:

list

List org members with app-user details. Backend route: GET /api/members (mounted with the /api prefix, not /api/v1; query limit, offset).

ResearchAccountSubscriptionAPI

Subscription lifecycle (cancel only). Methods:

cancel

Cancel the subscription at the end of the current billing period. Backend route: POST /api/v1/subscription/cancel.

ResearchAccountCryptoAPI

Public-key material for client-side key encryption. Methods:

public_key

Read the app public key used to encrypt BYOK keys. Backend route: GET /api/v1/crypto/public-key.

ResearchAccountAPI

Org account namespace: balance, credits, usage, BYOK, members, identity. Methods:

balance

Org credit balance and usage summary.

credits

Credits ledger transactions.

tiers

Default per-tier rate limits.

byok

Provider key (BYOK) management.

keys

Synth API-key lifecycle (list redacted / mint / rotate / deactivate).

members

Org member listing.

subscription

Subscription lifecycle (cancel).

crypto

Public-key material for BYOK encryption.

usage

Read current org usage counters. Backend route: GET /api/v1/usage.

user_limits

Read effective limits for the authenticated user. Backend route: GET /api/v1/usage/user-limits.

overview

Read the entitlements + usage + spend overview. Backend route: GET /api/v1/usage/overview (query days 1-365, include_projects).

readiness

Read org account readiness checks (balance, runway, tier headroom, BYOK). Backend route: GET /api/v1/account/readiness.

me

Resolve the org/user identity for the API key. Backend route: GET /api/v1/me.