# RentPrompts API

> One API key for every text, image, video and audio model. OpenAI-compatible. Pay per successful generation in Joules (1 Joule = ₹1, topped up with UPI or card) from your RentPrompts wallet.

Base URL: `https://payload.rentprompts.com/api/v1` · Keys: https://rentprompts.com/dashboard/api-keys · HTML docs: https://rentprompts.com/apidocs · OpenAPI: https://rentprompts.com/apidocs/openapi.json

## Quickstart

1. Sign up, verify your email and create a key at https://rentprompts.com/dashboard/api-keys (shown once).

2. Add Joules at https://rentprompts.com/pricing. Only successful generations are charged.

3. Call the API with `Authorization: Bearer rp_live_…`, or point any OpenAI SDK at the base URL.

```bash
curl https://payload.rentprompts.com/api/v1/chat/completions \
  -H "Authorization: Bearer rp_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "minimax-m27",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about APIs."
    }
  ],
  "max_tokens": 256
}'
```

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("RENTPROMPTS_API_KEY", "rp_live_YOUR_KEY"),
    base_url="https://payload.rentprompts.com/api/v1",
)

completion = client.chat.completions.create(
    model="minimax-m27",
    messages=[
        {
            "role": "user",
            "content": "Write a haiku about APIs."
        }
    ],
    max_tokens=256,
)
print(completion.choices[0].message.content)
```

## Endpoints

| Endpoint | Auth | Use |
| --- | --- | --- |
| `POST /v1/chat/completions` | API key | Text models (including those that read images), OpenAI-compatible. Live token streaming, tools and JSON schema output on models with those capabilities. |
| `POST /v1/images/generations` | API key | Image models. Async image models answer 202 with a job; add "webhook" to be notified when it finishes. |
| `POST /v1/run` | API key | Universal endpoint for any model type. Required for async-only models (video, and some image and audio models): answers 202 with a job; accepts "webhook". |
| `GET /v1/jobs/{id}` | API key | Status and output of an async job. |
| `GET /v1/models` | None | The public model catalog with pricing. |
| `GET /v1/models/{id}` | None | One model. |
| `GET /v1/balance` | API key | Your wallet balance in Joules. |
| `GET /v1/usage?days=30` | API key | Usage summary for the calling key. |

## Streaming

`"stream": true` returns server-sent events in the OpenAI `chat.completion.chunk` format ending with `data: [DONE]`. Models with `capabilities.streaming: true` stream tokens live; others send the full answer in one chunk. `"stream_options": {"include_usage": true}` adds a final chunk with `usage` and `rentprompts.cost_joules`. Disconnecting early charges only what was generated.

## Tools and structured output

Models with `capabilities.tools: true` accept `tools`, `tool_choice`, `parallel_tool_calls`, assistant `tool_calls` and `tool` messages exactly like the OpenAI API, and `response_format` with `json_object` or `json_schema`. Other models answer `400 unsupported_parameter`. Not supported anywhere: `n` > 1, `logprobs`, `logit_bias`.

## Async jobs and webhooks

Video and other async models must use `POST /v1/run`. They answer `202` with `job_id` and `poll_url`; poll `GET /v1/jobs/{id}` until `status` is `succeeded` (file in `output.url`) or `failed`. Or add `"webhook": "https://…"`: when the job finishes RentPrompts POSTs `{ "type": "job.succeeded" | "job.failed", "timestamp", "data": <job> }`, signed with Standard Webhooks headers `webhook-id`, `webhook-timestamp`, `webhook-signature` (`v1,` + base64 HMAC-SHA256 of `id.timestamp.body` with the key's `whsec_` secret from the API keys page). Retries: 5 s, 1 min, 5 min, 30 min, 2 h, 8 h, 24 h with the same `webhook-id`.

```bash
curl https://payload.rentprompts.com/api/v1/run \
  -H "Authorization: Bearer rp_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "grok-imagine",
  "prompt": "A slow drone shot over a misty pine forest"
}'

