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

# Register Agent

> Creates a new AI agent with API configuration.



## OpenAPI

````yaml POST /protocol/agents
openapi: 3.1.0
info:
  title: Nevermined API
  description: >-
    API for managing AI agents, payment plans, and x402 payments in the
    Nevermined ecosystem.


    ## Prerequisites


    You need a Nevermined API Key to authenticate. Get one at
    [nevermined.app](https://nevermined.app) under **Settings > API Keys**.


    See the [5-Minute Setup Guide](/docs/integrate/quickstart/5-minute-setup)
    for detailed instructions.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.sandbox.nevermined.app/api/v1
    description: Sandbox (Testing) - Base Sepolia
  - url: https://api.live.nevermined.app/api/v1
    description: Live (Production) - Base Mainnet
security:
  - bearerAuth: []
tags:
  - name: Protocol - Agents
    description: Endpoints for registering and managing AI agents
  - name: Protocol - Plans
    description: Endpoints for creating and managing payment plans
  - name: Protocol - Credits
    description: Endpoints for minting and redeeming credits
  - name: Protocol - Access
    description: Endpoints for access tokens and request validation
  - name: X402 - Permissions
    description: Endpoints for x402 delegated permissions
paths:
  /protocol/agents:
    post:
      tags:
        - Protocol - Agents
      summary: Register Agent
      description: Creates a new AI agent with API configuration.
      operationId: registerAgent
      requestBody:
        description: Agent configuration
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterAgentRequest'
            example:
              name: Legal Assistant
              description: AI-powered legal document analysis
              tags:
                - legal
                - ai
              endpoints:
                - POST: https://your-api.com/query
              agentDefinitionUrl: https://your-api.com/openapi.json
      responses:
        '200':
          description: Agent created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentCreatedResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid or missing API key
components:
  schemas:
    RegisterAgentRequest:
      type: object
      required:
        - name
        - endpoints
        - agentDefinitionUrl
      properties:
        name:
          type: string
          description: Agent display name
        description:
          type: string
          description: Agent description
        tags:
          type: array
          items:
            type: string
          description: Searchable tags
        endpoints:
          type: array
          items:
            type: object
          description: API endpoints (HTTP verb and URL)
        agentDefinitionUrl:
          type: string
          description: URL to OpenAPI spec, MCP Manifest, or A2A agent card
    AgentCreatedResponse:
      type: object
      properties:
        success:
          type: boolean
        agentId:
          type: string
          description: The agent's unique identifier (DID)
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
        statusCode:
          type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your Nevermined API Key (starts with 'nvm:'). Get one at
        [nevermined.app](https://nevermined.app) under **Settings > API Keys**.

````