> ## 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.

# SDK profile

> What the SDK keeps in its local cache: the features on, the source's tool bindings, the summarized type registry, the claim contract and how turns are recorded. With an ETag.



## OpenAPI

````yaml openapi/en/cell.json GET /v1/sdk/profile
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/sdk/profile:
    get:
      tags:
        - state
      summary: SDK profile
      description: >-
        What the SDK keeps in its local cache, from the configuration alone: no
        database, no receipt.


        **Authentication.** Any source key, whatever its scopes: `Authorization:
        Bearer nia_sk_...`.
      operationId: sdk_profile_v1_sdk_profile_get
      parameters:
        - in: header
          name: if-none-match
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: If-None-Match
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SdkProfile'
          description: Successful Response
        '304':
          description: The profile behind `If-None-Match` is still current.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security: []
      x-codeSamples:
        - lang: python
          label: Python
          source: >-
            # Read once at start and again when valid_for_s runs out; the last
            profile stays in use when Niadra is down

            profile = niadra.profile()

            if profile and "turns" in profile.features:
                ...
        - lang: typescript
          label: TypeScript
          source: >-
            // Read once at start and again when valid_for_s runs out; the last
            profile stays in use when Niadra is down

            const profile = await niadra.profile();

            if (profile?.features.includes("turns")) {
              // ...
            }
