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

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# Auth

# Authentication for AI agents

How to authenticate programmatic and agent-driven requests against the Yuno API and MCP server.

## REST API

The Yuno API uses API key authentication. Every request requires two headers:

* `public-api-key`
* `private-secret-key`

Find both in the [Yuno Dashboard](https://dashboard.y.uno/developers), under Developers credentials. Sandbox and Production use different key pairs; the keys shown in the Dashboard depend on which environment (Test Mode or Live Mode) is selected.

Do not share `private-secret-key` in public places like GitHub or Bitbucket.

## Base URLs

| Environment | Base URL |
| - | - |
| Sandbox | `https://api-sandbox.y.uno` |
| Production | `https://api.y.uno` |

Sandbox data is simulated and does not affect live accounting or metrics. See [API environments](https://docs.y.uno/reference/getting-started/api-environments.md) for full details.

## Idempotency

Send an `X-Idempotency-Key` header (UUID) on requests that support it to safely retry after a connection issue without duplicating the operation. A repeated key returns the original response instead of creating a new transaction. Create Checkout Session ignores the header: each call creates a new session.

See [Authentication](https://docs.y.uno/reference/getting-started/authentication.md#idempotency) for retry and error-handling behavior.

## Model Context Protocol (MCP)

Yuno exposes its API as MCP tools for AI agents. Two ways to connect:

**Local (CLI-launched)**: run `npx @yuno-payments/yuno-mcp@latest` and set `YUNO_PUBLIC_API_KEY`, `YUNO_PRIVATE_SECRET_KEY`, and `YUNO_ACCOUNT_CODE` as environment variables. See [Building AI Integrations with Yuno's LLMs and MCP](https://docs.y.uno/docs/ai-capabilities/building-ai-integrations-with-yunos-llms-and-mcp.md).

**Remote (hosted endpoint)**: connect over HTTP transport to `https://mcp.prod.y.uno/mcp`, passing `public-api-key`, `private-secret-key`, and `account-code` as request headers. Adds IP binding, rate limiting (15 requests/minute/session), and session TTLs (30 min idle, 6 hours absolute). See [Remote Yuno MCP Server](https://docs.y.uno/docs/ai-capabilities/remote-yuno-mcp-server.md).

Both methods use the same API key credentials as the REST API, no separate OAuth flow.

## Machine-readable docs

Every Yuno Docs page is available as plain-text Markdown by appending `.md` to its URL, for both guides and API reference pages. See [llms.txt](https://docs.y.uno/llms.txt) for the full page index.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.