Text Generator
Official API verified 2026-07-31Generate text with supported Gemini models through synchronous, asynchronous, or Server-Sent Events streaming workflows.
Endpoints
| Operation | Endpoint |
|---|---|
| Create sync or async task | POST /sse/text_generator/ |
| Stream a task | POST /sse/text_generator/stream/ |
| List tasks | GET /api/text_generator/ |
| Get task | GET /api/text_generator/{id}/ |
Required input
model_namemessages, usinguserormodelroles
Optional fields include system_instruction, generation config, tools, tool configuration, webhook_url, and sync.
Choose a mode
| Mode | Behavior | Best use |
|---|---|---|
| Sync | Set sync: true; request waits for the completed response | Short deterministic jobs |
| Async | Default; returns pending | Longer or multimodal jobs, polling, and webhooks |
| Streaming | Returns Gemini-native chunks over SSE | Interactive text output |
Async example
bash
curl --request POST \
--url https://api.creatify.ai/sse/text_generator/ \
--header 'Content-Type: application/json' \
--header "X-API-ID: $CREATIFY_API_ID" \
--header "X-API-KEY: $CREATIFY_API_KEY" \
--data '{
"model_name": "gemini-2.5-flash",
"messages": [
{"role": "user", "content": "Write three source-backed hooks for a local SEO and GEO video."}
],
"system_instruction": "Return concise marketing hooks without unsupported claims."
}'Poll GET /api/text_generator/{id}/ until status is done or use webhook_url. Read response_text, response_function_calls, failed_reason, and credits_used from the result.
Streaming boundary
The streaming endpoint returns text/event-stream. Its final SSE chunk includes a Creatify object containing the generation ID and credits used.
Safety and cost
- Keep API credentials server-side.
- Treat HTTP 402 as insufficient credits and HTTP 429 as a rate-limit response.
- Use async mode for image or video inputs and other potentially slow requests.
- Record the returned
credits_usedrather than estimating text-generation cost.
Source: official Text Generator overview.