# Async models answer HTTP 202 with a job. Poll it until status is
# "succeeded" (output.url / output.urls) or "failed" (error):
curl https://payload.rentprompts.com/api/v1/jobs/JOB_ID \
  -H "Authorization: Bearer rp_live_YOUR_KEY"
```

## Errors

Every error is `{ "error": { "type", "code", "message", "param"? } }`.

| HTTP | code | What to do |
| --- | --- | --- |
| 400 | invalid_request, model_not_supported_on_endpoint | The body is malformed, or the model is called on the wrong endpoint (async models cannot use chat completions: call them on /v1/run). |
| 400 | unsupported_parameter | A parameter this model does not support, such as tools on a model without capabilities.tools, or n > 1. Remove it and retry. |
| 401 | invalid_api_key, key_revoked, key_expired | The key is missing, wrong, revoked or past its expiry. |
| 402 | insufficient_balance, spend_cap_exceeded | Add Joules, or raise the key's monthly cap. |
| 403 | scope_not_allowed, account_suspended, email_not_verified | The key may not use this model type, or the account cannot use the API. |
| 404 | model_not_found, job_not_found | Unknown model id, or a job that is not yours. |
| 409 | key_limit_reached | You already have the maximum number of active keys. |
| 413 | request_too_large | The request body is over 25 MB. Send media as public https URLs instead of inline data. |
| 422 | idempotency_key_reused | This Idempotency-Key was already used with a different request body. Use a new key for a new request. |
| 429 | rate_limit_exceeded, concurrency_limit | Slow down; wait for the retry-after header. |
| 503 | provider_error, provider_timeout, model_unavailable, api_disabled | Upstream or temporary problem, or a synchronous call that ran past 90 seconds (provider_timeout: use stream: true or POST /v1/run for long generations). Not charged; retry with backoff. |

## Response headers

| Header | Meaning |
| --- | --- |
| `x-request-id` | Unique id of the request — include it when contacting support. |
| `x-rp-cost-joules` | What this request cost. |
| `x-rp-balance-joules` | Your wallet balance after the request. |
| `x-ratelimit-limit-requests` | Requests allowed per minute for this key. |
| `x-ratelimit-remaining-requests` | Requests left in the current minute. |
| `retry-after` | Seconds to wait (on 429 responses). |
| `idempotent-replayed` | "true" when the response is a stored replay of an earlier request with the same Idempotency-Key. |

## Limits

| Limit | Value |
| --- | --- |
| Requests per key | 60 / minute |
| Requests per account | 120 / minute |
| Concurrent requests per account | 5 |
| Job status polls (GET /v1/jobs/{id}) per key | 300 / minute |
| Media URL size (fetched server-side, public https only) | 15 MB each |
| Request body | 25 MB |
| Active keys per account | 10 |
| max_tokens (text) | default 1,024, max 8,192 |

## Idempotency

Send `Idempotency-Key: <uuid>` to make retries safe: the same key within 24 hours is never charged twice and replays the first response (header `idempotent-replayed: true`). A different body with the same key → `422 idempotency_key_reused`; a retry while the first is running → `409`. Streams are not stored for replay.

## Models

Full live catalog with settings: `GET https://payload.rentprompts.com/api/v1/models` (public). One model: `GET https://payload.rentprompts.com/api/v1/models/{id}` or https://rentprompts.com/apidocs/models/{id}.

