@archastro/sdk
    Preparing search index...
    Index

    Constructors

    Properties

    evaluation: EvaluationResource

    Methods

    • Mint a principal-bound billing session token

      Parameters

      • input: {
            entitlement?: "llm_calls" | "run_automation";
            restrictions?: Record<string, unknown>;
            ttl?: number;
            user_id: string;
        }

        Request body.

      Returns Promise<{ expires_at: string; token: string }>

      Successful response

    • Read the authenticated user's LLM usage Returns the authenticated user's own LLM usage aggregated over a bounded time window. Each row carries request and token sums plus the customer-billed cost for the group. Cost is derived from the customer's active billing plan; provider-reported cost is never returned. Pass group_by one or more times to choose the grouping dimensions (task, model, agent_kind, agent_id, hour). The window (since to until) may span at most 31 days. Results are capped at limit groups.

      Parameters

      • Optionalparams: {
            groupBy?: ("model" | "task" | "agent_kind" | "agent_id" | "hour")[];
            limit?: number;
            since?: string;
            task?: string[];
            until?: string;
        }

        Query parameters.

        • OptionalgroupBy?: ("model" | "task" | "agent_kind" | "agent_id" | "hour")[]

          Grouping dimensions. Repeat for multiple dimensions (e.g. group_by[]=task&group_by[]=model). Defaults to model.

        • Optionallimit?: number

          Maximum number of groups to return. Defaults to 50; maximum is 200.

        • Optionalsince?: string

          Window start as an ISO 8601 timestamp (inclusive). Defaults to 7 days before until.

        • Optionaltask?: string[]

          Restrict results to these caller task IDs. Omit to include every task.

        • Optionaluntil?: string

          Window end as an ISO 8601 timestamp (inclusive). Defaults to now.

      Returns Promise<
          {
              data: {
                  agent_id?: string
                  | null;
                  agent_kind?: string | null;
                  billed_usd?: number | null;
                  cache_read_tokens: number;
                  cache_write_tokens: number;
                  completion_tokens: number;
                  hour?: string | null;
                  model?: string | null;
                  priced: boolean;
                  prompt_tokens: number;
                  requests: number;
                  task?: string | null;
              }[];
              since: string;
              until: string;
          },
      >

      Successful response