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

# Introduction

> Get started with the Galadriel REST API

# REST API Reference

The Galadriel API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes and authentication.

## Base URL

```
https://api.galadriel.com/v1
```

## Quick Start

```bash theme={null}
curl https://api.galadriel.com/v1/orders \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

## Response Format

All API responses return JSON with a consistent structure:

```json theme={null}
{
  "data": { ... },
  "error": null
}
```

Error responses:

```json theme={null}
{
  "data": null,
  "error": {
    "code": "invalid_request",
    "message": "GPU count must be a multiple of 8"
  }
}
```

## Rate Limiting

| Resource           | Limit               |
| ------------------ | ------------------- |
| API queries        | 100 requests/minute |
| Order creation     | 10 requests/minute  |
| Order cancellation | 20 requests/minute  |

Rate limit information is included in response headers:

```
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1635724800
```

## Timestamps

All timestamps are returned in ISO 8601 format:

```
2025-11-11T14:00:00Z
```

## Pagination

List endpoints support pagination:

```bash theme={null}
curl "https://api.galadriel.com/v1/orders?limit=20&offset=0" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

Parameters:

* `limit` - Number of items to return (default: 20, max: 100)
* `offset` - Number of items to skip (default: 0)

## Errors

The API uses standard HTTP response codes:

| Code | Meaning                                      |
| ---- | -------------------------------------------- |
| 200  | Success                                      |
| 400  | Bad Request - Invalid parameters             |
| 401  | Unauthorized - Invalid or missing API token  |
| 403  | Forbidden - Insufficient permissions         |
| 404  | Not Found - Resource doesn't exist           |
| 429  | Too Many Requests - Rate limit exceeded      |
| 500  | Internal Server Error - Something went wrong |

## Idempotency

POST requests accept an `Idempotency-Key` header to safely retry requests:

```bash theme={null}
curl -X POST https://api.galadriel.com/v1/orders \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Idempotency-Key: unique-key-123" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```

## Support

* Email: [support@galadriel.com](mailto:support@galadriel.com)
* Documentation: [https://docs.galadriel.com](https://docs.galadriel.com)