| id | type | endpoint | price | streaming | tools |
| --- | --- | --- | --- | --- | --- |
| `minimax-m27` | text | /v1/chat/completions | 0.12 J in · 0.2 J out / 1K tokens | live | yes |
| `kling-image-v3` | image | /v1/images/generations | 3.8 J / image | one chunk | no |
| `gpt-52-2025-12-11` | text | /v1/chat/completions | 0.68 J in · 1.9 J out / 1K tokens | live | yes |
| `kimi-k2-thinking` | text | /v1/chat/completions | 0.27 J in · 0.5 J out / 1K tokens | one chunk | no |
| `nano-banana-pro-edit` | image | /v1/images/generations | 15.2 J / image | one chunk | no |
| `nano-banana-pro` | image | /v1/images/generations | 12.66 J / image | one chunk | no |
| `flux-2-pro` | image | /v1/images/generations | 3.61 J / image | one chunk | no |
| `gpt-image-1` | image | /v1/images/generations | 10.79 J / image | one chunk | no |
| `nano-banana` | image | /v1/images/generations | 7.74 J / image | one chunk | no |
| `grok-42` | text | /v1/chat/completions | 0.32 J in · 0.45 J out / 1K tokens | live | yes |
| `grok-imagine` | video | /v1/run (async) | 6 J / second | one chunk | no |
| `lyria-3-pro-preview` | audio | /v1/run | 9 J / request | one chunk | no |
| `seedance-15-pro` | video | /v1/run (async) | 5.9 J / second | one chunk | no |
| `kling-v26` | video | /v1/run (async) | 14.2 J / second | one chunk | no |
| `veo3` | video | /v1/run | 37.89 J / second | one chunk | no |
| `seedream-v4` | image | /v1/images/generations | 3.61 J / image | one chunk | no |
| `seedance-1-pro` | video | /v1/run (async) | 15.1 J / second | one chunk | no |
| `gen-4-turbo` | video | /v1/run | 6.64 J / second | one chunk | no |
| `photon-flash` | image | /v1/images/generations | 1.7 J / image | one chunk | no |
| `flux-kontext-pro` | image | /v1/images/generations | 4.48 J / image | one chunk | no |
| `tts-15-max` | audio | /v1/run | 4.33 J / request | one chunk | no |
| `gen-45` | video | /v1/run (async) | 12.3 J / second | one chunk | no |
| `kling-video-v16-pro` | video | /v1/run | 10.2 J / second | one chunk | no |
| `kling-v26-motion-control` | video | /v1/run (async) | 8 J / second | one chunk | no |
| `gemini-25-flash` | image | /v1/images/generations | 4.39 J / image | one chunk | no |
| `wan-21-t2v-720p` | video | /v1/run (async) | 23.6 J / second | one chunk | no |
| `veo-3-fast` | video | /v1/run (async) | 15.1 J / second | one chunk | no |
| `o3-mini` | text | /v1/chat/completions | 0.3 J in · 0.6 J out / 1K tokens | live | yes |
| `imagen-4` | image | /v1/images/generations | 4.48 J / image | one chunk | no |
| `ideogram-v2a` | image | /v1/images/generations | 3.68 J / image | one chunk | no |
| `ray-2-720p` | video | /v1/run (async) | 18 J / second | one chunk | no |
| `nano-banana-2` | image | /v1/images/generations | 6.9 J / image | one chunk | no |
| `gpt-image-2` | image | /v1/images/generations | 13.8 J / image | one chunk | no |
| `spark` | text | /v1/chat/completions | 0.01 J / request | live | yes |
| `gpt-image-15` | image | /v1/images/generations | 5.46 J / image | one chunk | no |
| `gpt-4-1-mini` | text | /v1/chat/completions | 0.14 J in · 0.26 J out / 1K tokens | live | yes |
| `gpt-4o` | text | /v1/chat/completions | 0.45 J in · 1.2 J out / 1K tokens | live | yes |
| `flux-2klein4b` | image | /v1/images/generations | 3 J / image | one chunk | no |
| `flux-schnell` | image | /v1/images/generations | 0.4 J / image | one chunk | no |
| `seedance-20` | video | /v1/run (async) | 16.2 J / second | one chunk | no |
| `gpt-51` | text | /v1/chat/completions | 0.32 J in · 1.2 J out / 1K tokens | live | yes |
| `gpt-image-2-5-sunburst-1` | image | /v1/run (async) | 4 J / image | one chunk | no |
| `o4-mini` | text | /v1/chat/completions | 0.3 J in · 0.6 J out / 1K tokens | live | yes |
| `gpt-image-2-5-flare` | image | /v1/run (async) | 4 J / image | one chunk | no |
| `seedream-5-lite` | image | /v1/images/generations | 5.3 J / image | one chunk | no |
| `qwen21-image-to-image` | image | /v1/run (async) | 2 J / image | one chunk | no |
| `kling-v30-pro` | video | /v1/run (async) | 17.8 J / second | one chunk | no |
| `hy3` | text | /v1/chat/completions | 0.04 J in · 0.08 J out / 1K tokens | live | yes |
| `recraft-v4-pro` | image | /v1/images/generations | 25.5 J / image | one chunk | no |
| `qwen21-text-to-image` | image | /v1/run (async) | 2.5 J / image | one chunk | no |
| `orpheus-tts` | audio | /v1/run | 0.36 J / second | one chunk | no |
| `gemini-38-flash` | text | /v1/chat/completions | 0.18 J in · 0.5 J out / 1K tokens | live | yes |
| `gemini-36-flash` | text | /v1/chat/completions | 0.25 J in · 0.85 J out / 1K tokens | live | yes |
| `nano-banana-21` | image | /v1/images/generations | 3.6 J / image | one chunk | no |
| `kimi-k3` | text | /v1/chat/completions | 0.5 J in · 1.7 J out / 1K tokens | live | yes |
| `llama3-3-70b` | text | /v1/chat/completions | 0.16 J in · 0.18 J out / 1K tokens | live | yes |
| `muse-spark-13` | text | /v1/chat/completions | 0.2 J in · 0.5 J out / 1K tokens | live | yes |
| `gemini-4-argon` | text | /v1/chat/completions | 0.3 J in · 1.1 J out / 1K tokens | live | yes |
| `grok-47` | text | /v1/chat/completions | 0.3 J in · 0.7 J out / 1K tokens | live | yes |
| `qwen38-flash` | text | /v1/chat/completions | 0.11 J in · 0.15 J out / 1K tokens | live | yes |
| `grok-46` | text | /v1/chat/completions | 0.4 J in · 0.8 J out / 1K tokens | live | yes |
| `sdxl` | image | /v1/images/generations | 0.3 J / image | one chunk | no |
| `gpt-54-mini` | text | /v1/chat/completions | 0.68 J in · 1.9 J out / 1K tokens | live | yes |
| `p-video` | video | /v1/run (async) | 2.2 J / second | one chunk | no |
| `pixverse-v56` | video | /v1/run (async) | 7.6 J / second | one chunk | no |
| `ltx-video-v095` | video | /v1/run | 1.94 J / second | one chunk | no |
| `seedream-50-flash` | image | /v1/images/generations | 2.9 J / image | one chunk | no |
| `nano-banana-2-lite` | image | /v1/images/generations | 3.9 J / image | one chunk | no |
| `flux-3-image` | image | /v1/images/generations | 4.3 J / image | one chunk | no |
| `seedance-25` | video | /v1/run (async) | 23.6 J / second | one chunk | no |
| `gpt-4-1-nano` | text | /v1/chat/completions | 0.01 J in · 0.04 J out / 1K tokens | live | yes |
| `sonilo-v11` | audio | /v1/run | 0.2 J / second | one chunk | no |
| `p-image-edit` | image | /v1/images/generations | 1.2 J / image | one chunk | no |
| `seedream-45` | image | /v1/images/generations | 4.48 J / image | one chunk | no |
| `gemini-omni-flash-v11` | video | /v1/run | 11 J / second | one chunk | no |
| `seedream-v5-lite-edit` | image | /v1/images/generations | 3.7 J / image | one chunk | no |
| `ideogram-v4-quality` | image | /v1/images/generations | 10.2 J / image | one chunk | no |
| `gpt-62-astra-pro` | text | /v1/chat/completions | 0.9 J in · 4.1 J out / 1K tokens | live | yes |
| `sana-sprint` | image | /v1/images/generations | 4.6 J / image | one chunk | no |
| `muse-glimmer-30b` | text | /v1/chat/completions | 0.13 J in · 0.2 J out / 1K tokens | live | yes |
| `laguna-xs-21` | text | /v1/chat/completions | 0.01 J / request | live | yes |
| `krea-2-medium` | image | /v1/images/generations | 3.7 J / image | one chunk | no |
| `gpt-4-1` | text | /v1/chat/completions | 7.09 J / request | live | yes |
| `image-01` | image | /v1/images/generations | 1.37 J / image | one chunk | no |
| `flux-fast` | image | /v1/images/generations | 0.6 J / image | one chunk | no |
| `claude-fable-51` | text | /v1/chat/completions | 1.2 J in · 5.2 J out / 1K tokens | live | yes |
| `krea-2-medium-turbo` | image | /v1/images/generations | 1.7 J / image | one chunk | no |
| `seedance-20-mini` | video | /v1/run (async) | 11.5 J / second | one chunk | no |
| `gpt-4o-mini` | text | /v1/chat/completions | 0.12 J in · 0.16 J out / 1K tokens | live | yes |
| `p-image` | image | /v1/images/generations | 0.6 J / image | one chunk | no |
| `ling-30-tiny` | text | /v1/chat/completions | 0.01 J / request | live | yes |
| `north-mini-code` | text | /v1/chat/completions | 0.01 J / request | live | yes |
| `flux-schnell-ultra` | image | /v1/images/generations | 17 J / image | one chunk | no |
| `imagen-4-fast` | image | /v1/images/generations | 2.2 J / image | one chunk | no |
| `muse-spark-12` | text | /v1/chat/completions | 0.3 J in · 0.6 J out / 1K tokens | live | yes |
| `dall-e-3` | image | /v1/images/generations | 10.6 J / image | one chunk | no |
| `video-v1-6-standard` | video | /v1/run | 6.3 J / second | one chunk | no |
| `p-image-upscale` | image | /v1/images/generations | 0.6 J / image | one chunk | no |
| `gpt-image-1-mini` | image | /v1/images/generations | 3.2 J / image | one chunk | no |
| `minimax-h3-max-turbo` | video | /v1/run | 5 J / second | one chunk | no |
| `seedream-5-pro` | image | /v1/images/generations | 9.2 J / image | one chunk | no |
| `ltx-25-fast` | video | /v1/run (async) | 6.5 J / second | one chunk | no |
| `qwen-image-3` | image | /v1/run (async) | 2.6 J / image | one chunk | no |
| `professional-headshot` | image | /v1/images/generations | 4.5 J / image | one chunk | no |
| `laguna-s-21` | text | /v1/chat/completions | 0.01 J / request | live | yes |
| `happyhorse-11` | video | /v1/run (async) | 10.8 J / second | one chunk | no |
| `hidream-i1-fast` | image | /v1/images/generations | 0.6 J / image | one chunk | no |
| `kokoro-82m` | audio | /v1/run | 0.3 J / second | one chunk | no |
| `lyria-35` | audio | /v1/run | 11 J / request | one chunk | no |
| `p-image-ideogram` | image | /v1/images/generations | 2.2 J / image | one chunk | no |
| `grok-imagine-image-20` | image | /v1/images/generations | 8.2 J / image | one chunk | no |
| `flux-3` | video | /v1/run (async) | 17.5 J / second | one chunk | no |
| `minimax-h3` | video | /v1/run (async) | 7 J / second | one chunk | no |
| `grok-45` | text | /v1/chat/completions | 0.4 J in · 0.8 J out / 1K tokens | live | yes |
| `gemini-omni-flash` | video | /v1/run | 13.5 J / second | one chunk | no |
| `imagen-3` | image | /v1/images/generations | 5.2 J / image | one chunk | no |
| `ideogram-v45` | image | /v1/images/generations | 6.2 J / image | one chunk | no |
| `gpt-6-astra-pro` | text | /v1/chat/completions | 1.2 J in · 5.2 J out / 1K tokens | live | yes |
| `deepseek-v4-flash-0731` | text | /v1/chat/completions | 0.01 J in · 0.02 J out / 1K tokens | live | yes |
| `grok-imagine-video-15` | video | /v1/run (async) | 8.5 J / second | one chunk | no |
| `dall-e-2` | image | /v1/images/generations | 2.74 J / image | one chunk | no |
| `stable-audio-open` | audio | /v1/run | 0.3 J / second | one chunk | no |
| `minimax-h3-max` | video | /v1/run | 10 J / second | one chunk | no |
| `wan-3` | video | /v1/run (async) | 5.2 J / second | one chunk | no |
| `p-video-avatar-1080p` | video | /v1/run (async) | 4.8 J / second | one chunk | no |
| `lucid-origin` | image | /v1/images/generations | 1.9 J / image | one chunk | no |
| `step1x-edit` | image | /v1/images/generations | 3.11 J / image | one chunk | no |
| `grok-imagine-video-15-lite` | video | /v1/run (async) | 3.5 J / second | one chunk | no |
| `claude-sonnet-55` | text | /v1/chat/completions | 0.3 J in · 1.1 J out / 1K tokens | live | yes |
| `flux-kontext-fast` | image | /v1/images/generations | 1.2 J / image | one chunk | no |
| `p-video-avatar-720p` | video | /v1/run (async) | 2.7 J / second | one chunk | no |
| `ideogram-v4-balanced` | image | /v1/images/generations | 6.2 J / image | one chunk | no |
| `kling-avatar-v2` | video | /v1/run (async) | 6 J / second | one chunk | no |
| `flux-kontext-max` | image | /v1/images/generations | 7.36 J / image | one chunk | no |
| `birefnet` | image | /v1/images/generations | 0.47 J / image | one chunk | no |
| `ddcolor` | image | /v1/images/generations | 0.29 J / image | one chunk | no |
| `seedance-25-flash` | video | /v1/run (async) | 21 J / second | one chunk | no |
| `qwen38-max` | text | /v1/chat/completions | 0.3 J in · 0.7 J out / 1K tokens | live | yes |
| `p-video-animate` | video | /v1/run (async) | 3.2 J / second | one chunk | no |
| `ghiblify` | image | /v1/images/generations | 4.6 J / image | one chunk | no |

