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

> ## Agent Instructions
> Company name is Akhara AI (never Rubric AI). Keep lowercase rubric/rubrics only when meaning grading criteria.
> Expert Review (docs path talent/) is enterprise BYO experts for audit and review: invite customer specialists; do not pitch Akhara recruiting or a public expert career portal. RLHF and domain writing are secondary work types.
> Prefer concrete API examples against public hosts: Environments eval API https://agi.akhara.ai, Control plane PDP https://api.akhara.dev, Evaluation https://app.akhara.ai / https://api.akhara.ai, Expert Review portal https://talent.akhara.ai.
> Do not invent a public hostname for private orchestrators or env API internals.
> Do not confuse control-plane latches with Environments confirmation latches.
> Environments SDK/API examples: curl against https://agi.akhara.ai. Evaluation SDK: from akhara import Akhara and AKHARA_API_KEY.
> Start with /llms.txt for the docs index and OpenAPI links; fetch individual pages as .md exports.

# Create / connect an agent

Registers a workspace agent. The `apiKey` you send is stored server-side and
never returned. Equivalent to `akhara agents connect`. See
[Agent onboarding](/control-plane/onboarding/agents).


## OpenAPI

````yaml control-plane/api-reference/openapi.json POST /api/agents
openapi: 3.1.0
info:
  title: Akhara Control Plane API
  version: 1.0.0
  description: >-
    The Policy Decision Point (PDP) API. Enforcement clients call
    `/api/policy/authorize`; the management endpoints onboard agents, attach
    policies, and read the evidence trail.
servers:
  - url: https://api.akhara.dev
    description: Production PDP API
  - url: https://console.akhara.dev
    description: Managed console
security:
  - apiKey: []
paths:
  /api/agents:
    post:
      tags:
        - Agents
      summary: Create / connect an agent
      operationId: createAgent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAgentRequest'
            example:
              id: support-ai
              name: Support Copilot
              source: url
              baseUrl: https://your-agent.internal.akhara.dev
              apiKey: ak_live_…
              tools:
                - order_status
                - update_account
                - refund_payment
                - send_external_email
              categories:
                - support
      responses:
        '200':
          description: The created agent (secrets stripped).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
components:
  schemas:
    CreateAgentRequest:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
        name:
          type: string
        source:
          type: string
          enum:
            - builtin
            - url
            - github
            - fork
        baseUrl:
          type: string
        apiKey:
          type: string
          description: Stored server-side; never returned.
        githubUrl:
          type: string
        tools:
          type: array
          items:
            type: string
        categories:
          type: array
          items:
            type: string
        policyIds:
          type: array
          items:
            type: string
    Agent:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        source:
          type: string
          enum:
            - builtin
            - url
            - github
            - fork
        status:
          type: string
        baseUrl:
          type: string
        apiKeyMasked:
          type: string
          example: ak_live_••••4f2a
        categories:
          type: array
          items:
            type: string
        tools:
          type: array
          items:
            type: string
        policyIds:
          type: array
          items:
            type: string
        runtime:
          $ref: '#/components/schemas/Runtime'
        createdAt:
          type: integer
        updatedAt:
          type: integer
    Runtime:
      type: object
      properties:
        status:
          type: string
        boundary:
          type: string
          example: android-emulator
        env:
          type: object
          additionalProperties:
            type: string
          example:
            GATEWAY: https://api.akhara.dev
        provisionedAt:
          type: integer
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: Workspace API key (ak_live_…).

````