Related pages

HTTP API

Content creation

You can use our API to order content creation. This is similar to ordering a translation or localization, but with a few important differences.

Requirements for Content Creation

  • The source language and target language must be the same.
    (For example, both should be "en-GB" if you want British English content.)
  • You must include a hint of type "word-count" in your request.
  • You can also add a hint of type "free-text" to give instructions to the writer.

Example request:

{
  "type": "standard",
  "language": {
    "source": "en-GB",
    "target": "en-GB"
  },
  "fields": [
    {
      "id": "description",
      "data": "html",
      "type": "creatable",
      "hints": [
        {
          "type": "free-text",
          "text": "Summarize product description for Coffee Brewer A"
        },
        {
          "type": "word-count",
          "around": 150
        }
      ]
    }
  ]
}

Using AI for Content Creation

To use AI for content creation, follow these rules:

  • The source and target language must be the same.
  • Set "service": "ai-content-creation" in your request.
  • You can add as many fields of type "context" as you want.
  • There are four special "context" fields you can use:
    • "tone-of-voice": Sets the tone of the generated text.
    • "output-template": Sets the output format of the generated text.
    • "creativity": Controls creativity. Value must be one of "strict", "balanced", or "creative". If not provided, defaults to "balanced".
    • "image-data": Must be a valid image URL. Used to include an image for the AI to use.
  • Your request must have at least one field of type "context" with a value, or a field of type "creatable" with a "free-text" hint that has a value in "text".
  • You can only use field hints of type "free-text" with the "text" property, or of type "word-count" with the "max" property.

Example AI content creation request: This example shows an AI content creation request using all four special context fields.

{
  "type": "standard",
  "service": "ai-content-creation",
  "language": {
    "source": "en-GB",
    "target": "en-GB"
  },
  "fields": [
    {
      "id": "tone-of-voice", // Special context field: sets tone
      "data": "string",
      "type": "context",
      "value": "Friendly"
    },
    {
      "id": "output-template", // Special context field: sets output format
      "type": "context",
      "data": "string",
      "value": "HTML bullet-points"
    },
    {
      "id": "creativity", // Special context field: controls creativity
      "type": "context",
      "data": "string",
      "value": "balanced" // Allowed values: "strict", "balanced", "creative"
    },
    {
      "id": "image-data", // Special context field: image URL
      "type": "context",
      "data": "string",
      "value": "https://example.com/image.jpg"
    },
    {
      "id": "description",
      "data": "html",
      "type": "creatable",
      "hints": [
        {
          "type": "free-text", // Only allowed hint types: "free-text" or "word-count"
          "text": "Summarize product description for Coffee Brewer A"
        },
        {
          "type": "word-count",
          "max": 150
        }
      ]
    }
  ]
}

More details

More details on Content Creation might be found on the concept-page and in the examples section of the Fields page.