## FAQ

### Is the RentPrompts API compatible with the OpenAI SDK?

Yes. Point the official OpenAI Python or Node SDK at the RentPrompts base URL, pass your rp_live_ key as the API key, and call chat.completions.create or images.generate with any model id from the catalog. Video and audio models use the universal /v1/run endpoint.

### What is a Joule and how much does a call cost?

Joules are RentPrompts credits. You buy them on the Pricing page (/pricing): a custom amount costs ₹1 per Joule plus 18% GST, and the Joules go into the same wallet you use on the website. Every model's price in the catalog is listed in Joules. For example, a text model priced at 0.0025 Joules per 1,000 input tokens and 0.01 Joules per 1,000 output tokens costs 0.0025 + 0.005 = 0.0075 Joules for a call with 1,000 input and 500 output tokens. Each model's page shows this worked out from its own price.

### How am I billed?

Requests are paid from your RentPrompts wallet in Joules, at exactly the price shown in the catalog — the same prices as the website. When a request starts, its worst-case cost is reserved from your balance; when it finishes you are charged the actual cost and the rest of the reservation is released. Failed generations are never charged. In the rare case a charge cannot be collected straight away, the unpaid amount is collected automatically on your next request. Each response reports cost_joules and your remaining balance.

### What happens when my balance runs out?

