v1

latestOpenAPI 3.0.32026-07-26451985.7 KB

text-generation

Generate text from an initial prompt for applications like story generation, dialogue systems, and creative writing

post/models/v2/openai-community/gpt2

Request body

textstring required

The input text prompt to generate text from.

streamboolean

Enable text streaming.

Example request

{
  "text": "Once upon a time there was a beautiful home where",
  "params": {
    "min_length": 10,
    "max_length": 100,
    "temperature": 0.7
  }
}

Response

Successful text-generation response.

errorstring nullable required

Null on success; otherwise an error message.

outputstring required

The generated text completion.

Example response

{
  "output": "Once upon a time there was a beautiful home where a woman, who, after a long journey, had been able to return to her family..."
}