components:
  schemas:
    SdkProfile:
      additionalProperties: false
      description: >-
        What the SDK keeps in its local cache: the features on, the source's
        tool bindings, the summarized

        type registry, the claim contract and turn recording.
      properties:
        claim_contract:
          anyOf:
            - $ref: '#/components/schemas/ClaimContractSummary'
            - type: 'null'
        features:
          items:
            $ref: '#/components/schemas/Feature'
          title: Features
          type: array
        recording:
          anyOf:
            - $ref: '#/components/schemas/TurnRecordingSummary'
            - type: 'null'
          description: How this source records turns, once the space records them.
        tool_bindings:
          description: The bindings of the tools this source's agents call.
          items:
            $ref: '#/components/schemas/ToolBinding'
          title: Tool Bindings
          type: array
        types:
          items:
            additionalProperties: true
            type: object
          title: Types
          type: array
        valid_for_s:
          title: Valid For S
          type: integer
      required:
        - features
        - valid_for_s
      title: SdkProfile
      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
    ClaimContractSummary:
      additionalProperties: false
      description: >-
        The contract as the SDK keeps it: everything but the negative corpus's
        phrases, which only the CI's

        `niadra contract test` reads, from the company's own copy.
      properties:
        categories:
          items:
            $ref: '#/components/schemas/ClaimCategory'
          title: Categories
          type: array
        internal_text:
          anyOf:
            - $ref: '#/components/schemas/InternalText'
            - type: 'null'
        languages:
          items:
            enum:
              - pt
              - en
              - es
            type: string
          title: Languages
          type: array
        negative_corpus_version:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          title: Negative Corpus Version
        outputs:
          $ref: '#/components/schemas/ClaimOutputs'
        version:
          maxLength: 256
          minLength: 1
          title: Version
          type: string
      required:
        - version
        - languages
      title: ClaimContractSummary
      type: object
    Feature:
      description: >-
        The agent features a space turns on: everything is off until the space's
        `features`

        document lists it, and `GET /v1/sdk/profile` announces what is on.
      enum:
        - turns
        - state
        - agent_state
        - signals
        - claims
        - coordination
        - measurement
        - notifications
        - legal_holds
      title: Feature
      type: string
    TurnRecordingSummary:
      additionalProperties: false
      description: >-
        How the calling source records turns, for the SDK's capture: where the
        values may live, and the pins

        a turn needs to be replayable.
      properties:
        content_mode:
          description: >-
            `stored`, `pointer` or `hash_only`; a turn may keep less, never
            more.
          enum:
            - stored
            - pointer
            - hash_only
          title: Content Mode
          type: string
        required_pins:
          description: Without one of these, a turn is kept not replayable.
          items:
            enum:
              - prompts
              - corpus_digest
              - model
              - assembler
              - tool_schemas
            type: string
          title: Required Pins
          type: array
      required:
        - content_mode
        - required_pins
      title: TurnRecordingSummary
      type: object
    ToolBinding:
      additionalProperties: false
      properties:
        args:
          items:
            $ref: '#/components/schemas/BoundArg'
          maxItems: 50
          title: Args
          type: array
        capabilities:
          $ref: '#/components/schemas/ToolCapabilities'
        results:
          items:
            $ref: '#/components/schemas/ResultObjects'
          maxItems: 10
          title: Results
          type: array
        tool:
          pattern: ^[A-Za-z0-9_][A-Za-z0-9_.:/-]{0,63}$
          title: Tool
          type: string
      required:
        - tool
      title: ToolBinding
      type: object
    ClaimCategory:
      additionalProperties: false
      properties:
        actions:
          $ref: '#/components/schemas/Actions'
        agents:
          description: 'Empty: every agent.'
          items:
            maxLength: 256
            minLength: 1
            type: string
          maxItems: 50
          title: Agents
          type: array
        detect:
          $ref: '#/components/schemas/Detect'
        evidence:
          $ref: '#/components/schemas/ClaimEvidence'
        id:
          pattern: ^[a-z][a-z0-9_]{0,39}$
          title: Id
          type: string
        natures:
          $ref: '#/components/schemas/Natures'
      required:
        - id
        - detect
        - evidence
        - actions
      title: ClaimCategory
      type: object
    InternalText:
      additionalProperties: false
      description: >-
        Fingerprints of the company's own prompt: hashes of every `n` words,
        computed by the SDK, never the

        prompt itself. An output that repeats one gives way to `redact`,
        recorded as a claim of the category

        `internal_text` with the verdict `internal_text_found`, the action taken
        and, as evidence, the

        `shingle_hashes_ref` in `document`.
      properties:
        'n':
          default: 8
          maximum: 32
          minimum: 4
          title: 'N'
          type: integer
        redact:
          maxLength: 200
          minLength: 1
          title: Redact
          type: string
        shingle_hashes_ref:
          description: The prompt version the hashes were computed from.
          maxLength: 256
          minLength: 1
          title: Shingle Hashes Ref
          type: string
      required:
        - shingle_hashes_ref
        - redact
      title: InternalText
      type: object
    ClaimOutputs:
      additionalProperties: false
      properties:
        immutable:
          items:
            pattern: ^[a-z][a-z0-9_]{0,39}$
            type: string
          maxItems: 32
          title: Immutable
          type: array
        mutable:
          items:
            pattern: ^[a-z][a-z0-9_]{0,39}$
            type: string
          maxItems: 32
          title: Mutable
          type: array
      title: ClaimOutputs
      type: object
    BoundArg:
      additionalProperties: false
      description: >-
        One argument of the tool and the field it carries. `in` and `eq` render
        to `param`, `not_in` and `ne`

        to the negation's, and a comparison or `between` only when `ops` lists
        it.
      properties:
        attr:
          description: The field, as `type.field`.
          pattern: ^[a-z][a-z0-9_]{0,39}\.[a-z][a-z0-9_]{0,63}$
          title: Attr
          type: string
        negation:
          anyOf:
            - $ref: '#/components/schemas/Negation'
            - type: 'null'
        ops:
          items:
            enum:
              - in
              - not_in
              - eq
              - ne
              - lt
              - lte
              - gt
              - gte
              - between
            type: string
          maxItems: 9
          title: Ops
          type: array
        param:
          pattern: ^[A-Za-z_][A-Za-z0-9_.-]{0,63}$
          title: Param
          type: string
        transform:
          anyOf:
            - enum:
                - lower
                - upper
              type: string
            - type: 'null'
          description: The case text is sent in.
          title: Transform
      required:
        - attr
        - param
      title: BoundArg
      type: object
    ToolCapabilities:
      additionalProperties: false
      properties:
        dry_run_param:
          anyOf:
            - pattern: ^[A-Za-z_][A-Za-z0-9_.-]{0,63}$
              type: string
            - type: 'null'
          description: The argument that makes a call change nothing, for a counterfactual.
          title: Dry Run Param
        mask_output:
          default: false
          description: The SDK masks the fields the key may not read in the tool's output.
          title: Mask Output
          type: boolean
        overfetch:
          default: false
          description: >-
            The tool returns more than asked: the SDK filters the residual from
            it.
          title: Overfetch
          type: boolean
        relax_flag:
          anyOf:
            - maxLength: 256
              pattern: ^\$?(\.?[A-Za-z_][A-Za-z0-9_-]*(\[\*\])?)*$
              type: string
            - type: 'null'
          description: Where the result says the tool relaxed what it was asked.
          title: Relax Flag
      title: ToolCapabilities
      type: object
    ResultObjects:
      additionalProperties: false
      description: >-
        Where a result carries objects of a type, and which key of each item
        holds which field.
      properties:
        fields:
          maxProperties: 100
          patternProperties:
            ^[a-z][a-z0-9_]{0,63}$:
              pattern: ^[A-Za-z_][A-Za-z0-9_-]{0,63}$
              type: string
          title: Fields
          type: object
        id:
          default: id
          description: The key of the item that holds the object's id.
          pattern: ^[A-Za-z_][A-Za-z0-9_-]{0,63}$
          title: Id
          type: string
        namespace:
          pattern: ^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$
          title: Namespace
          type: string
        path:
          default: $
          maxLength: 256
          pattern: ^\$?(\.?[A-Za-z_][A-Za-z0-9_-]*(\[\*\])?)*$
          title: Path
          type: string
        type:
          pattern: ^[a-z][a-z0-9_]{0,39}$
          title: Type
          type: string
      required:
        - type
        - namespace
      title: ResultObjects
      type: object
    Actions:
      additionalProperties: false
      description: >-
        What happens to a claim that does not stand, by the task's context (an
        output kind or a document kind);

        `default` for any other. A context the contract lists as immutable is
        never rewritten.
      properties:
        contexts:
          maxProperties: 32
          patternProperties:
            ^[a-z][a-z0-9_]{0,39}$:
              enum:
                - block
                - warn
                - count
                - rewrite_if_unequivocal
                - discard_anchor_and_count
              type: string
          title: Contexts
          type: object
        default:
          enum:
            - block
            - warn
            - count
            - rewrite_if_unequivocal
            - discard_anchor_and_count
          title: Default
          type: string
        replace_with:
          anyOf:
            - maxLength: 500
              minLength: 1
              type: string
            - type: 'null'
          description: The caveat a blocked passage gives way to, in a mutable output.
          title: Replace With
      required:
        - default
      title: Actions
      type: object
    Detect:
      additionalProperties: false
      description: >-
        How a category finds its claims in the text, without a model: numbers of
        these classes, the words

        around them that give their role, terms of the trade, named patterns, or
        sections of a document.
      properties:
        classes:
          items:
            enum:
              - money
              - percent
              - date
              - duration
              - quantity
              - count
              - dosage
            type: string
          maxItems: 7
          title: Classes
          type: array
        document_sections:
          items:
            pattern: ^[a-z][a-z0-9_]{0,39}$
            type: string
          maxItems: 20
          title: Document Sections
          type: array
        patterns:
          items:
            enum:
              - article_citation
              - precedent_citation
            type: string
          title: Patterns
          type: array
        roles:
          description: >-
            The words that give a number its role, synonyms and every language
            in one list.
          maxProperties: 32
          patternProperties:
            ^[a-z][a-z0-9_]{0,39}$:
              items:
                maxLength: 80
                minLength: 1
                type: string
              type: array
          title: Roles
          type: object
        terms:
          description: >-
            With `classes`, a number counts only in a sentence that holds one of
            them; alone, the term is the claim.
          items:
            maxLength: 80
            minLength: 1
            type: string
          maxItems: 100
          title: Terms
          type: array
      title: Detect
      type: object
    ClaimEvidence:
      additionalProperties: false
      description: >-
        What the turn record must hold for a claim of the category to stand:
        exactly one kind.
      properties:
        anchor:
          anyOf:
            - $ref: '#/components/schemas/AnchorEvidence'
            - type: 'null'
        tool:
          anyOf:
            - pattern: ^[A-Za-z][A-Za-z0-9_.:-]{0,63}$
              type: string
            - type: 'null'
          description: A call of this tool in the turn.
          title: Tool
        tool_any:
          items:
            pattern: ^[A-Za-z][A-Za-z0-9_.:-]{0,63}$
            type: string
          maxItems: 20
          title: Tool Any
          type: array
        value:
          anyOf:
            - $ref: '#/components/schemas/ValueEvidence'
            - type: 'null'
      title: ClaimEvidence
      type: object
    Natures:
      additionalProperties: false
      description: >-
        How a number is handled by where it came from: computed (a value with
        provenance in the turn, by rule

        or observed) is checked against it; quoted (inside quotation marks) is
        checked only for being in a source,

        as written, even when it is false; said by the model (no origin) takes
        this action, or the category's.
      properties:
        computed:
          default: check
          enum:
            - check
            - count
          title: Computed
          type: string
        model:
          anyOf:
            - enum:
                - block
                - warn
                - count
              type: string
            - type: 'null'
          title: Model
        quoted:
          default: verbatim
          enum:
            - verbatim
            - count
          title: Quoted
          type: string
      title: Natures
      type: object
    Negation:
      additionalProperties: false
      properties:
        param:
          description: The argument that takes the values the field must not have.
          pattern: ^[A-Za-z_][A-Za-z0-9_.-]{0,63}$
          title: Param
          type: string
      required:
        - param
      title: Negation
      type: object
    AnchorEvidence:
      additionalProperties: false
      properties:
        coverage:
          description: 'Counted apart: law and fact never add up.'
          enum:
            - fact
            - law
          title: Coverage
          type: string
        min_match:
          default: 0.9
          maximum: 1
          minimum: 0.9
          title: Min Match
          type: number
      required:
        - coverage
      title: AnchorEvidence
      type: object
    ValueEvidence:
      additionalProperties: false
      description: >-
        A value in the turn record, from a tool's result or from state, that the
        number is checked against.
      properties:
        fresh_for:
          anyOf:
            - const: claim
              type: string
            - type: 'null'
          description: >-
            The value is within its type's `claim_max_age`, or the claim is
            `stale`.
          title: Fresh For
        gap_terms:
          description: >-
            The words that state each declared gap; a gap without them is stated
            by its name.
          maxProperties: 32
          patternProperties:
            ^[a-z][a-z0-9_]{0,39}$:
              items:
                maxLength: 80
                minLength: 1
                type: string
              type: array
          title: Gap Terms
          type: object
        must_state_gaps:
          default: false
          description: The value's declared gaps must be said with it, or `gap_not_stated`.
          title: Must State Gaps
          type: boolean
        same_role:
          default: false
          description: The value's role is the number's role.
          title: Same Role
          type: boolean
        type:
          anyOf:
            - pattern: ^[a-z][a-z0-9_]{0,39}$
              type: string
            - type: 'null'
          title: Type
        value:
          anyOf:
            - pattern: ^[a-z][a-z0-9_]{0,39}$
              type: string
            - type: 'null'
          description: A field or a computed value of `type`.
          title: Value
      title: ValueEvidence
      type: object

````