ForHosting KIT · Text & AI

Generate text

The text generation API takes a prompt and returns written text, queued behind a job system instead of a live stream — which means your invoice can be predicted in advance rather than discovered after the fact. There is no token meter to watch; you are billed per request plus a flat rate per 1,000 words produced.

● StablePer request + per 1,000 words$0.003
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.

Why put an LLM behind a queue

Most text-generation integrations are built for a chat window, where a person is staring at the screen waiting for words to stream in. A lot of real generation work — product copy at scale, report drafting, batch content for a CMS — has no one watching in real time, and forcing that work through a synchronous, streaming API just adds fragile connection-handling code for no benefit. This endpoint is built for the batch case: send the prompt, walk away, get the text when it is ready.

What sending a request actually looks like

A call to POST /text/generate with your prompt returns a task_id right away and queues the generation job. The finished text is delivered later through a signed webhook, which is the recommended route for anything automated, or through a signed link that stays valid for 24 hours if you would rather poll or hand a link to someone. Neither delivery method requires you to keep a socket open.

On pricing you can actually predict

Token-based pricing from most language-model providers is notoriously hard to estimate before a call finishes, because tokenization varies by content and language. This endpoint prices in request count and words instead: $0.003 per request plus $0.0135 per 1,000 words generated, so a batch of 500 prompts targeting roughly 300 words each has a cost you can compute on a spreadsheet before you ever call the API.

Where it fits in a larger system

Because the interface is a queue rather than a stream, text generation here composes cleanly with other async endpoints — feed a document Q&A result into a generation prompt, or chain generated text into a formatting or translation task, without ever needing to hold a request open across multiple model calls. Retries and failures are handled the same way across every endpoint, so your error handling stays uniform.

What to expect from output and limits

Longer prompts and longer requested outputs take proportionally longer to clear the queue; there is no artificial cap dressed up as a feature, just the honest tradeoff between length and wait time. Access requires prepaid balance rather than a free tier, which keeps the queue free of throwaway abuse traffic, and a task that fails after three retries returns a clear error and is never billed.

Overnight content batches

A CMS queues a week's worth of newsletter drafts before end of day and lets the webhooks fill the editorial calendar by morning.

Report drafting from structured data

A reporting tool turns a JSON summary of monthly metrics into a written narrative section, run automatically at the start of each reporting cycle.

Prompt chaining in a pipeline

A workflow generates an outline, waits for the webhook, then feeds each section back through the endpoint to expand it — all without a person in the loop.

Cost-predictable content scaling

A marketing team forecasts monthly spend for a content push by multiplying planned word counts against the published per-word rate, before writing a single prompt.

How does the text generation API work?

You send a prompt to POST /text/generate, it is queued as an async task, and the generated text is delivered by signed webhook or a signed link valid for 24 hours.

Is there a free trial for the text generation API?

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.

How is pricing calculated — is it per token?

No tokens: pricing is $0.003 per request plus $0.0135 per 1,000 words of generated text, a rate you can calculate in advance.

Why is the API asynchronous instead of streaming?

Streaming assumes someone is watching live; this endpoint targets batch and pipeline use, so it queues the job and delivers the finished result by webhook instead.

What happens if a generation task fails?

The task retries automatically up to three times; if it still fails you get a clear error and are never charged.

Can I use this for bulk content generation?

Yes — queue as many requests as you need in parallel; each returns its own task_id, which is what the endpoint is designed for.

How long is generated text available after completion?

The signed link stays valid for 24 hours, after which the result is deleted and never used for training.

How does this compare to a chat-style completion API?

A chat API is built for a live back-and-forth; this one is built for unattended batch generation with predictable, non-token-based pricing.

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/text/generate

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/text/generate \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"…"}'
{
  "text": "…"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "text.generate",
  "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.003
Per 1,000 words$0.0135

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

max_tokens20000
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 →