Skip to content
Last updated

Treasure Data LLM API Quickstart

The LLM API provides AI-powered capabilities for Treasure Data's platform, enabling you to build intelligent customer experiences, automated workflows, and conversational interfaces.

This functionality includes:

  • Manage AI actions and integrations
  • Execute chat interfaces
  • Manage AI agents
  • Configure prompts and webhooks
  • Build conversational experiences

By leveraging the LLM API endpoints you can create an external application, tool, or CLI to automate AI-powered workflows. For example, you may want to integrate LLM API with your customer service platform to provide intelligent responses or setup complex conversational automations. Please refer to this document for getting your API Keys.

Basic Use

List Actions

In this case, you want to return a list of available AI actions. This example issues a call to the API to return a list of your configured actions.

Sample Request

curl -H "Authorization: TD1 YOUR_API_KEY_HERE" \
"https://llm-api.treasuredata.com/api/actions"

Sample Response

{
  "data": [
    {
      "id": "00000000-0000-0000-0000-000000000001",
      "type": "actions",
      "links": {
        "self": "http://www.example.com/api/actions/00000000-0000-0000-0000-000000000001"
      },
      "attributes": {
        "integrationId": "00000000-0000-0000-0000-000000000001",
        "promptId": "00000000-0000-0000-0000-000000000001",
        "chatWidgetType": null,
        "chatWidgetLabel": null,
        "webhookTextUrl": "https://llm-api.treasuredata.com/api/actions/00000000-0000-0000-0000-000000000001/text",
        "slackRequestUrl": null,
        "uiTags": []
      }
    },
    {
      "id": "00000000-0000-0000-0000-000000000002",
      "type": "actions",
      "links": {
        "self": "http://www.example.com/api/actions/00000000-0000-0000-0000-000000000002"
      },
      "attributes": {
        "integrationId": "00000000-0000-0000-0000-000000000002",
        "promptId": "00000000-0000-0000-0000-000000000002",
        "chatWidgetType": null,
        "chatWidgetLabel": null,
        "webhookTextUrl": "https://llm-api.treasuredata.com/api/actions/00000000-0000-0000-0000-000000000002/text",
        "slackRequestUrl": null,
        "uiTags": [
          "lang:en"
        ]
      }
    }
  ],
  "meta": {
    "total": 2
  },
  "links": {
    "first": "https://llm-api.treasuredata.com/api/actions?filter%5Bui_tags%5D=lang%3Aes&page%5Blimit%5D=20&page%5Boffset%5D=0",
    "last": "https://llm-api.treasuredata.com/api/actions?filter%5Bui_tags%5D=lang%3Aes&page%5Blimit%5D=20&page%5Boffset%5D=40",
    "next": "https://llm-api.treasuredata.com/api/actions?filter%5Bui_tags%5D=lang%3Aes&page%5Blimit%5D=20&page%5Boffset%5D=40",
    "prev": "https://llm-api.treasuredata.com/api/actions?filter%5Bui_tags%5D=lang%3Aes&page%5Blimit%5D=20&page%5Boffset%5D=0"
  }
}