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

# Caption from text

### Body

This endpoint will generate social media captions.

<ParamField body="text" type="string">
  This is the text you want to generate social media captions for.
</ParamField>

<ParamField body="tone" type="string">
  How should the social media caption sound like? (e.g. funny, serious, etc.)
</ParamField>

<ParamField body="brand_description" type="string">
  This is the description of your brand.
</ParamField>

<ParamField body="guildelines" type="string">
  Any guidelines you want our model to follow? (e.g. no profanity, etc.)
</ParamField>

<ParamField body="expand" type="boolean">
  Optional: This is a boolean value to expand the text to a longer caption. Default is false.
</ParamField>

### Response

<ResponseField name="caption" type="string">
  This is the generated social media caption.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST \
    <BASE_URL>/caption \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: YOUR_API_KEY' \
    -d '{
      "text": "Your text here",
      "tone": "Friendly",
      "brand_description": "Your brand description",
      "guidelines": "Some guidelines",
      "expand": true
  }'

  ```

  ```bash PHP theme={null}
  <?php
  $url = '<BASE_URL>/caption';
  $data = array(
      "text" => "Your text here",
      "tone" => "Friendly",
      "brand_description" => "Your brand description",
      "guidelines" => "Some guidelines",
      "expand" => true
  );

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
  curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      'Content-Type: application/json',
      'X-API-Key: YOUR_API_KEY'
  ));

  $response = curl_exec($ch);
  curl_close($ch);

  echo $response;
  ?>

  ```

  ```bash Python theme={null}
  import requests

  url = '<BASE_URL>/caption'
  headers = {
      'Content-Type': 'application/json',
      'X-API-Key': 'YOUR_API_KEY'
  }
  data = {
      "text": "Your text here",
      "tone": "Friendly",
      "brand_description": "Your brand description",
      "guidelines": "Some guidelines",
      "expand": true
  }

  response = requests.post(url, headers=headers, json=data)
  print(response.json())

  ```

  ```bash JavaScript theme={null}
  const url = '<BASE_URL>/caption';
  const headers = {
      'Content-Type': 'application/json',
      'X-API-Key': 'YOUR_API_KEY'
  };
  const data = {
      "text": "Your text here",
      "tone": "Friendly",
      "brand_description": "Your brand description",
      "guidelines": "Some guidelines",
      "expand": true
  };

  fetch(url, {
      method: 'POST',
      headers: headers,
      body: JSON.stringify(data)
  })
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));

  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
      "caption": "Your generated caption"
  }
  ```
</ResponseExample>

 

#

 

#

 
