---
title: "Register Agent and Plan"
method: POST
path: "/protocol/agents/plans"
tags: ["Protocol - Agents"]
---

# Register Agent and Plan

`POST /protocol/agents/plans`

## Request

- Base URL: `https://api.sandbox.nevermined.app/api/v1`
- URL: `https://api.sandbox.nevermined.app/api/v1/protocol/agents/plans`
- Auth: HTTP bearer

Creates both an agent and associated payment plan in a single request.

## Request body

- RegisterAgentAndPlanRequest
  - `agentMetadata` object, required
    - `name` string
    - `description` string
    - `tags` string[]
  - `agentApi` object, required
    - `endpoints` object[]
    - `agentDefinitionUrl` string
  - `planMetadata` object, required
    - `name` string
    - `description` string
  - `priceConfig` PriceConfig, required
    - `priceType` 'FIXED_PRICE' | 'FREE'
    - `tokenAddress` string: ERC20 token address (e.g., USDC)
    - `amounts` integer[]: Price amounts (6 decimals for USDC)
    - `receivers` string[]: Wallet addresses to receive payment
  - `creditsConfig` CreditsConfig, required
    - `creditsType` 'FIXED' | 'EXPIRABLE'
    - `amount` integer: Number of credits
    - `minAmount` integer: Minimum credits per request
    - `durationOfThePlan` integer: Duration in seconds (for EXPIRABLE)
  - `accessLimit` 'credits' | 'time'

## Response `200`

Agent and plan created

- AgentAndPlanCreatedResponse
  - `success` boolean
  - `agentId` string
  - `planId` string

## Other responses

- `400`: Invalid request
- `401`: Unauthorized

---

[API](https://skmtc.dev/nevermined/apis/nevermined-api.md) · [All operations](https://skmtc.dev/nevermined/apis/nevermined-api/llms.txt) · [OpenAPI document](https://skmtc.dev/nevermined/apis/nevermined-api/revisions/cabbe618c80b?raw)
