v1

latestOpenAPI 3.0.32026-07-2691139249.7 KB
text_generator

Create Text Generator task

High-performance text generation endpoint on the async Starlette service. Authenticates via API token (X-API-KEY + X-API-ID).

Supports two modes:

  • Sync (sync: true): blocks until generation completes, returns the result directly.
  • Async (default): returns immediately with pending status. Poll GET /api/text_generator/{id}/ or use a webhook.
post/sse/text_generator/

Request body

model_namestring required

Name of the Gemini model (e.g. gemini-2.5-flash).

system_instructionstring

Optional system instruction for the model.

webhook_urlstring uri

Webhook URL for async status updates.

syncboolean

If true, the request blocks until generation completes and returns the result directly. Default is false (async).

Response

Text generation result or pending task.

idstring uuid required
model_namestring required
system_instructionstring

Optional system instruction for the model.

status'pending' | 'running' | 'done' | 'failed'
  • pending - pending
  • running - running
  • done - done
  • failed - failed
response_textstring

Generated text response from the model.

failed_reasonstring

Reason for failure if status is failed.

credits_usednumber double

Credits consumed for this generation.

created_atstring date-time required
updated_atstring date-time required