Skip to main content

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

curl https://api.galadriel.com/v1/orders \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response Format

All API responses return JSON with a consistent structure:
{
  "data": { ... },
  "error": null
}
Error responses:
{
  "data": null,
  "error": {
    "code": "invalid_request",
    "message": "GPU count must be a multiple of 8"
  }
}

Rate Limiting

ResourceLimit
API queries100 requests/minute
Order creation10 requests/minute
Order cancellation20 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:
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:
CodeMeaning
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API token
403Forbidden - Insufficient permissions
404Not Found - Resource doesn’t exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong

Idempotency

POST requests accept an Idempotency-Key header to safely retry requests:
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