> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bytez.com/llms.txt
> Use this file to discover all available pages before exploring further.

# text2text-generation

> Generate text from input text for applications like text completion, content generation, and dialogue systems

> **Basic usage**
>
> Send a prompt to a model to generate text
>
> ```javascript javascript theme={null}
> import Bytez from 'bytez.js';
>
> // insert your key
> const sdk = new Bytez('BYTEZ_KEY');
>
> // choose your model
> const model = sdk.model('google/flan-t5-base');
>
> // provide the model with input
> const input = "Once upon a time there was a beautiful home where";
>
> // provide the model with params
> const params = {
>   "max_new_tokens": 200,
>   "min_new_tokens": 50,
>   "temperature": 0.5
> };
>
> // send to the model
> const { error, output } = await model.run(input, params);
>
> // observe the output
> console.log({ error, output });
>
> ```
>
> ```python python theme={null}
> from bytez import Bytez
>
> # insert your key
> sdk = Bytez("BYTEZ_KEY")
>
> # choose your model
> model = sdk.model("google/flan-t5-base")
>
> # provide the model with input
> input = "Once upon a time there was a beautiful home where"
>
> # provide the model with params
> params = {
>   "max_new_tokens": 200,
>   "min_new_tokens": 50,
>   "temperature": 0.5
> }
>
> # send to the model
> result = model.run(input, params)
>
> # observe the output
> print({"error": result.error, "output": result.output})
>
> ```
>
> ```bash http theme={null}
> curl -X POST 'https://api.bytez.com/models/v2/google/flan-t5-base' \
> -H 'Authorization: BYTEZ_KEY' \
> -H 'Content-Type: application/json' \
> --data '{
>   "text": "Once upon a time there was a beautiful home where",
>   "params": {
>     "max_new_tokens": 200,
>     "min_new_tokens": 50,
>     "temperature": 0.5
>   }
> }'
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.