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

# Introduction

> Get started with the Nevermined Payments API for AI-native monetization

<Note>
  This section introduces the Nevermined Payments API — a TypeScript-first system for registering agents, configuring payment plans, handling subscriber access, and enforcing credit-based billing. All endpoints are available via direct function calls through the `Payments` client.
</Note>

## Overview

Nevermined provides a modular, programmable API that enables AI Builders to:

* Register autonomous agents with metadata and HTTP endpoints
* Create flexible fiat/crypto-based payment plans
* Manage subscriptions using tokenized credits
* Enforce usage-based access with secure metering and redemption
* Enable agent-to-agent or human-to-agent transactions

The API is designed for high-frequency use, real-time authorization, and deep integration into backend agent logic or proxy infrastructure.

***

## Setup

Supported environments:

* `local`
* `testing` (Base Sepolia)
* `production` (Base Mainnet)
* `custom` (any EVM-compatible network with manual config)

Initialize the Payments API:

```ts theme={null}
import { Payments } from '@nevermined-io/payments'

const payments = Payments.getInstance({
  nvmApiKey: process.env.NVM_API_KEY,
  environment: 'production'
})
```

⸻

## Core Capabilities

### Register an Agent and Plan

```ts theme={null}
const agentMetadata = {
  name: 'Legal Assistant',
  tags: ['legal', 'ai'],
  dateCreated: new Date()
}

const agentApi = {
  endpoints: [{ POST: 'https://yourdomain.com/api/query' }]
}

const price = getERC20PriceConfig(10_000_000n, USDC_ADDRESS, builderAddress)
const credits = getExpirablePlanCreditsConfig(86400n * 30n)

const { agentId, planId } = await payments.registerAgentAndPlan(
  agentMetadata,
  agentApi,
  price,
  credits
)
```

***

## Enforce Access and Redeem Credits

When receiving a request to your agent:

```ts theme={null}
const isValid = await payments.isValidRequest(
  planId,
  agentId,
  subscriberAddress,
  request.headers['x-nvm-query-signature']
)

if (!isValid) {
  const paymentCard = await payments.getAgentPaymentCard(agentId)
  return res.status(402).send(paymentCard)
}

// Run the AI logic and redeem usage
await payments.redeemCredits(planId, 5n, proof)
```

⸻

## API Authentication

All API operations require an nvmApiKey, which you can generate from the Nevermined App.

Authentication occurs at the time of instantiating Payments.getInstance() and is required for all calls to register, validate, or query.

⸻

## Start Exploring

<CardGroup cols={2}>
  <Card title="Register Agents & Plans" icon="brain" href="/api-reference/endpoint/create">
    Publish metadata and register endpoints for your AI agent.
  </Card>

  <Card title="Order Plans" icon="credit-card" href="/api-reference/endpoint/order">
    Enable subscribers to purchase your payment plans.
  </Card>

  <Card title="Query Agents" icon="code" href="/api-reference/endpoint/query">
    Query agents with valid access and enforce credit redemption.
  </Card>

  <Card title="Redeem Credits" icon="coins" href="/api-reference/endpoint/redeem">
    Programmatically burn credits based on request usage.
  </Card>
</CardGroup>

⸻

## Next Steps

* [Quickstart Guide](/introduction/quickstart)
* [Full API Reference](/api-reference)
* [Join the Discord Community](https://discord.gg/nevermined)
* [View GitHub Source](https://github.com/nevermined-io)

Nevermined lets you build composable, agent-native payment flows — with full control over billing, pricing, and enforcement.

***

Let me know if you'd like help wiring this up with an OpenAPI spec for Mintlify's API Playground, or if you want MDX subpages scaffolded for `/api-reference/register-agent`, `/query-agent`, etc.