Requests that could cost more than your available balance are rejected with HTTP 402 insufficient_balance before the model is called. Add Joules from your wallet and retry.

### Can I limit how much a key spends?

Yes. Every key can have an optional monthly spend cap in Joules. Once a key reaches its cap, its requests fail with 402 spend_cap_exceeded until the next month or until you raise the cap. You can also restrict a key to specific model types and give it an expiry date.

### What are the rate limits?

60 requests per minute per key, 120 per minute per account, and 5 concurrent requests per account. Exceeding a limit returns HTTP 429 with a retry-after header.

### How do video and other long-running generations work?

Asynchronous models must be called on POST /v1/run. They answer HTTP 202 with a job object and a poll_url. Poll GET /v1/jobs/{id} until the status is succeeded (the output contains the file URL) or failed. Status polling has its own limit of 300 requests per minute per key.

### Does the API support streaming, tools and JSON output?

Yes, for models whose catalog entry shows capabilities.streaming and capabilities.tools as true (models hosted on OpenAI-compatible providers — most text models). Those stream tokens live over server-sent events, accept tools, tool_choice and tool messages for function calling, and accept response_format with json_object or json_schema. Other text models still answer stream: true with the full reply in one chunk and refuse tools with HTTP 400 unsupported_parameter. n greater than 1, logprobs and logit_bias are not supported on any model.

