ForHosting KIT · Documents & PDF

Generate a contract PDF

The Contract Generator API takes a template you control and a set of variables — party names, dates, amounts, clauses that change deal by deal — and merges them into a finished PDF ready to send for signature. It exists because the words of a contract rarely change, but the names and numbers inside it change every single time.

● StablePer request + per document$0.040
Use it from WebAPIEmailApp soonTelegram soon

Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.

The problem with contracts is repetition, not language

Most contracts a business sends out are legally the same document with different names, dates, and figures dropped in: an NDA, a service agreement, a lease addendum, an employment offer. Retyping or copy-pasting those variables into a document by hand is where errors creep in — a wrong date, a stale clause, a name misspelled in paragraph three but not the signature block. The contract generator api is built to eliminate that step entirely by treating the contract as a template plus data, not a document someone edits by hand each time.

How the merge works

You provide a template — identified by an ID or reference you've configured — and a JSON object of variables: party names and addresses, effective and expiration dates, monetary terms, and any optional clauses that apply to this specific instance. The service merges the two, filling every placeholder correctly and producing a properly formatted PDF where the legal language is untouched and only the variable content changes, call after call.

Generation and delivery, end to end

Calling POST /pdf/contract returns a task_id immediately, with the actual merge and rendering happening asynchronously on our global edge. Once the contract PDF is ready, you're notified through a signed webhook — the right fit for a system that immediately routes the document into an e-signature flow — or through a signed link valid for 24 hours when a person just needs to review and download one copy.

From boilerplate to binding document, at software speed

The idea of a template contract with fill-in variables long predates software — standard-form agreements have existed for as long as businesses needed repeatable deals with different counterparties. What changes here is the speed and reliability: a hiring platform generating an offer letter the moment a candidate accepts terms, a leasing company producing a tenant-specific lease the instant an application is approved, a vendor platform issuing a service agreement per new client onboarded. Because each request is self-contained, contract generation becomes a step in the workflow itself, not a queue for someone in legal or operations.

What it costs and how contract data is handled

Pricing is $0.040 per request plus $0.001 per document, a published rate with no tokens and no invented credits. A failed generation is never charged — we retry three times and return a clear error rather than leave you guessing. Access requires prepaid balance; there's no free tier or trial, which is precisely what keeps the endpoint fast and abuse-free, with requests lacking balance returning 402. Contract content and variables are deleted after the retention window and are never used to train anything.

Employment offer letters

A hiring platform merges candidate name, title, salary, and start date into the offer template the moment an offer is approved internally.

Tenant-specific lease agreements

A property management system generates a lease with the tenant's details and unit-specific terms as soon as a rental application is approved.

Client service agreements

A vendor or agency platform issues a service agreement with the new client's scope and rates filled in automatically during onboarding.

NDAs for new counterparties

A deal-flow tool generates a non-disclosure agreement with the counterparty's legal name and effective date every time a new negotiation begins.

How do I generate a contract PDF with an API?

Send a template reference plus a JSON object of variables to POST /pdf/contract and you get a task_id back. The contract generator api merges the two asynchronously and delivers the PDF by signed webhook or a signed link valid for 24 hours.

Is this API free?

There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.

Can I use my own contract templates?

Yes. You provide the template and the endpoint merges your variables into it, so the legal language stays exactly as you wrote it while only the deal-specific fields change.

Does it check the contract for legal correctness?

No. The service merges your template with the data you provide and produces a correctly formatted PDF; the legal content and its enforceability remain your responsibility and your template's.

Can I generate contracts for many counterparties at once?

Yes. Because the endpoint is asynchronous and each call is independent, you can generate a contract per counterparty in parallel from a single onboarding or hiring batch.

What happens if a contract fails to generate?

A failed task is never charged. We retry three times and, if it still can't be built, you get a clear error instead of a silent failure or a charge.

Can the output feed directly into an e-signature tool?

Yes. The signed webhook delivers the finished PDF the moment it's ready, which fits naturally into a workflow that immediately routes the document into an e-signature step.

How long can I access the generated contract?

The signed link stays valid for 24 hours, or you can receive the PDF immediately by signed webhook. After the retention window it's deleted and never used for training.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/pdf/contract

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/pdf/contract \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"pdf":"https://ejemplo.com/documento.pdf"}'
{
  "pdf": "https://ejemplo.com/documento.pdf"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "pdf.contract",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.040
Per document$0.001

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
max_pages200
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.
422task_failedThe task failed after 3 retries. You are never charged for it.

Read the full KIT documentation →