15Reference
OpenAPI
A description of all the public API’s methods in one file. Upload it to Postman or a client generator, and the methods, fields, and response codes appear there on their own.
File
This is a standard OpenAPI 3.1 file. It describes five methods, the format of request and response bodies, and the authorization scheme.
What is in the file
POST/images/generateCreate an image
X-Idempotency-Key header. Responds with 202 and a task identifier.GET/creations/{id}Status and result
error and failure.POST/uploadsUpload a reference image
file_id that lives for 24 hours.GET/modelsCatalog and prices
GET/balanceBalance
The main response codes are shown; the full list is in the “Error codes” section. Webhooks are not part of the file: you give their address in the generation request, and the event format is described in the “Webhooks” section.
How to use it
Open the file in Postman or Insomnia
In the app, choose “Import,” paste the link to the file or drag in the downloaded
openapi.json. The methods appear as a group: all that remains is to add your key to the authorization settings.Generate a client for your language
Any generator that understands OpenAPI 3.1 will do. For example, types for TypeScript:
npx openapi-typescript openapi.json -o rendergrid.d.tsA client for Python (requires Java):
npx @openapitools/openapi-generator-cli generate \ -i openapi.json -g python -o ./rendergrid-clientCheck the response with a live request
The file describes fields and codes but does not replace testing. Send one request from the quickstart and compare the response with the description.
A generated client lacks retries and waiting. Add retries on 429, the X-Idempotency-Key header, and task polling yourself: Limits, Idempotency.
Authorization
The file describes two schemes, and both accept the same key:
| Scheme | Header | Example |
|---|---|---|
| Bearer | Authorization | Authorization: Bearer rg_live_… |
| Key in a header | X-API-Key | X-API-Key: rg_live_… |
For where to get a key and how to keep it safe, see the “Keys and authentication” section.
Version and changes
The API version is part of the address: /api/. Within a version, new fields and new error codes can appear in responses, so parse a response tolerantly: ignore unfamiliar fields, and handle an unfamiliar code by its type.
What changed and when: see the “What’s new” page.