API endpoints and fields

Choose the resource you need. Each page lists its endpoints and fields, with links to types shared by other resources. Start with the PDF generation API guide or generate your first PDF with the API if this is your first request.

Use with your agent

Give this prompt to your AI agent. The agent does the task for you.

Read https://thirds.ai/docs/api-reference and help me choose the right thirds.ai endpoint and write a request. Check the fields and credentials in this reference.

Request examples

Use curl, Node 24 or later, or Python 3. Save Node examples as .mjs files. Replace the API key and use a new idempotency key for each new output. The first command uses jq to save a gallery template as request.json, and the PDF example sends that file. See the quickstart for polling and download steps.

Shell
curl --fail --silent --show-error https://thirds.ai/gallery/monthly-report/template \
  | jq '{html: .source, data: .sample, wait: false}' > request.json
POST /v1/pdf
curl --fail-with-body --silent --show-error https://thirds.ai/v1/pdf \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: YOUR_UNIQUE_PDF_REQUEST' \
  --data @request.json
POST /v1/image
curl --fail-with-body --silent --show-error https://thirds.ai/v1/image \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: YOUR_UNIQUE_IMAGE_REQUEST' \
  --data '{"html":"<h1>Quarterly report</h1><p>Ready to share.</p>","image":{"format":"png","width":1200,"height":630},"wait":false}'

Resources

  • PDF renders: Create PDFs from HTML or saved templates, check each render, and read the result fields and limits.

  • Image renders: Create PNG, JPEG, or WebP images from HTML or saved templates, then check each render and download the result.

  • Image packs: Render one saved template version at several sizes, poll each size, retry failed sizes, and download a ZIP of the files that succeeded. See how to make static ad variations from one design for a worked example.

  • Carousels: Render selected pages of one saved template version as images, poll each slide, retry failed slides, and download a ZIP of the files that succeeded.

  • Batches: Render one saved template version once per data row, poll each row, retry failed rows, and download a ZIP of the files that succeeded.

  • File downloads: Download a finished PDF or image with its signed link, and check the response types and download limits. The guide to retrying requests and downloading files explains safe retries with an idempotency key.

  • Saved templates: Create and manage editable templates, start one from an AI chat message, preview changes, and publish fixed versions for repeat renders.

  • AI template chat: Send changes to a template's AI chat, check each draft, and save the draft you choose as the next version.

  • Brand kits: Manage brand colours, logos, and fonts, then apply the same brand kit when you create a template or image.

  • Image assets: Upload or generate private images for your templates, read prompt history, and check file limits.

  • Webhook endpoints: Manage webhook receivers, rotate secrets, check deliveries, and replay failed events for your account.

  • Account and API keys: Manage API keys and account identity requests, with the required credentials and response fields for each endpoint.

  • Public endpoints: Read the public API contract and service facts, or submit a testimonial with the required safety check.

  • Shared types and security: Look up shared request and response fields, error types, response headers, and API authentication schemes. See API error codes and how to fix them to resolve a named error.

API contract

Download the OpenAPI file to use with your tools. These reference pages come from that same contract. Browser writes need a session and its CSRF token; endpoints that support API keys state that on their resource page.

Ready to make your first file?

Start in the playground with a gallery template, or get an API key and send your first request from your own terminal.