Skip to main content
POST
/
sse
/
text_generator
Create Text Generator task
curl --request POST \
  --url https://api.creatify.ai/sse/text_generator/ \
  --header 'Content-Type: application/json' \
  --header 'X-API-ID: <api-key>' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "model_name": "<string>",
  "messages": [
    {
      "role": "user",
      "content": ""
    }
  ],
  "system_instruction": "",
  "config": {
    "temperature": 123,
    "max_output_tokens": 123,
    "top_p": 123,
    "top_k": 123,
    "presence_penalty": 123,
    "frequency_penalty": 123,
    "seed": 123,
    "stop_sequences": [
      "<string>"
    ],
    "response_mime_type": "text/plain",
    "response_json_schema": "<unknown>"
  },
  "tools": [
    {
      "function_declarations": [
        {
          "name": "<string>",
          "description": "",
          "parameters": "<unknown>"
        }
      ]
    }
  ],
  "tool_config": {
    "function_calling_config": {
      "mode": "AUTO",
      "allowed_function_names": [
        "<string>"
      ]
    }
  },
  "webhook_url": "<string>",
  "sync": false
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "model_name": "<string>",
  "messages": [
    {
      "role": "user",
      "content": "",
      "function_call": {
        "name": "<string>",
        "args": {}
      },
      "function_response": {
        "name": "<string>",
        "response": {}
      }
    }
  ],
  "config": {
    "temperature": 123,
    "max_output_tokens": 123,
    "top_p": 123,
    "top_k": 123,
    "presence_penalty": 123,
    "frequency_penalty": 123,
    "seed": 123,
    "stop_sequences": [
      "<string>"
    ],
    "response_mime_type": "text/plain",
    "response_json_schema": "<unknown>"
  },
  "response_function_calls": [
    {
      "name": "<string>",
      "args": {}
    }
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "system_instruction": "<string>",
  "status": "pending",
  "response_text": "<string>",
  "failed_reason": "<string>",
  "credits_used": 123
}

Authorizations

X-API-ID
string
header
required

API ID, from your settings page.

X-API-KEY
string
header
required

API Key, from your settings page.

Body

application/json
model_name
string
required

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

Maximum string length: 255
messages
object[]
required

List of messages with 'role' (user/model) and 'content'.

system_instruction
string
default:""

Optional system instruction for the model.

config
object

Generation config parameters.

tools
object[]

List of tools (function declarations) the model may call.

tool_config
object

Controls how the model uses the provided tools.

webhook_url
string<uri>

Webhook URL for async status updates.

sync
boolean
default:false

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

Response

Text generation result or pending task.

id
string<uuid>
required
model_name
string
required
messages
object[]
required
config
object
required

Structured config serializer for OpenAPI documentation.

response_function_calls
object[]
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
system_instruction
string

Optional system instruction for the model.

status
enum<string>
  • pending - pending
  • running - running
  • done - done
  • failed - failed
Available options:
pending,
running,
done,
failed
response_text
string

Generated text response from the model.

failed_reason
string

Reason for failure if status is failed.

credits_used
number<double>

Credits consumed for this generation.