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

# Test the saved BYOK key end-to-end



## OpenAPI

````yaml https://app.autousers.ai/api/v1/openapi.json post /api/v1/settings/byok/test
openapi: 3.1.0
info:
  title: Autousers API
  version: v1
  description: >-
    REST API for autousers — evaluations, templates (question sets), autouser
    personas, ratings, files, teams, and more. Authenticate with an `ak_live_*`
    API key (preferred for server-to-server) or an OAuth 2.1 audience-bound JWT.
  contact:
    name: Autousers
    email: support@autousers.ai
    url: https://docs.autousers.ai
  license:
    name: Proprietary
servers:
  - url: https://app.autousers.ai
    description: Production
  - url: http://localhost:3000
    description: Local dev
security:
  - bearerAuth: []
tags:
  - name: Evaluations
    description: Create, list, run, and inspect UX evaluations.
  - name: Ratings
    description: Per-comparison rating reads + writes.
  - name: Shares
    description: Direct evaluation shares.
  - name: Invites
    description: Email-invite lifecycle for evaluation reviewers.
  - name: Access Requests
    description: Inbox + approve/decline flow for `ANYONE_WITH_LINK` evaluations.
  - name: Autousers
    description: Autouser personas + calibration.
  - name: Templates
    description: Question-set templates (canonical noun).
  - name: Dimensions (deprecated)
    description: >-
      Legacy alias of /templates. Sunsets 2027-04-04; new integrations should
      use /templates.
  - name: Conversations
    description: Builder-chat conversation primitives.
  - name: Files
    description: Stimulus uploads (multipart + signed-URL flows).
  - name: Teams
    description: Teams, members, role transfers.
  - name: Notifications
    description: In-product notification feed.
  - name: API Keys
    description: Mint and revoke `ak_live_*` API keys (session only).
  - name: OAuth
    description: OAuth 2.1 connected-app management (session only).
  - name: Settings
    description: BYOK key storage + probes.
  - name: Auth
    description: Identity fan-in (`whoami`).
  - name: Usage
    description: Plan + quota self-service.
  - name: Link Preview
    description: Figma-plugin link-preview helper.
  - name: Webhooks
    description: >-
      Public webhook delivery system. Currently in beta and gated behind a
      deployment-level flag — endpoints respond with 503 "feature_not_available"
      until the operator enables it.
  - name: Events
    description: >-
      Stripe-style event log (replay + polling fallback). Same gating as
      Webhooks: 503 "feature_not_available" until the operator enables the flag.
paths:
  /api/v1/settings/byok/test:
    post:
      tags:
        - Settings
      summary: Test the saved BYOK key end-to-end
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
        - $ref: '#/components/parameters/AutousersVersion'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties: {}
              additionalProperties: {}
      responses:
        '200':
          description: OK
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                type: object
                properties: {}
                additionalProperties: {}
        '400':
          description: Invalid request
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '401':
          description: Authentication required
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '403':
          description: Forbidden — missing scope or plan-tier gate
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '404':
          description: Not found
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '409':
          description: Conflict (e.g. idempotency_key_reused)
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '429':
          description: Rate limited
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '500':
          description: Server error
          headers:
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
      security:
        - bearerAuth: []
components:
  parameters:
    IdempotencyKey:
      schema:
        $ref: '#/components/schemas/IdempotencyKey'
      required: false
      description: >-
        Client-generated idempotency key (≤255 chars). Replays the cached
        response when the same `(team, key)` pair sees an identical request body
        within 24h; returns 409 `idempotency_key_reused` if the body differs.
        Recommended for every billable POST.
      name: Idempotency-Key
      in: header
    AutousersVersion:
      schema:
        $ref: '#/components/schemas/AutousersVersion'
      required: false
      description: >-
        Date-pinned API version (e.g. `2026-05-04`). Omit to receive the latest
        stable version. Behaves like Stripe's `Stripe-Version` — pinning a
        version freezes payload shapes against breaking changes during the
        12-month sunset window.
      name: Autousers-Version
      in: header
  headers:
    X-Request-Id:
      description: >-
        uuid v7 mirror of `error.request_id`. Always present on every response.
        Echo this in support requests for forensic correlation.
      schema:
        type: string
    X-RateLimit-Limit:
      description: >-
        Max requests allowed in the current sliding window (set by the team's
        plan tier).
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests remaining in the current sliding window.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: >-
        Unix epoch seconds at which the current window resets and a new full
        quota becomes available.
      schema:
        type: integer
    Retry-After:
      description: >-
        Seconds the client should wait before retrying. Sent on `429
        rate_limit_error` and on `503 Service Unavailable`.
      schema:
        type: integer
  schemas:
    ApiErrorBody:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              enum:
                - authentication_error
                - authorization_error
                - invalid_request_error
                - not_found_error
                - rate_limit_error
                - api_error
            code:
              type: string
            param:
              type: string
            doc_url:
              type: string
            request_id:
              type: string
              description: uuid v7 — also exposed via the X-Request-Id header
          required:
            - message
            - type
            - request_id
      required:
        - error
    IdempotencyKey:
      type: string
      maxLength: 255
    AutousersVersion:
      type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: >-
        One of: 'ak_live_<random>' API key (scoped, team-bound) — preferred for
        server-to-server; 'Autousers-Version'-aware OAuth 2.1 audience-bound
        HS256 JWT (RFC 8707); or a Figma plugin JWT. See lib/api-auth.ts.

````