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

# Generate

> This endpoint calls the gist and the variant specified in the url parameter

### Path parameters

<ParamField path="gistId" required type="string">
  Id of the gist to use
</ParamField>

<ParamField path="variantSlug" type="string">
  (optional) Slug of the variant to use. If not specified, we'll choose a variant based on variant traffic allocation.
</ParamField>

### Body

<ParamField body="values" type="object">
  A dictionary of variable names and values for the variables in the gist.
</ParamField>

### Response

<ResponseField name="error" type="string">
  Indicates whether the call failed with error
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="data" defaultOpen>
    <ResponseField name="id" type="string">
      The gist call id. Used for troubleshooting and tracing errors.
    </ResponseField>

    <ResponseField name="content" type="string">
      The gist output
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash Example Request
  curl --location --request POST 'https://api.gists.ai/v1/generate/<gist_id>/<variant_slug>' \
  --header 'Content-Type: application/json' \
  --header 'GISTS-API-KEY: <api_key>' \
  --data-raw '{
      "values": {
          "variable_1": "value 1",
          "variable_2": "value 2",
      }
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response
  {
    "error": null,
    "data": {
      "id": "cHJvbXB0OjEwMjQ2Nw==",
      "content": "As a large language model, ...",
    }
  }
  ```
</ResponseExample>
