RentPrompts API
Call GPT-5.2, Claude Fable 5.1, Gemini 3.8 Flash, Grok 4.2, FLUX 2 Pro, Kling Image V3 and every other text, image, video, audio model through one OpenAI-compatible API. Pay only for successful calls, in Joules topped up with UPI or card — no USD card or subscription needed.
Every price is in Joules, the RentPrompts credit: 1 Joule = ₹1 ≈ $0.0108 · $1 ≈ 93 Joules.
curl https://payload.rentprompts.com/api/v1/chat/completions \
-H "Authorization: Bearer $RENTPROMPTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-m27",
"messages": [{ "role": "user", "content": "Hello" }]
}'{
"choices": [
{ "message": { "role": "assistant", "content": "Hi there!" } }
],
"usage": { "prompt_tokens": 9, "completion_tokens": 8 },
"rentprompts": { "cost_joules": 0.0021, "balance_joules": 248.31 }
}One key, every model
Text, image, video and audio through one API.
OpenAI-compatible
Point any OpenAI SDK at our base URL.
Pay only for success
Failed calls are never charged.
Spend caps per key
Set a monthly limit on every key.
Sign up free, verify your email, then create a key. It is shown once, so store it in an environment variable.
Calls are paid from your wallet. Top up any amount; only successful generations are charged.
Use base URL https://payload.rentprompts.com/api/v1 with any OpenAI SDK, or plain HTTP:
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
}'Want to try a model before writing code? Chat with any text model or run image, video and audio models in the browser — same models, same prices.
Model
POST /api/v1/chat/completions
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
}'Replace rp_live_YOUR_KEY with your key, ideally via the RENTPROMPTS_API_KEY environment variable. Keys are shown only once, so they are never filled in here. Get your API key →
140 models · prices in Joules
minimax-m27 · MiniMaxTakes TextText (Text model)0.12 Joules in · 0.2 Joules out / 1K tokenskling-image-v3 · Kling (Kuaishou)Takes TextImage (Image model)3.8 Joules / imagegpt-52-2025-12-11 · OpenAITakes TextText (Text model)0.68 Joules in · 1.9 Joules out / 1K tokenskimi-k2-thinking · Moonshot AITakes TextText (Text model)0.27 Joules in · 0.5 Joules out / 1K tokensnano-banana-pro-edit · GoogleTakes Text (optional) + ImageImage (Image model)15.2 Joules / imagenano-banana-pro · GoogleTakes TextImage (Image model)12.66 Joules / imageflux-2-pro · Black Forest LabsTakes TextImage (Image model)3.61 Joules / imagegpt-image-1 · OpenAITakes TextImage (Image model)10.79 Joules / imagenano-banana · GoogleTakes TextImage (Image model)7.74 Joules / imagegrok-42 · xAITakes TextText (Text model)0.32 Joules in · 0.45 Joules out / 1K tokensgrok-imagine · xAITakes TextVideo· async (Video model)6 Joules / secondlyria-3-pro-preview · GoogleTakes TextAudio (Audio model)9 Joules / requestSend your key as a bearer token on every request. The base URL is https://payload.rentprompts.com/api/v1. Create, rotate and revoke keys under Dashboard → API keys; a new key is shown once, so copy it into an environment variable straight away.
Authorization: Bearer rp_live_YOUR_KEYOlder profile keys (a UUID sent as Authorization: users API-Key <uuid>) still work but are deprecated — create an rp_live_ key to get scopes, spend caps and usage per key.
Every error has the same JSON shape:
{
"error": {
"type": "billing_error",
"code": "insufficient_balance",
"message": "…",
"param": "model"
}
}Useful response headers:
On 429, wait for retry-after seconds, then retry with exponential backoff.
Status polling (GET /v1/jobs/{id}) has its own limit of 300 requests per minute per key, so polling never uses up your generation limit.
Send "stream": true to receive the answer as server-sent events in the OpenAI chat.completion.chunk format, ending with data: [DONE]. Models whose catalog entry has capabilities.streaming: true stream tokens as they are generated; other models send the whole answer in one chunk. Add "stream_options": { "include_usage": true } to get a final chunk with usage and rentprompts.cost_joules. If you disconnect early you are charged only for what was generated; if the model fails mid-answer, the stream ends with an error event and you pay only for the text already sent.
On models with capabilities.tools: true, tools, tool_choice, parallel_tool_calls, assistant tool_calls and tool messages work exactly as in the OpenAI API, and response_format accepts json_object and json_schema. The whole conversation is sent to the model with its roles. Other models refuse tools with 400 unsupported_parameter. n greater than 1, logprobs and logit_bias are not supported.
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"parameters": { "type": "object", "properties": { "city": { "type": "string" } } }
}
}],
"tool_choice": "auto"Pass media as URLs. They are fetched on the RentPrompts servers: public https URLs only, at most 15 MB each. The whole request body may be at most 25 MB (larger bodies get 413 request_too_large).
Send an Idempotency-Key header (any unique string, e.g. a UUID) to make retries safe: the same key within 24 hours is never charged twice. Reusing a key with a different request body returns 422 idempotency_key_reused, and a retry sent while the first request is still running returns 409. Streamed responses are not stored for replay.
Video, and some image and audio models, run asynchronously and must be called on POST /v1/run. They answer HTTP 202 with a poll_url. Poll GET /v1/jobs/{id} every few seconds until status is succeeded (the file is in output.url or output.urls) or failed. Only the key's own account can read a job.
{ "id": "job_…", "object": "job", "status": "succeeded",
"output": { "url": "https://…" } }Instead of polling, add "webhook": "https://your-server/rentprompts" to an async request. When the job finishes, RentPrompts sends a POST with a job.succeeded or job.failed event whose data is the same job object GET /v1/jobs/{id} returns. Answer with any 2xx within 15 seconds. Failed deliveries are retried after 5 s, 1 min, 5 min, 30 min, 2 h, 8 h and 24 h, always with the same webhook-id, so use it to ignore duplicates.
Events are signed with Standard Webhooks: webhook-signature is v1, + base64 HMAC-SHA256 of webhook-id.webhook-timestamp.body, keyed with your key's webhook secret (API keys page → key menu → Webhook signing secret). Any Standard Webhooks library verifies it; reject events older than 5 minutes.
import { Webhook } from "standardwebhooks";
const wh = new Webhook(process.env.RENTPROMPTS_WEBHOOK_SECRET);
// rawBody: the exact request body string; headers: the request headers
const event = wh.verify(rawBody, headers); // throws if the signature is wrong
if (event.type === "job.succeeded") console.log(event.data.output.url);You are charged only for successful generations, at the same prices as the website and exactly the price listed in the catalog, from the same Joule wallet. When a request starts, its worst-case cost is reserved from your balance (it must fit in your balance minus requests already in flight); when it finishes you are charged the actual cost and the rest is released. In the rare case a charge cannot be collected straight away, the unpaid amount is collected automatically on your next request. Each response includes cost_joules and your remaining balance. 1 Joule = ₹1 ≈ $0.0108 ($1 ≈ 93 Joules). Joules are bought on the Pricing page.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
The request log keeps metadata only — time, model, status, tokens, cost and latency. Prompt and output content is never stored in the log.
Free to sign up. One key for every model; pay only for what succeeds.