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": [
{
"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_json_schema": "<unknown>"
},
"tools": [
{
"function_declarations": [
{
"name": "<string>",
"description": "",
"parameters": "<unknown>"
}
]
}
],
"tool_config": {
"function_calling_config": {
"allowed_function_names": [
"<string>"
]
}
},
"webhook_url": "<string>",
"sync": false
}
'import requests
url = "https://api.creatify.ai/sse/text_generator/"
payload = {
"model_name": "<string>",
"messages": [{ "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_json_schema": "<unknown>"
},
"tools": [{ "function_declarations": [
{
"name": "<string>",
"description": "",
"parameters": "<unknown>"
}
] }],
"tool_config": { "function_calling_config": { "allowed_function_names": ["<string>"] } },
"webhook_url": "<string>",
"sync": False
}
headers = {
"X-API-ID": "<api-key>",
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-ID': '<api-key>',
'X-API-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: '<string>',
messages: [{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_json_schema: '<unknown>'
},
tools: [
{
function_declarations: [{name: '<string>', description: '', parameters: '<unknown>'}]
}
],
tool_config: {function_calling_config: {allowed_function_names: ['<string>']}},
webhook_url: '<string>',
sync: false
})
};
fetch('https://api.creatify.ai/sse/text_generator/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.creatify.ai/sse/text_generator/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model_name' => '<string>',
'messages' => [
[
'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_json_schema' => '<unknown>'
],
'tools' => [
[
'function_declarations' => [
[
'name' => '<string>',
'description' => '',
'parameters' => '<unknown>'
]
]
]
],
'tool_config' => [
'function_calling_config' => [
'allowed_function_names' => [
'<string>'
]
]
],
'webhook_url' => '<string>',
'sync' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-ID: <api-key>",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.creatify.ai/sse/text_generator/"
payload := strings.NewReader("{\n \"model_name\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"\"\n }\n ],\n \"system_instruction\": \"\",\n \"config\": {\n \"temperature\": 123,\n \"max_output_tokens\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"presence_penalty\": 123,\n \"frequency_penalty\": 123,\n \"seed\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"response_json_schema\": \"<unknown>\"\n },\n \"tools\": [\n {\n \"function_declarations\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\",\n \"parameters\": \"<unknown>\"\n }\n ]\n }\n ],\n \"tool_config\": {\n \"function_calling_config\": {\n \"allowed_function_names\": [\n \"<string>\"\n ]\n }\n },\n \"webhook_url\": \"<string>\",\n \"sync\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-ID", "<api-key>")
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.creatify.ai/sse/text_generator/")
.header("X-API-ID", "<api-key>")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model_name\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"\"\n }\n ],\n \"system_instruction\": \"\",\n \"config\": {\n \"temperature\": 123,\n \"max_output_tokens\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"presence_penalty\": 123,\n \"frequency_penalty\": 123,\n \"seed\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"response_json_schema\": \"<unknown>\"\n },\n \"tools\": [\n {\n \"function_declarations\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\",\n \"parameters\": \"<unknown>\"\n }\n ]\n }\n ],\n \"tool_config\": {\n \"function_calling_config\": {\n \"allowed_function_names\": [\n \"<string>\"\n ]\n }\n },\n \"webhook_url\": \"<string>\",\n \"sync\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creatify.ai/sse/text_generator/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-ID"] = '<api-key>'
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model_name\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"\"\n }\n ],\n \"system_instruction\": \"\",\n \"config\": {\n \"temperature\": 123,\n \"max_output_tokens\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"presence_penalty\": 123,\n \"frequency_penalty\": 123,\n \"seed\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"response_json_schema\": \"<unknown>\"\n },\n \"tools\": [\n {\n \"function_declarations\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\",\n \"parameters\": \"<unknown>\"\n }\n ]\n }\n ],\n \"tool_config\": {\n \"function_calling_config\": {\n \"allowed_function_names\": [\n \"<string>\"\n ]\n }\n },\n \"webhook_url\": \"<string>\",\n \"sync\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_name": "<string>",
"messages": [
{
"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_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>",
"response_text": "<string>",
"failed_reason": "<string>",
"credits_used": 123
}{
"error": "<string>"
}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
pendingstatus. PollGET /api/text_generator/{id}/or use a webhook.
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": [
{
"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_json_schema": "<unknown>"
},
"tools": [
{
"function_declarations": [
{
"name": "<string>",
"description": "",
"parameters": "<unknown>"
}
]
}
],
"tool_config": {
"function_calling_config": {
"allowed_function_names": [
"<string>"
]
}
},
"webhook_url": "<string>",
"sync": false
}
'import requests
url = "https://api.creatify.ai/sse/text_generator/"
payload = {
"model_name": "<string>",
"messages": [{ "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_json_schema": "<unknown>"
},
"tools": [{ "function_declarations": [
{
"name": "<string>",
"description": "",
"parameters": "<unknown>"
}
] }],
"tool_config": { "function_calling_config": { "allowed_function_names": ["<string>"] } },
"webhook_url": "<string>",
"sync": False
}
headers = {
"X-API-ID": "<api-key>",
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-ID': '<api-key>',
'X-API-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: '<string>',
messages: [{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_json_schema: '<unknown>'
},
tools: [
{
function_declarations: [{name: '<string>', description: '', parameters: '<unknown>'}]
}
],
tool_config: {function_calling_config: {allowed_function_names: ['<string>']}},
webhook_url: '<string>',
sync: false
})
};
fetch('https://api.creatify.ai/sse/text_generator/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.creatify.ai/sse/text_generator/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model_name' => '<string>',
'messages' => [
[
'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_json_schema' => '<unknown>'
],
'tools' => [
[
'function_declarations' => [
[
'name' => '<string>',
'description' => '',
'parameters' => '<unknown>'
]
]
]
],
'tool_config' => [
'function_calling_config' => [
'allowed_function_names' => [
'<string>'
]
]
],
'webhook_url' => '<string>',
'sync' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-ID: <api-key>",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.creatify.ai/sse/text_generator/"
payload := strings.NewReader("{\n \"model_name\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"\"\n }\n ],\n \"system_instruction\": \"\",\n \"config\": {\n \"temperature\": 123,\n \"max_output_tokens\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"presence_penalty\": 123,\n \"frequency_penalty\": 123,\n \"seed\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"response_json_schema\": \"<unknown>\"\n },\n \"tools\": [\n {\n \"function_declarations\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\",\n \"parameters\": \"<unknown>\"\n }\n ]\n }\n ],\n \"tool_config\": {\n \"function_calling_config\": {\n \"allowed_function_names\": [\n \"<string>\"\n ]\n }\n },\n \"webhook_url\": \"<string>\",\n \"sync\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-ID", "<api-key>")
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.creatify.ai/sse/text_generator/")
.header("X-API-ID", "<api-key>")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model_name\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"\"\n }\n ],\n \"system_instruction\": \"\",\n \"config\": {\n \"temperature\": 123,\n \"max_output_tokens\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"presence_penalty\": 123,\n \"frequency_penalty\": 123,\n \"seed\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"response_json_schema\": \"<unknown>\"\n },\n \"tools\": [\n {\n \"function_declarations\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\",\n \"parameters\": \"<unknown>\"\n }\n ]\n }\n ],\n \"tool_config\": {\n \"function_calling_config\": {\n \"allowed_function_names\": [\n \"<string>\"\n ]\n }\n },\n \"webhook_url\": \"<string>\",\n \"sync\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creatify.ai/sse/text_generator/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-ID"] = '<api-key>'
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model_name\": \"<string>\",\n \"messages\": [\n {\n \"content\": \"\"\n }\n ],\n \"system_instruction\": \"\",\n \"config\": {\n \"temperature\": 123,\n \"max_output_tokens\": 123,\n \"top_p\": 123,\n \"top_k\": 123,\n \"presence_penalty\": 123,\n \"frequency_penalty\": 123,\n \"seed\": 123,\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"response_json_schema\": \"<unknown>\"\n },\n \"tools\": [\n {\n \"function_declarations\": [\n {\n \"name\": \"<string>\",\n \"description\": \"\",\n \"parameters\": \"<unknown>\"\n }\n ]\n }\n ],\n \"tool_config\": {\n \"function_calling_config\": {\n \"allowed_function_names\": [\n \"<string>\"\n ]\n }\n },\n \"webhook_url\": \"<string>\",\n \"sync\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_name": "<string>",
"messages": [
{
"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_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>",
"response_text": "<string>",
"failed_reason": "<string>",
"credits_used": 123
}{
"error": "<string>"
}Authorizations
API ID, from your settings page.
API Key, from your settings page.
Body
Name of the Gemini model (e.g. gemini-2.5-flash).
255List of messages with 'role' (user/model) and 'content'.
Show child attributes
Show child attributes
Optional system instruction for the model.
Generation config parameters.
Show child attributes
Show child attributes
List of tools (function declarations) the model may call.
Show child attributes
Show child attributes
Controls how the model uses the provided tools.
Show child attributes
Show child attributes
Webhook URL for async status updates.
If true, the request blocks until generation completes and returns the result directly. Default is false (async).
Response
Text generation result or pending task.
Show child attributes
Show child attributes
Structured config serializer for OpenAPI documentation.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Optional system instruction for the model.
pending- pendingrunning- runningdone- donefailed- failed
pending, running, done, failed Generated text response from the model.
Reason for failure if status is failed.
Credits consumed for this generation.

