> For the complete documentation index, see [llms.txt](https://docs.grandprotocol.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.grandprotocol.org/getting-started/installation.md).

# Installation

Grand Protocol is accessed entirely through a REST HTTP API. No package installation required.

***

## Base URL

```
https://api.grandprotocol.org/v1
```

All endpoints require HTTPS. HTTP requests are rejected.

***

## Authentication

Every request must include your API key in the `Authorization` header:

```bash
Authorization: Bearer rp_live_...
```

Obtain your API key from the [Grand Protocol dashboard](https://app.grandprotocol.org) under **Settings → API Keys**.

***

## Quick check

Verify your key works:

```bash
curl https://api.grandprotocol.org/v1/wallets \
  -H "Authorization: Bearer $GRAND_API_KEY"
```

***

## CI/CD environments

Set the API key as an environment variable and pass it with each request:

```bash
export GRAND_API_KEY=rp_live_...
```

***

## Per-agent keys

For production deployments, use per-agent keys (`rp_agent_...`) scoped to a single agent. A compromised per-agent key cannot access other agents or modify account configuration.

Create a per-agent key:

```bash
curl -X POST https://api.grandprotocol.org/v1/keys \
  -H "Authorization: Bearer $GRAND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "agentId": "my-agent", "name": "production" }'
```

Rotate without downtime by creating the new key first, updating your application, then revoking the old one:

```bash
curl -X DELETE https://api.grandprotocol.org/v1/keys/rp_agent_01j9... \
  -H "Authorization: Bearer $GRAND_API_KEY"
```

***

## Error responses

All API errors return a JSON body with a machine-readable `error` field:

```json
{
  "error": "policy_violation",
  "reason": "per_call_limit_exceeded",
  "detail": "Requested 2.50 USDC, limit is 1.00 USDC"
}
```

| Status | Meaning                                           |
| ------ | ------------------------------------------------- |
| `401`  | API key missing or invalid                        |
| `402`  | Payment rejected by a spend policy                |
| `403`  | Per-agent key used for an account-level operation |
| `429`  | Account-level rate limit exceeded                 |
| `500`  | Internal error                                    |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.grandprotocol.org/getting-started/installation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
