Skip to main content

Legacy API

Legacy API

These endpoints are part of the legacy neuroflash API and are no longer actively developed. For new integrations, use the modern Content Generation endpoints.

Generate Text

POST/api/word-embedding/generate_text

Request Body

FieldTypeRequiredDescription
keywordsstringNoThe keywords to base output generation on.
keywords2stringNoThe second keywords to base output generation on.
extra_inputstringNoAn extra input to base output generation on.
extra_input2stringNoAnother extra input to base output generation on.
textstringNoText to generate outputs about.
tonalityarray<string>NoSteer the tonality parameter to be inserted into a suitable prompt.
lengthstringNoSteer the length parameter to be inserted into a suitable prompt.
output_typestringYesWhich output type to generate.
audience_model_idstringYesWhich prompt/success-model to use.
n_timesintegerNoHow often to run the resulting prompts in parallel and accumulate all results
n_text_itemsintegerNoHow many text items to generate. Overrides n_times logic.
qualitystringNoAn enumeration.
personalitystringNoText to describe a personality
personality_idintegerNoIdentifier for the personality (if present)
informationarray<object>NoContext information to base the output generation on.
idintegerYes
contentstringYes
category_namestringNo
brand_voiceobjectNoA dictionary representing the brand voice to be used for text generation.
brand_voice_idstringNoIdentifier for the brand voice (if present)
audienceobjectNoA dictionary representing the audience to be used for text generation.
target_audience_idstringNoID of the audience

Response

FieldTypeDescription
outputsarray<object>Generated outputs based on the inputs.
textstring
generation_idinteger
text_item_idstring
n_tokens_inputinteger
n_tokens_usedinteger
n_tokens_showninteger
n_words_inputinteger
n_words_usedinteger
n_words_showninteger

Example

curl -X POST "https://app.neuroflash.com/api/word-embedding/generate_text" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"keywords": "string",
"keywords2": "string",
"extra_input": "string",
"extra_input2": "string",
"text": "string",
"tonality": [],
"length": "string",
"output_type": "string",
"audience_model_id": "string",
"n_times": 0,
"n_text_items": 0,
"quality": "string",
"personality": "string",
"personality_id": 0,
"information": [],
"brand_voice": {},
"brand_voice_id": "string",
"audience": {},
"target_audience_id": "string"
}'

Response:

{
"outputs": [
{
"text": "This is a very innovative subject line.",
"generation_id": 12345,
"text_item_id": "d911f60c-779e-425e-86d2-c8d9f1d5c93b"
}
],
"n_tokens_input": 0,
"n_tokens_used": 0,
"n_tokens_shown": 0,
"n_words_input": 0,
"n_words_used": 0,
"n_words_shown": 0
}

Generate Text Stream

POST/api/word-embedding/generate_text_stream

Request Body

FieldTypeRequiredDescription
keywordsstringNoThe keywords to base output generation on.
keywords2stringNoThe second keywords to base output generation on.
extra_inputstringNoAn extra input to base output generation on.
extra_input2stringNoAnother extra input to base output generation on.
textstringNoText to generate outputs about.
tonalityarray<string>NoSteer the tonality parameter to be inserted into a suitable prompt.
lengthstringNoSteer the length parameter to be inserted into a suitable prompt.
output_typestringYesWhich output type to generate.
audience_model_idstringYesWhich prompt/success-model to use.
n_timesintegerNoHow often to run the resulting prompts in parallel and accumulate all results
n_text_itemsintegerNoHow many text items to generate. Overrides n_times logic.
qualitystringNoAn enumeration.
personalitystringNoText to describe a personality
personality_idintegerNoIdentifier for the personality (if present)
informationarray<object>NoContext information to base the output generation on.
idintegerYes
contentstringYes
category_namestringNo
brand_voiceobjectNoA dictionary representing the brand voice to be used for text generation.
brand_voice_idstringNoIdentifier for the brand voice (if present)
audienceobjectNoA dictionary representing the audience to be used for text generation.
target_audience_idstringNoID of the audience

Response

FieldTypeDescription
outputsarray<object>Generated outputs based on the inputs.
textstring
generation_idinteger
text_item_idstring
n_tokens_inputinteger
n_tokens_usedinteger
n_tokens_showninteger
n_words_inputinteger
n_words_usedinteger
n_words_showninteger

Example

curl -X POST "https://app.neuroflash.com/api/word-embedding/generate_text_stream" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"keywords": "string",
"keywords2": "string",
"extra_input": "string",
"extra_input2": "string",
"text": "string",
"tonality": [],
"length": "string",
"output_type": "string",
"audience_model_id": "string",
"n_times": 0,
"n_text_items": 0,
"quality": "string",
"personality": "string",
"personality_id": 0,
"information": [],
"brand_voice": {},
"brand_voice_id": "string",
"audience": {},
"target_audience_id": "string"
}'

Response:

{
"outputs": [
{
"text": "This is a very innovative subject line.",
"generation_id": 12345,
"text_item_id": "d911f60c-779e-425e-86d2-c8d9f1d5c93b"
}
],
"n_tokens_input": 0,
"n_tokens_used": 0,
"n_tokens_shown": 0,
"n_words_input": 0,
"n_words_used": 0,
"n_words_shown": 0
}

Get Prompts

GET/api/word-embedding/get_prompts

Example

curl "https://app.neuroflash.com/api/word-embedding/get_prompts" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response:

[
{
"country": "de",
"language": "de",
"output_type": {
"id": "string",
"label": "string"
},
"output_type_category": {
"id": "string",
"label": "string"
},
"n_times": 1,
"n_text_items": 2,
"display_in_select": false,
"text": {
"label": "string",
"placeholder": "string",
"prefill_value": "string",
"character_limit": 600
},
"keywords": {
"label": "string",
"placeholder": "string",
"prefill_value": "string",
"character_limit": 600
},
"keywords2": {
"label": "string",
"placeholder": "string",
"prefill_value": "string",
"character_limit": 600
},
"video_id": "string",
"output_type_description": "string"
}
]

Get Prompts by Country and Language

GET/api/word-embedding/get_prompts/{country}/{language}

Path Parameters

ParameterTypeRequiredDescription
countrystringYes
languagestringYes

Example

curl "https://app.neuroflash.com/api/word-embedding/get_prompts/{country}/{language}" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response:

[
{
"country": "de",
"language": "de",
"output_type": {
"id": "string",
"label": "string"
},
"output_type_category": {
"id": "string",
"label": "string"
},
"n_times": 1,
"n_text_items": 2,
"display_in_select": false,
"text": {
"label": "string",
"placeholder": "string",
"prefill_value": "string",
"character_limit": 600
},
"keywords": {
"label": "string",
"placeholder": "string",
"prefill_value": "string",
"character_limit": 600
},
"keywords2": {
"label": "string",
"placeholder": "string",
"prefill_value": "string",
"character_limit": 600
},
"video_id": "string",
"output_type_description": "string"
}
]