### Can I get a webhook instead of polling a video job?

Yes. Add "webhook": "https://your-server/path" to a /v1/run or /v1/images/generations request. When the job finishes, RentPrompts POSTs a signed job.succeeded or job.failed event to that URL, retrying for about 35 hours until your server answers 2xx. Events are signed with the Standard Webhooks scheme using your key's webhook secret, which you find on the API keys page.

### Can I try a model before writing code?

Yes. Every model in the API runs on the website too: chat with text models in AI Chat (/generate/ai-chat) and try image, video and audio models from Generate (/generate/models). Prices are the same as the API (a few small text models are free on the website), paid from the same Joule wallet.

### I lost my API key. Can I see it again?

No. Keys are stored only as hashes, so the full key is shown once at creation. Revoke the lost key and create a new one.

### Does RentPrompts store my prompts or outputs from API calls?

The request log keeps metadata only — time, model, status, tokens, cost and latency. Prompt and output content is never stored in the log.

## Versioning

- **One stable version.** Every endpoint lives under /api/v1. Within v1 we only make additive changes: new endpoints, new optional request fields, new response fields and new error codes. Parse responses leniently and ignore fields you do not know.

- **Breaking changes.** A change that could break a working integration — removing a field or endpoint, changing a field's type, or making an optional field required — ships only in a new version (/api/v2). v1 keeps working for at least 12 months after v2 is released.

