> ## Documentation Index
> Fetch the complete documentation index at: https://docs.niadra.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Compute power

> How many days of the space's traffic a relative difference needs to be detected, looked at once or every day.



## OpenAPI

````yaml openapi/en/cell.json POST /v1/measure/power
openapi: 3.1.0
info:
  title: Niadra data API
  version: '1'
  description: >-
    Writing, context, history, objects, identity, privacy and governance of one
    space. Every space has a stable address, with the space and the region in
    its name.
servers:
  - url: https://{space}.{region}.api.niadra.com
    variables:
      space:
        default: acme-prod
        description: The space, which comes in the source key.
      region:
        default: us-east-2
        description: The region of the space, which also comes in the key.
security: []
paths:
  /v1/measure/power:
    post:
      tags:
        - signals
      summary: Compute power
      description: >-
        How many days of the space's traffic a relative difference needs, looked
        at once or every day.


        **Authentication.** Console person token with the `analysis` role (or
        admin), or a source key with the `admin` scope. It answers only in a
        space with the `measurement` feature on (the `features` document); in a
        space without it, 404.
      operationId: power_v1_measure_power_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PowerRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PowerResult'
          description: Successful Response
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - sourceKey: []
        - personToken: []
components:
  schemas:
    PowerRequest:
      additionalProperties: false
      description: >-
        How long the space's traffic takes to detect a difference of `effect`
        (relative: 0.1 is 10%) on

        `metric`. The traffic and the baseline come from the space's history,
        the named experiment's or the

        busiest one's of the last 28 days, unless given.
      properties:
        alpha:
          default: 0.05
          exclusiveMinimum: 0
          maximum: 0.2
          title: Alpha
          type: number
        baseline_mean:
          anyOf:
            - minimum: 0
              type: number
            - type: 'null'
          description: 'Per person: a rate for `conversion`, minor units for `value`.'
          title: Baseline Mean
        baseline_sd:
          anyOf:
            - exclusiveMinimum: 0
              type: number
            - type: 'null'
          description: Per person, for `value`; a rate's follows from its mean.
          title: Baseline Sd
        control_fraction:
          default: 0.5
          exclusiveMaximum: 1
          exclusiveMinimum: 0
          title: Control Fraction
          type: number
        daily_people:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          description: New people a day entering the test.
          title: Daily People
        effect:
          description: 'The relative difference to detect: 0.1 is 10%.'
          exclusiveMinimum: 0
          maximum: 10
          title: Effect
          type: number
        experiment:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          description: The experiment whose history to use.
          title: Experiment
        metric:
          default: conversion
          enum:
            - conversion
            - value
          title: Metric
          type: string
        power:
          default: 0.8
          exclusiveMaximum: 1
          minimum: 0.5
          title: Power
          type: number
      required:
        - effect
      title: PowerRequest
      type: object
    PowerResult:
      additionalProperties: false
      properties:
        baseline_from:
          enum:
            - given
            - history
          title: Baseline From
          type: string
        baseline_mean:
          title: Baseline Mean
          type: number
        baseline_sd:
          title: Baseline Sd
          type: number
        daily_people:
          title: Daily People
          type: number
        days:
          anyOf:
            - type: integer
            - type: 'null'
          description: At a fixed horizon, looked at once, at the end.
          title: Days
        days_sequential:
          anyOf:
            - type: integer
            - type: 'null'
          title: Days Sequential
        effect:
          title: Effect
          type: number
        experiment:
          anyOf:
            - type: string
            - type: 'null'
          description: The experiment whose history was used.
          title: Experiment
        metric:
          enum:
            - conversion
            - value
          title: Metric
          type: string
        people:
          anyOf:
            - type: integer
            - type: 'null'
          description: Both arms together, at a fixed horizon.
          title: People
        people_sequential:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Both arms together, for the daily-looked sequential test to have
            decided with `power`.
          title: People Sequential
        traffic_from:
          enum:
            - given
            - history
          title: Traffic From
          type: string
      required:
        - metric
        - effect
        - baseline_mean
        - baseline_sd
        - daily_people
        - people
        - days
        - people_sequential
        - days_sequential
        - traffic_from
        - baseline_from
      title: PowerResult
      type: object
    Problem:
      additionalProperties: false
      description: RFC 9457 problem details; `code` comes from the versioned error catalog.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````