# render.ai API (v1.0)

Authentication: `X-API-Key: sk-rndr-...`. Paid plans only.
Agents on the free plan should use the MCP server at https://api.render.ai/mcp instead.

Generate AI-powered presentations programmatically. Create decks, poll for completion, and optionally export to PDF.

## Quick Start

Create a presentation in three steps:

**1. Start a generation**

```bash
curl -X POST https://api.render.ai/v1/generations \
  -H "X-API-Key: sk-rndr-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputText": "Quarterly business review for Q1 2026",
    "textMode": "generate",
    "numCards": 10,
    "themeId": "blueprint"
  }'
```

**2. Poll for completion**

```bash
curl https://api.render.ai/v1/generations/GENERATION_ID \
  -H "X-API-Key: sk-rndr-YOUR_KEY"
```

Poll every 10 seconds. A typical generation completes in 1-3 minutes.

**3. Access the result**

When `status` is `"completed"`, the response includes `contentUrl` (link to view/edit the presentation) and, when `exportAs` was set on the request, `exportUrl` (a PDF download link).

## Authentication

All API requests (except the health check) require an API key passed via the `X-API-Key` header:

```
X-API-Key: sk-rndr-YOUR_API_KEY
```

API keys are managed from the render.ai dashboard under **Account > API Keys**. Each key is tied to an organization and its credit balance.

## Polling Best Practices

- **Recommended interval:** Poll every 10 seconds.
- A typical generation completes in 1-3 minutes.
- Do not poll more frequently than every 5 seconds.
- Stop polling when the status is `completed`, `failed`, or `cancelled`.

## Idempotency

The `Idempotency-Key` header on `POST /v1/generations` is optional. Include it to make a retry safe: repeated requests with the same key return the original generation without deducting additional credits. Omit it and every request starts a new generation, so a retried call is charged again.

```bash
curl -X POST https://api.render.ai/v1/generations \
  -H "X-API-Key: sk-rndr-YOUR_KEY" \
  -H "Idempotency-Key: my-unique-request-123" \
  -H "Content-Type: application/json" \
  -d '{"inputText": "...", "textMode": "generate"}'
```

## Credits

Each generation costs **40 credits**. Check your balance at any time via `GET /v1/usage`.


## Endpoints

### GET /v1/health

Health check

Returns service health status. Does not require authentication.

### POST /v1/generations

Create generation

Start a new presentation generation. Deducts **40 credits**.

Use the `Idempotency-Key` header to prevent duplicate generations on retries.


### GET /v1/generations/{generationId}

Get generation status

Poll generation status. Returns current state including content and export URLs when completed.

### DELETE /v1/generations/{generationId}

Cancel generation

Cancel a running generation. Only works for generations with `pending` or `processing` status.

### GET /v1/themes

List themes

List all available presentation themes with preview colors.

### GET /v1/usage

Check usage

Check credit balance and recent generation history.

Machine-readable specification: https://api.render.ai/openapi.json
