workspace

Return usage metrics for the authenticated workspace.

Returns current-period cost, document count, and daily query count for the caller's workspace. All values are scoped to the tenant derived from the Bearer API key (RLS enforced). Response time target: p95 < 100ms.

get/v1/workspace/usage

Request

  • Base URL: https://api.andish.ru (the document declares no server; this is the origin it was published from)
  • URL: https://api.andish.ru/v1/workspace/usage
  • Auth: none declared

Response

Successful Response

periodstring required

ISO year-month for which usage is aggregated (e.g. '2026-04').

cost_current_rubstring required

Sum of cost_rub from usage_events for the current calendar month. Decimal-as-string per ADR-014 §Wire format.

cost_cap_rubstring nullable

Monthly cost cap in rubles (Decimal-as-string per ADR-014). Null means no cap (Enterprise). For a tier with a monthly ceiling (free: 300 RUB, ADR-083) this is the REAL ceiling the server enforces (402 cost_cap_monthly_exceeded). For every other tier it is the display-only approximation cost_cap_rub_daily × 30 — nothing checks it.

cost_cap_rub_dailystring nullable

Per-workspace daily cost cap in rubles (Decimal-as-string per ADR-014). Null means no cap (free_byok uses BYOK key — no managed LLM cost; Enterprise is invoiced separately). Non-null for free (30 RUB)/trial/start/team/business tiers.

percent_usednumber required

cost_current_rub / cost_cap_rub × 100. 0.0 when cap is null (Enterprise). May exceed 100 when overage.

documents_uploadedinteger

Places the workspace's documents take in the document limit: cards a person sees (simple documents and large documents, a large document counts once, not its parts), not deleted, status != 'failed'. Available immediately after upload — before indexing completes.

documents_processedinteger

Count of documents that can already be asked about: cards with status 'indexed', or a large document that is 'partial' with at least one indexed part. A large document counts once. Never above documents_uploaded; reaches it once indexing completes.

documents_currentinteger required

Count of completed documents in workspace (same number as documents_processed). Deprecated alias for documents_processed — kept for backward compat until 2026-06-01; use documents_processed instead.

documents_capinteger nullable

Document count cap for this tier (from TierConfig.docs_cap). Null for Enterprise (unlimited).

queries_todayinteger required

Number of queries issued today UTC (Redis counter).

queries_cap_dailyinteger nullable

Daily query cap for this tier (from TierConfig.queries_per_day). Null for Enterprise (unlimited).

tierstring required

Current tenant billing tier (US-29). One of: free, free_byok, trial, start, team, business, enterprise. free (ADR-083) has no end date; trial and free_byok are legacy values that migration 047 moves to free.

account_status'trial_active' | 'trial_expired' | 'active' required

Derived lifecycle state (ADR-058 §1). 'trial_active' — trial running (trial_ends_at in the future). 'trial_expired' — trial ended (or legacy NULL trial_ends_at); blocked unless a key is connected. 'active' — free (no end date, ADR-083), free_byok or any paid tier. Combine with byok_key_set to render the three /plan states without guessing.

trial_ends_atstring date-time nullable

Deprecated (ADR-083): trial expiry of a legacy trial. Null for every tenant on the free tier (no end date). Kept until the next API version (ADR-012).

byok_key_setboolean required

Whether the tenant has its own LLM provider configured (byok_provider IS NOT NULL — includes Ollama BYOK without a key).

storage_used_bytesinteger required

Live sum of stored document ciphertext bytes (non-failed, non-deleted documents).

storage_cap_bytesinteger nullable

Hard storage cap in bytes for this tier (ADR-058 §5; 500 MB for free/trial/free_byok). Null for Enterprise (unlimited).

file_size_cap_mbinteger nullable

Per-file upload size cap in MB for this tier (TierConfig.file_size_cap_mb). Null = unlimited (Enterprise).

next_reset_atstring date-time required

Next UTC midnight when monthly cost period resets.

documents_never_queriedinteger

Count of documents with last_queried_at IS NULL (never cited by any query).

documents_quiet_90dinteger

Count of documents not cited in the last 90 days (last_queried_at < now - 90 days, or never queried).

Changes

No recorded changes to this operation across all 1 revision of this API.