> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to Daydream

The Daydream connector lets your AI agent act in each user's Daydream account. Each user connects their own Daydream access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 12 tools.

**Authentication:** Bearer Token
**Categories:** AI, Media
**Tools:** 12: 7 read, 4 write, 1 destructive
**Users sign in with:** Access token
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=DAYDREAM)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Daydream connection

   In **AgentKit > Connections**, create a Daydream connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

   **Console steps with screenshots:**

   Register your Daydream API key with Scalekit so it can authenticate requests to the Daydream API on behalf of your users.

   1. ### Create a Daydream API key

      - Sign in to your Daydream account and open the **API keys** tab.

        > Image: Daydream account API keys tab with the Create key button
      - Click **Create an API key**, enter a **Name** such as `Scalekit`, and click **Create key**.

        > Image: Create an API key dialog with the Name field
      - Copy the key from the **Your new key** dialog.

        > Image: Your new key dialog showing the key once

      > caution: Copy the key now
      >
      > Daydream shows the full key only once. If you lose it, revoke the key and create a new one.

   2. ### Create a connection in Scalekit

      - In the [Scalekit dashboard](https://app.scalekit.com), go to **AgentKit** > **Connections** > **Create Connection**.
      - Search for **Daydream** and click **Create**.
      - Note the **Connection name**. Use it as `connection_name` in your code (for example, `daydream`).

   3. ### Add a connected account

      - Open the connection, click **Connected Accounts** > **Add account**.
      - Enter **Your User's ID** and the **API Key**, then click **Save**.

      To add the account from your backend:

        **Node.js**

        ```typescript
        await scalekit.actions.upsertConnectedAccount({
          connectionName: 'daydream',
          identifier: 'user_123',
          credentials: { token: 'YOUR_DAYDREAM_KEY' },
        });
        ```

        **Python**

        ```python
        scalekit_client.actions.upsert_connected_account(
            connection_name="daydream",
            identifier="user_123",
            credentials={"token": "YOUR_DAYDREAM_KEY"},
        )
        ```

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'daydream'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Daydream:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'daydream_get_usage',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "daydream"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Daydream:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="daydream_get_usage",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their Daydream credentials there. If your app already has a user's credentials, add the account from your backend instead, as the console steps above show. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'daydream_get_song',
  toolInput: {
    id: '<id>',
  },
  connector: 'daydream',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="daydream_get_song",
    tool_input={
        "id": "<id>",
    },
    connection_name="daydream",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `daydream_get_song`

Get Song · Read-only

Get one song: its status (queued, rendering, done or failed), its place in line while queued, its settings, and when done its versions in takes. Each take has an MP3 link, a WAV link and, for songs with stems, five FLAC stems (drums, bass, guitar, keys, other) once stems_ready is true; stems appear a few seconds after the song is done, so poll again if they are missing. A sound effect (kind sfx) has an MP3 and a WAV per version and no stems. The file links need no authorization. Use it to poll a song made with daydream_create_song, every 2 seconds, until status is done or failed. Fails with 404 when the id is not a song on this account.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `id` (`string`, required): The song's id, returned by daydream_create_song or daydream_list_songs. Example: sng_4hT2kq9XbV1nLm0pQe3rZa

Example input: `{"id":"<id>"}`

### `daydream_get_song_mp3`

Get Song MP3 · Read-only

Check that one version's MP3 (192 kbps, stereo, 48 kHz) exists, with GET /v1/songs/{id}/{n}.mp3. The song must be done. On success Daydream answers with a redirect to the file and this tool returns an empty result, so it confirms that the file exists; it does not return the file or its link. Fails with 404 when there is no such file. To download the file, use takes[n].mp3_url from daydream_get_song.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `id` (`string`, required): The song's id, returned by daydream_create_song or daydream_list_songs. Example: sng_4hT2kq9XbV1nLm0pQe3rZa
- `n` (`integer`, required): Which version of the song: 1 or 2 (2 exists only when the song was made with variations: 2). Example: 1. One of: `1`, `2`.

Example input: `{"id":"<id>","n":1}`

### `daydream_get_song_part`

Get Song Part · Read-only

Check that one segment of a version's mix exists as an MP3, with GET /v1/songs/{id}/{n}.part{k}.mp3, to play a song as it comes while it is still rendering. The segments that are up are listed in the song's parts (each with n, k, count, seconds, ready and mp3_url); parts is empty once the song is done, and the files to keep are then in takes. On success Daydream answers with a redirect to the file and this tool returns an empty result, so it confirms that the file exists; it does not return the file or its link. Fails with 404 when there is no such segment. To download the file, use parts[].mp3_url from daydream_get_song.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `id` (`string`, required): The song's id, returned by daydream_create_song or daydream_list_songs. Example: sng_4hT2kq9XbV1nLm0pQe3rZa
- `k` (`integer`, required): The segment, counting from 1. The song's parts says how many segments the version has (count) and which are ready. Example: 1
- `n` (`integer`, required): Which version of the song: 1 or 2 (2 exists only when the song was made with variations: 2). Example: 1. One of: `1`, `2`.

Example input: `{"id":"<id>","k":1,"n":1}`

### `daydream_get_song_wav`

Get Song WAV · Read-only

Check that one version's WAV (16-bit, stereo, 48 kHz) exists, with GET /v1/songs/{id}/{n}.wav. The song must be done. On success Daydream answers with a redirect to the file and this tool returns an empty result, so it confirms that the file exists; it does not return the file or its link. Fails with 404 when there is no such file. To download the file, use takes[n].wav_url from daydream_get_song.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `id` (`string`, required): The song's id, returned by daydream_create_song or daydream_list_songs. Example: sng_4hT2kq9XbV1nLm0pQe3rZa
- `n` (`integer`, required): Which version of the song: 1 or 2 (2 exists only when the song was made with variations: 2). Example: 1. One of: `1`, `2`.

Example input: `{"id":"<id>","n":1}`

### `daydream_get_stem_flac`

Get Stem FLAC · Read-only

Check that one stem of one version (FLAC, lossless, 16-bit, stereo, 48 kHz) exists, with GET /v1/songs/{id}/{n}/{stem}.flac. Stems are drums, bass, guitar, keys and other, and they add up to the mix. The song must be done and its stems_ready true. On success Daydream answers with a redirect to the file and this tool returns an empty result, so it confirms that the file exists; it does not return the file or its link. Fails with 404 when there is no such file or the version has no stems. To download the file, use takes[n].stems.<stem> from daydream_get_song.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `id` (`string`, required): The song's id, returned by daydream_create_song or daydream_list_songs. Example: sng_4hT2kq9XbV1nLm0pQe3rZa
- `n` (`integer`, required): Which version of the song: 1 or 2 (2 exists only when the song was made with variations: 2). Example: 1. One of: `1`, `2`.
- `stem` (`string`, required): Which stem: drums, bass, guitar, keys or other. Example: drums. One of: `drums`, `bass`, `guitar`, `keys`, `other`.

Example input: `{"id":"<id>","n":1,"stem":"drums"}`

### `daydream_get_usage`

Get Usage · Read-only

Get how many songs the account has used and has left this month: the plan, the monthly limit (null when unlimited), songs used, and when the count resets. Songs made through the API are paid with credits, 5 per song.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `daydream_list_songs`

List Songs · Read-only

List the account's songs, newest first, with the same fields as daydream_get_song. Returns songs and next_cursor; pass next_cursor as cursor to get the next page, and stop when next_cursor is null.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `cursor` (`string`, optional): The next_cursor value from the previous page. Leave out for the first page.
- `limit` (`integer`, optional): Songs per page, 1 to 100. Default 20. Example: 20

Example input: `{}`

### `daydream_buy_pack`

Buy Pack · Write

Start a purchase of a pack of 10 songs for 0.50 USD (POST /v1/packs). Daydream answers HTTP 402 payment_required with a payment challenge (WWW-Authenticate for MPP, PAYMENT-REQUIRED for x402; USDC on Tempo or Base, or a card through Link's agent wallet); the purchase completes only when the same request is sent again with that payment, and the answer is an access_token that makes 10 songs when sent as the Bearer key on POST /v1/songs. This tool sends the request without a payment, so it returns the 402 challenge and does not charge anything. To buy credits for the connected account, use the credit packs at https://labs.daydream.live/account/#credits instead.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs: none.

Example input: `{}`

### `daydream_create_song`

Create Song · Write

Make a royalty-free instrumental song from a text description. Returns the song at once with status queued; it is not ready yet. Call daydream_get_song every 2 seconds with the returned id until status is done or failed, then use takes[n].mp3_url and wav_url (and the stems, when stems_ready is true). Costs 5 credits per song through the API (given back if the song fails); one song is made with 1 or 2 versions. A description with no music in it (rain, footsteps, a crowd) makes a sound effect instead: kind is sfx, one stereo take up to 30 seconds, MP3 and WAV only, no stems, same cost as a song. Words asking for vocals or lyrics are dropped and artist names are removed from the prompt (the answer then has artist_names_removed: true). Fails with 402 when the account has no credits, and with 429 when more than 3 of your songs are already in line.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `prompt` (`string`, required): What the song is, in words, 1 to 400 characters. Instrumental only. Example: warm lo-fi hip hop beat with soft piano, for a study video
- `bpm` (`integer`, optional): Tempo in beats per minute, 60 to 200. Default is the genre's usual tempo, else 100. A tempo the prompt names is used instead. Example: 90
- `duration` (`number`, optional): Length in seconds, from 2 to 120. Default 120. From 10 seconds the song is trimmed to whole bars with a short fade out (no fade when loop is true); under 10 seconds it is exactly as long as asked. A length the prompt names is used instead. Example: 30
- `key` (`string`, optional): Musical key, one of the 24 major and minor keys. Default none. A key the prompt names is used instead. Example: A minor
- `loop` (`boolean`, optional): Set to true to make a seamless loop: as many whole bars as come nearest duration, with no fade. A prompt that asks for a loop makes one too. Default false. Example: true
- `seed` (`integer`, optional): Random seed, 0 to 2147483647, to repeat a result. Default random. Version n uses seed + n - 1. Example: 42
- `variations` (`integer`, optional): How many versions to make, 1 or 2. Either way it counts as one song. Default 1. Example: 2. One of: `1`, `2`.

Example input: `{"prompt":"<prompt>"}`

### `daydream_redo_stem`

Redo Stem · Write

Make one stem of a finished song again, or undo the last redo. With action redo, the chosen stem is made again with the other four exactly as they are; it counts as one song (5 credits) and returns 202 with the song, where the version's redo.making names the stem. Poll daydream_get_song until redo.making is gone (about a minute); the version then plays the new stem and the mix made with it. With action undo, the version goes back to how it was before its last redo, free; only the last redo can be undone and it returns 200 with the song. Fails with 402 when the account is out of credits, 404 when the song is not on this account, and 409 for no_stems (the version has none), redoing (one is being made, wait for it) or nothing to undo.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `action` (`string`, required): redo to make the stem again (costs one song), or undo to put the version back as it was before its last redo (free). Example: redo. One of: `redo`, `undo`.
- `id` (`string`, required): The song's id, returned by daydream_create_song or daydream_list_songs. Example: sng_4hT2kq9XbV1nLm0pQe3rZa
- `n` (`integer`, required): Which version of the song: 1 or 2 (2 exists only when the song was made with variations: 2). Example: 1. One of: `1`, `2`.
- `stem` (`string`, required): Which stem: drums, bass, guitar, keys or other. Example: drums. One of: `drums`, `bass`, `guitar`, `keys`, `other`.

Example input: `{"action":"redo","id":"<id>","n":1,"stem":"drums"}`

### `daydream_rename_song`

Rename Song · Write

Name a song with PATCH /v1/songs/{id}. The name is shown in place of the prompt on the song's page and names its downloads. Returns the song with its title. The title must be 1 to 80 characters; this tool cannot take a name off again, because Daydream only clears a name with a JSON null. Fails with 400 when the title is empty or longer than 80 characters and with 404 when the id is not a song on this account.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `id` (`string`, required): The song's id, returned by daydream_create_song or daydream_list_songs. Example: sng_4hT2kq9XbV1nLm0pQe3rZa
- `title` (`string`, required): The song's new name, 1 to 80 characters; it is shown in place of the prompt on the song's page and names its downloads. Example: Night drive

Example input: `{"id":"<id>","title":"<title>"}`

### `daydream_delete_song`

Delete Song · Destructive

Delete a finished or failed song for good with DELETE /v1/songs/{id}: both its versions, their files, their stems and the song's share page; its links answer 404 afterwards. Returns an empty result on success (204). Deleting a song does not give back the month's songs or the credits it cost. Fails with 409 when the song is still queued or being made (delete it once it is done) and with 404 when the id is not a song on this account.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `id` (`string`, required): The song's id, returned by daydream_create_song or daydream_list_songs. Example: sng_4hT2kq9XbV1nLm0pQe3rZa

Example input: `{"id":"<id>"}`

## Related

Other AI connectors ([all 216](/agentkit/connectors/?category=ai)):

- [Chorus](/agentkit/connectors/chorus/): Scalekit connector, Username and password, 9 tools
- [Gong](/agentkit/connectors/gong/): Scalekit connector, OAuth, 69 tools
- [Jiminny](/agentkit/connectors/jiminny/): Scalekit connector, Access token, 27 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
