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

# Set registry auth

> Stores or replaces the credentials used when this server talks to the registry. The method must match the registry's well-known auth advertisement: a mismatch or an unsupported method fails with 400 and nothing is stored. Credentials are encrypted at rest with AES-256-GCM. For oauth2, a client-credentials token is exchanged immediately; transport policy refusals (non-https token endpoint outside the loopback/insecure-CIDR allowlist) fail with 400, while exchange failures store the credentials and report error status.



## OpenAPI

````yaml /openapi.json post /registries/{id}/auth
openapi: 3.0.0
info:
  title: Cyrnel API
  description: >-
    Cyrnel is a universal layer that connects AI agents and LLM applications to
    any external service, API, or device regardless of protocol or standard. It
    acts as an adaptive bridge between your AI and the outside world, enabling
    seamless integrations through code execution, async operation handling, and
    built-in observability and security controls.
  version: 1.0.0
servers:
  - url: http://localhost:9371
security: []
paths:
  /registries/{id}/auth:
    post:
      tags:
        - Registries
      summary: Set registry auth
      description: >-
        Stores or replaces the credentials used when this server talks to the
        registry. The method must match the registry's well-known auth
        advertisement: a mismatch or an unsupported method fails with 400 and
        nothing is stored. Credentials are encrypted at rest with AES-256-GCM.
        For oauth2, a client-credentials token is exchanged immediately;
        transport policy refusals (non-https token endpoint outside the
        loopback/insecure-CIDR allowlist) fail with 400, while exchange failures
        store the credentials and report error status.
      parameters:
        - schema:
            type: string
            minLength: 1
            description: Registry slug identifying the registry.
          required: true
          description: Registry slug identifying the registry.
          name: id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegistryAuthSetup'
      responses:
        '200':
          description: The credentials were stored.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegistryAuthSetupResponse'
        '400':
          description: >-
            The request body was invalid, the method does not match the
            registry's advertisement, a requested scope is not advertised, or
            transport policy refused the credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '401':
          description: A bearer token was required but missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: The registry could not be found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '429':
          description: >-
            Rate limit exceeded. The request was throttled. Check Retry-After
            header.
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Maximum requests allowed in the current window.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Requests remaining in the current window.
            X-RateLimit-Reset:
              schema:
                type: integer
              description: Unix timestamp when the window resets.
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: The credentials could not be stored.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '502':
          description: The registry or its token endpoint could not be reached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
components:
  schemas:
    RegistryAuthSetup:
      oneOf:
        - $ref: '#/components/schemas/ApiKeyAuthSetup'
        - $ref: '#/components/schemas/OAuthAuthSetup'
      discriminator:
        propertyName: type
        mapping:
          apiKey:
            $ref: '#/components/schemas/ApiKeyAuthSetup'
          oauth2:
            $ref: '#/components/schemas/OAuthAuthSetup'
      description: >-
        Credentials used when the server talks to the registry. The token
        endpoint (oauth2) and header name (apiKey) always come from the
        registry's well-known advertisement, never from this request.
    RegistryAuthSetupResponse:
      type: object
      properties:
        auth:
          $ref: '#/components/schemas/RegistryAuthResult'
      required:
        - auth
      description: Response body of a registry auth setup request.
    ApiErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message returned by the API.
        code:
          type: string
          description: >-
            Stable machine-readable error code (e.g. invalid_cursor,
            cursor_expired).
      required:
        - error
      description: Standard error envelope returned by the HTTP error middleware.
    RateLimitErrorResponse:
      type: object
      properties:
        error:
          type: string
          enum:
            - rate_limit_exceeded
          description: Error code identifying rate-limit rejection.
        message:
          type: string
          description: Human-readable message with retry instructions.
        retryAfter:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: Number of seconds to wait before retrying.
      required:
        - error
        - message
        - retryAfter
      description: Error body returned when a request is rate-limited (HTTP 429).
    ApiKeyAuthSetup:
      type: object
      properties:
        type:
          type: string
          enum:
            - apiKey
          description: API key authentication; the key is sent in a fixed header.
        apiKey:
          type: string
          minLength: 1
          description: >-
            API key sent in the header named by the registry's well-known auth
            advertisement.
      required:
        - type
        - apiKey
      description: API key credentials for a registry.
    OAuthAuthSetup:
      type: object
      properties:
        type:
          type: string
          enum:
            - oauth2
          description: OAuth2 client-credentials authentication.
        clientId:
          type: string
          minLength: 1
          description: OAuth2 client id.
        clientSecret:
          type: string
          minLength: 1
          description: OAuth2 client secret.
        scopes:
          type: array
          items:
            type: string
            minLength: 1
          description: >-
            Optional requested scopes; each must be one of the scopes advertised
            by the registry. Defaults to all advertised scopes when omitted.
      required:
        - type
        - clientId
        - clientSecret
      description: OAuth2 client-credentials for a registry.
    RegistryAuthResult:
      type: object
      properties:
        type:
          type: string
          enum:
            - apiKey
            - oauth2
        status:
          type: string
          enum:
            - configured
            - error
          description: >-
            configured when credentials were successfully stored; error when
            storage or validation failed.
        headerName:
          type: string
          nullable: true
          description: >-
            Header the api key is sent in, when the registry advertises api key
            auth.
        tokenExpiresAt:
          type: number
          nullable: true
          description: >-
            Epoch-ms timestamp when the fetched access token expires, when the
            registry advertises oauth2.
        message:
          type: string
          nullable: true
          description: Human-readable detail when status is error.
      required:
        - type
        - status
      description: Outcome of storing credentials for a registry.

````