- **Deprecations.** Deprecated behaviour is announced here and keeps working for at least 90 days before removal. Requests that use it are listed in your usage so you can find them.

- **Models.** Models are added and retired as providers release and retire them. A retired model id answers 404 model_not_found; GET /v1/models is always the current list. Prices follow the website and are shown in the catalog before they apply.

## Changelog

### 2026-11-17 — Live streaming, function calling, webhooks and key rotation

- **added**: Real token streaming on /v1/chat/completions for models with capabilities.streaming in GET /v1/models.
- **added**: tools, tool_choice, parallel_tool_calls, tool messages and response_format json_schema on models with capabilities.tools.
- **added**: stream_options.include_usage: a final chunk with usage and rentprompts.cost_joules.
- **added**: A webhook URL on /v1/run and /v1/images/generations: signed job.succeeded / job.failed events (Standard Webhooks) with retries for ~35 hours.
- **added**: capabilities object on every model in GET /v1/models.
- **added**: Edit a key's name, model types and monthly cap; rotate a key in one step; per-key webhook signing secret.
- **added**: OpenAPI 3.1 spec at /apidocs/openapi.json, Markdown docs at /apidocs.md, and a status page.
- **changed**: Chat conversations on native models are sent with their roles and history instead of one combined prompt.
- **changed**: An Idempotency-Key on a streamed request only blocks concurrent duplicates; streams are not stored for replay.

### 2026-11-13 — Usage by key and by model maker

- **added**: Usage filters (24 hours, 7, 30 and 90 days, custom dates) and breakdowns by key, model and maker on the API keys page.
- **added**: inputs and outputs on every model in GET /v1/models.
- **changed**: Key management moved from /apidocs to /dashboard/api-keys.

### 2026-11-12 — Developer API launch

- **added**: rp_live_ keys with model-type scopes, monthly spend caps and expiry.
- **added**: /v1/chat/completions, /v1/images/generations, /v1/run, /v1/jobs/{id}, /v1/models, /v1/balance and /v1/usage.
- **added**: Idempotency-Key support, typed error codes, request ids and cost headers.
- **deprecated**: Profile API keys (UUID). They keep working on /api/v1/* only; create an rp_live_ key instead.
