# Text Completion

Once you initialized the client and stored it as a variable, we can simply use the TextCompletion function in the client like this:\
\


{% code lineNumbers="true" %}
```lua
local response = client.TextCompletion({
    prompt = 'Human: Hello\nAI:',
    stop = {
        'Human:',
        'AI:'
    }
})
```
{% endcode %}

The response variable will contain the following:

* Used model "response.model" (string)
* The first choice "response.choice" (table)
* Token usage "response.usage" (table)&#x20;

<details>

<summary>All arguments/Options</summary>

prompt (string) (required)

temperature (number) (optional) (default: 0.7)

max\_tokens (number) (optional) (default: 256)

stop (table) (optional) (default: {})

</details>
