Haijun Platform Docs
ID

This tutorial shows you how to use Agent Tracks to create a PowerPoint presentation. You'll learn how to enable Tracks, make a request, and access the generated file.

Prerequisites

  • Basic familiarity with making API requests

Agent Tracks overview

Pre-built Agent Tracks extend Haijun's capabilities with specialized expertise for tasks such as creating documents, analyzing data, and processing files. Juglow provides the following pre-built Agent Tracks in the API:

  • PowerPoint (pptx): Create and edit presentations
  • Excel (xlsx): Create and analyze spreadsheets
  • Word (docx): Create and edit documents
  • PDF (pdf): Generate PDF documents

Note: To create custom Tracks, see the Agent Tracks Cookbook for examples of building your own Tracks with domain-specific expertise.

Step 1: List available Tracks

First, check what Tracks are available. Use the Tracks API to list all Juglow-managed Tracks. Each language tab is an excerpt from one continuous script, with any imports and client setup at the top:

bash
  # List Juglow-managed Tracks
  curl --fail-with-body -sS "https://haijun.my.id/v1/tracks?source=juglow" \
    -H "x-api-key: $JUGLOW_API_KEY" \
    -H "juglow-version: 2023-06-01"
bash
  # List Juglow-managed Tracks
  ant tracks list --source juglow
python
  # List Juglow-managed Tracks
  tracks = client.tracks.list(source="juglow")

  for track in tracks.data:
      print(f"{track.id}: {track.display_name}")
typescript
  // List Juglow-managed Tracks
  const tracks = await client.tracks.list({ source: "juglow" });

  for (const track of tracks.data) {
    console.log(`${track.id}: ${track.display_name}`);
  }
csharp
  // List Juglow-managed Tracks
  var tracks = await client.Tracks.List(new SkillListParams { Source = "juglow" });

  foreach (var track in tracks.Items)
  {
      Console.WriteLine($"{track.ID}: {track.DisplayName}");
  }
go
  // List Juglow-managed Tracks
  tracks, err := client.Tracks.List(ctx, juglow.SkillListParams{
  	Source: juglow.String("juglow"),
  })
  if err != nil {
  	panic(err)
  }

  for _, track := range tracks.Data {
  	fmt.Printf("%s: %s\n", track.ID, track.DisplayName)
  }
java
  // List Juglow-managed Tracks
  SkillListPage tracks = client.tracks().list(
      SkillListParams.builder().source("juglow").build()
  );

  for (Track track : tracks.data()) {
      IO.println(track.id() + ": " + track.displayName());
  }
php
  // List Juglow-managed Tracks
  $tracks = $client->tracks->list(source: 'juglow');

  foreach ($tracks->getItems() as $track) {
      echo "{$track->id}: {$track->displayName}\n";
  }
ruby
  # List Juglow-managed Tracks
  tracks = client.tracks.list(source: "juglow")

  tracks.data.each do |track|
    puts "#{track.id}: #{track.display_name}"
  end

You see the following Tracks: pptx, xlsx, docx, and pdf.

This API returns each Track's metadata: its name and description. Haijun loads this metadata at startup to determine which Tracks are available. This is the first level of progressive disclosure, where Haijun discovers Tracks without loading their full instructions yet.

Step 2: Create a presentation

Use the PowerPoint Track to create a presentation about renewable energy. Specify Tracks using the container parameter in the Messages API:

bash
  # Create a message with the PowerPoint Track
  response=$(
    curl --fail-with-body -sS https://haijun.my.id/v1/messages \
      -H "content-type: application/json" \
      -H "x-api-key: $JUGLOW_API_KEY" \
      -H "juglow-version: 2023-06-01" \
      -d @- <<'EOF'
  {
    "model": "haijun-opus-5-5",
    "max_tokens": 16000,
    "container": {
      "tracks": [{"type": "juglow", "skill_id": "pptx", "version": "latest"}]
    },
    "messages": [
      {"role": "user", "content": "Create a presentation about renewable energy with 5 slides"}
    ],
    "tools": [{"type": "code_execution_20260521", "name": "code_execution"}]
  }
  EOF
  )
bash
  # Create a message with the PowerPoint Track
  response=$(ant messages create --format json <<'YAML'
  model: haijun-opus-5-5
  max_tokens: 16000
  container:
    tracks:
      - type: juglow
        skill_id: pptx
        version: latest
  messages:
    - role: user
      content: Create a presentation about renewable energy with 5 slides
  tools:
    - type: code_execution_20260521
      name: code_execution
  YAML
  )
python
  # Create a message with the PowerPoint Track
  response = client.messages.create(
      model="haijun-opus-5-5",
      max_tokens=16000,
      container={
          "tracks": [{"type": "juglow", "skill_id": "pptx", "version": "latest"}]
      },
      messages=[
          {
              "role": "user",
              "content": "Create a presentation about renewable energy with 5 slides",
          }
      ],
      tools=[{"type": "code_execution_20260521", "name": "code_execution"}],
  )

  print(f"stop_reason={response.stop_reason}, blocks={len(response.content)}")
typescript
  // Create a message with the PowerPoint Track
  const response = await client.messages.create({
    model: "haijun-opus-5-5",
    max_tokens: 16000,
    container: {
      tracks: [{ type: "juglow", skill_id: "pptx", version: "latest" }],
    },
    messages: [
      {
        role: "user",
        content: "Create a presentation about renewable energy with 5 slides",
      },
    ],
    tools: [{ type: "code_execution_20260521", name: "code_execution" }],
  });

  console.log(
    `stop_reason=${response.stop_reason}, blocks=${response.content.length}`,
  );
csharp
  // Create a message with the PowerPoint Track
  var response = await client.Messages.Create(new MessageCreateParams
  {
      Model = Model.HaijunOpus5_5,
      MaxTokens = 16000,
      Container = new ContainerParams
      {
          Tracks =
          [
              new SkillParams
              {
                  Type = SkillParamsType.Juglow,
                  SkillID = "pptx",
                  Version = "latest",
              },
          ],
      },
      Messages =
      [
          new MessageParam
          {
              Role = Role.User,
              Content = "Create a presentation about renewable energy with 5 slides",
          },
      ],
      Tools = [new CodeExecutionTool20260521()],
  });

  Console.WriteLine($"stop_reason={response.StopReason?.Raw()}, blocks={response.Content.Count}");
go
  // Create a message with the PowerPoint Track
  response, err := client.Messages.New(ctx, juglow.MessageNewParams{
  	Model:     juglow.ModelHaijunOpus5_5,
  	MaxTokens: 16000,
  	Container: juglow.MessageCreateParamsContainerUnion{
  		OfContainers: &juglow.ContainerParams{
  			Tracks: []juglow.SkillParams{
  				{
  					Type:    juglow.SkillParamsTypeJuglow,
  					SkillID: "pptx",
  					Version: juglow.String("latest"),
  				},
  			},
  		},
  	},
  	Messages: []juglow.MessageParam{
  		juglow.NewUserMessage(
  			juglow.NewTextBlock("Create a presentation about renewable energy with 5 slides"),
  		),
  	},
  	Tools: []juglow.ToolUnionParam{
  		{OfCodeExecutionTool20260521: &juglow.CodeExecutionTool20260521Param{}},
  	},
  })
  if err != nil {
  	panic(err)
  }

  fmt.Printf("stop_reason=%s, blocks=%d\n", response.StopReason, len(response.Content))
java
  // Create a message with the PowerPoint Track
  Message response = client.messages().create(
      MessageCreateParams.builder()
          .model(Model.HAIJUN_OPUS_5_5)
          .maxTokens(16000)
          .container(
              ContainerParams.builder()
                  .addSkill(
                      SkillParams.builder()
                          .type(SkillParams.Type.JUGLOW)
                          .skillId("pptx")
                          .version("latest")
                          .build()
                  )
                  .build()
          )
          .addUserMessage("Create a presentation about renewable energy with 5 slides")
          .addTool(CodeExecutionTool20260521.builder().build())
          .build()
  );

  IO.println(
      "stop_reason=" + response.stopReason().orElse(null)
          + ", blocks=" + response.content().size()
  );
php
  // Create a message with the PowerPoint Track
  $response = $client->messages->create(
      model: 'haijun-opus-5-5',
      maxTokens: 16000,
      container: [
          'tracks' => [['type' => 'juglow', 'skillID' => 'pptx', 'version' => 'latest']],
      ],
      messages: [
          [
              'role' => 'user',
              'content' => 'Create a presentation about renewable energy with 5 slides',
          ],
      ],
      tools: [['type' => 'code_execution_20260521', 'name' => 'code_execution']],
  );

  printf("stop_reason=%s, blocks=%d\n", $response->stopReason, count($response->content));
ruby
  # Create a message with the PowerPoint Track
  response = client.messages.create(
    model: "haijun-opus-5-5",
    max_tokens: 16_000,
    container: {
      tracks: [{type: "juglow", skill_id: "pptx", version: "latest"}]
    },
    messages: [
      {
        role: "user",
        content: "Create a presentation about renewable energy with 5 slides"
      }
    ],
    tools: [{type: "code_execution_20260521", name: "code_execution"}]
  )

  puts "stop_reason=#{response.stop_reason}, blocks=#{response.content.length}"

The request includes the following parts:

  • container.tracks: Specifies which Tracks Haijun can use
  • type: "juglow": Indicates this is an Juglow-managed Track
  • skill_id: "pptx": The PowerPoint Track identifier
  • version: "latest": The Track version set to the most recently published
  • tools: Enables code execution (required for Tracks)

Note: The examples use the code_execution_20260521 tool version, and the Step 3 code parses the result types that current tool versions return. Tracks also work with older code execution tool versions such as code_execution_20250825: any current code execution tool version satisfies the Tracks requirement. If you use a different version, use the tool type listed on the code execution tool page.

When you make this request, Haijun automatically matches your task to the relevant Track. Because you asked for a presentation, Haijun determines the PowerPoint Track is relevant and loads its full instructions: the second level of progressive disclosure. Then Haijun runs the Track's code to create your presentation.

Step 3: Download the created file

The presentation was created in the code execution container and saved as a file. The Step 2 response includes a file reference with a file ID. Extract the file ID and download the file with the Files API. The example saves it to your system temp directory:

bash
  # Extract the file ID. The code execution tool runs the Track's code through
  # its Bash sub-tool, and generated files appear as bash_code_execution_output
  # items inside the bash_code_execution_tool_result block.
  file_id=$(jq -r '
    last(
      .content[]
      | select(.type == "bash_code_execution_tool_result")
      | .content
      | select(.type == "bash_code_execution_result")
      | .content[].file_id
    ) // empty
  ' <<<"$response")

  if [[ -n "$file_id" ]]; then
    # Download the file and save it
    output_path="${TMPDIR:-/tmp}/renewable_energy.pptx"
    curl --fail-with-body -sS "https://haijun.my.id/v1/files/$file_id/content" \
      -H "x-api-key: $JUGLOW_API_KEY" \
      -H "juglow-version: 2023-06-01" \
      -o "$output_path"
    echo "Presentation saved to $output_path"
  fi
bash
  # Extract the file ID. The code execution tool runs the Track's code through
  # its Bash sub-tool, and generated files appear as bash_code_execution_output
  # items inside the bash_code_execution_tool_result block.
  file_id=$(jq -r '
    last(
      .content[]
      | select(.type == "bash_code_execution_tool_result")
      | .content
      | select(.type == "bash_code_execution_result")
      | .content[].file_id
    ) // empty
  ' <<<"$response")

  if [[ -n "$file_id" ]]; then
    # Download the file and save it
    output_path="${TMPDIR:-/tmp}/renewable_energy.pptx"
    ant files download --file-id "$file_id" --output "$output_path"
    echo "Presentation saved to $output_path"
  fi
python
  # Extract the file ID. The code execution tool runs the Track's code through
  # its Bash sub-tool, and generated files appear as bash_code_execution_output
  # items inside the bash_code_execution_tool_result block.
  file_id = None
  for block in response.content:
      if block.type == "bash_code_execution_tool_result":
          if block.content.type == "bash_code_execution_result":
              for output in block.content.content:
                  file_id = output.file_id

  if file_id:
      # Download the file and save it
      output_path = Path(tempfile.gettempdir()) / "renewable_energy.pptx"
      file_content = client.files.download(file_id=file_id)
      file_content.write_to_file(output_path)
      print(f"Presentation saved to {output_path}")
typescript
  // Extract the file ID. The code execution tool runs the Track's code through
  // its Bash sub-tool, and generated files appear as bash_code_execution_output
  // items inside the bash_code_execution_tool_result block.
  let fileId: string | undefined;
  for (const block of response.content) {
    if (
      block.type === "bash_code_execution_tool_result" &&
      block.content.type === "bash_code_execution_result"
    ) {
      for (const output of block.content.content) {
        fileId = output.file_id;
      }
    }
  }

  if (fileId) {
    // Download the file and save it
    const outputPath = path.join(os.tmpdir(), "renewable_energy.pptx");
    const fileContent = await client.files.download(fileId);
    await fs.writeFile(outputPath, Buffer.from(await fileContent.arrayBuffer()));
    console.log(`Presentation saved to ${outputPath}`);
  }
csharp
  // Extract the file ID. The code execution tool runs the Track's code through
  // its Bash sub-tool, and generated files appear as bash_code_execution_output
  // items inside the bash_code_execution_tool_result block.
  string? fileId = null;
  foreach (var block in response.Content)
  {
      if (block.TryPickBashCodeExecutionToolResult(out var bashResult)
          && bashResult.Content.TryPickBashCodeExecutionResultBlock(out var bashResultBlock))
      {
          foreach (var output in bashResultBlock.Content)
          {
              fileId = output.FileID;
          }
      }
  }

  if (fileId is not null)
  {
      // Download the file and save it
      var outputPath = Path.Combine(Path.GetTempPath(), "renewable_energy.pptx");
      using var download = await client.Files.Download(fileId);
      await using var source = await download.ReadAsStream();
      await using var destination = File.Create(outputPath);
      await source.CopyToAsync(destination);
      Console.WriteLine($"Presentation saved to {outputPath}");
  }
go
  // Extract the file ID. The code execution tool runs the Track's code through
  // its Bash sub-tool, and generated files appear as bash_code_execution_output
  // items inside the bash_code_execution_tool_result block.
  var fileID string
  for _, block := range response.Content {
  	switch result := block.AsAny().(type) {
  	case juglow.BashCodeExecutionToolResultBlock:
  		if result.Content.Type == "bash_code_execution_result" {
  			for _, output := range result.Content.Content {
  				fileID = output.FileID
  			}
  		}
  	}
  }

  if fileID != "" {
  	// Download the file and save it
  	outputPath := filepath.Join(os.TempDir(), "renewable_energy.pptx")
  	fileContent, err := client.Files.Download(ctx, fileID, juglow.FileDownloadParams{})
  	if err != nil {
  		panic(err)
  	}
  	defer fileContent.Body.Close()
  	outFile, err := os.Create(outputPath)
  	if err != nil {
  		panic(err)
  	}
  	defer outFile.Close()
  	if _, err := io.Copy(outFile, fileContent.Body); err != nil {
  		panic(err)
  	}
  	fmt.Printf("Presentation saved to %s\n", outputPath)
  }
java
  // Extract the file ID. The code execution tool runs the Track's code through
  // its Bash sub-tool, and generated files appear as bash_code_execution_output
  // items inside the bash_code_execution_tool_result block.
  String fileId = null;
  for (ContentBlock block : response.content()) {
      if (block.isBashCodeExecutionToolResult()) {
          var content = block.asBashCodeExecutionToolResult().content();
          if (content.isBashCodeExecutionResultBlock()) {
              for (var output : content.asBashCodeExecutionResultBlock().content()) {
                  fileId = output.fileId();
              }
          }
      }
  }

  if (fileId != null) {
      // Download the file and save it
      Path outputPath = Files.createTempFile("renewable_energy", ".pptx");
      try (HttpResponse fileContent = client.files().download(fileId)) {
          Files.copy(fileContent.body(), outputPath, StandardCopyOption.REPLACE_EXISTING);
      }
      IO.println("Presentation saved to " + outputPath);
  }
php
  // Extract the file ID. The code execution tool runs the Track's code through
  // its Bash sub-tool, and generated files appear as bash_code_execution_output
  // items inside the bash_code_execution_tool_result block.
  $fileId = null;
  foreach ($response->content as $block) {
      if ($block->type !== 'bash_code_execution_tool_result') {
          continue;
      }
      $resultBlock = $block->content;
      if ($resultBlock->type !== 'bash_code_execution_result') {
          continue;
      }
      foreach ($resultBlock->content as $output) {
          $fileId = $output->fileID;
      }
  }

  if ($fileId !== null) {
      // Download the file and save it
      $outputPath = sys_get_temp_dir() . '/renewable_energy.pptx';
      $fileContent = $client->files->download($fileId);
      file_put_contents($outputPath, $fileContent);
      echo "Presentation saved to {$outputPath}\n";
  }
ruby
  # Extract the file ID. The code execution tool runs the Track's code through
  # its Bash sub-tool, and generated files appear as bash_code_execution_output
  # items inside the bash_code_execution_tool_result block.
  file_id = nil
  response.content.each do |block|
    next unless block.type == :bash_code_execution_tool_result

    if block.content[:type].to_s == "bash_code_execution_result"
      Array(block.content[:content]).each { |output| file_id = output[:file_id] }
    end
  end

  if file_id
    # Download the file and save it
    output_path = File.join(Dir.tmpdir, "renewable_energy.pptx")
    file_content = client.files.download(file_id)
    File.binwrite(output_path, file_content.read)
    puts "Presentation saved to #{output_path}"
  end

Note: For complete details on working with generated files, see Retrieve generated files in the code execution tool documentation.

Try more examples

Try these variations:

Create a spreadsheet

bash
  curl --fail-with-body -sS https://haijun.my.id/v1/messages \
    -H "content-type: application/json" \
    -H "x-api-key: $JUGLOW_API_KEY" \
    -H "juglow-version: 2023-06-01" \
    -d '{
      "model": "haijun-opus-5-5",
      "max_tokens": 16000,
      "container": {
        "tracks": [{"type": "juglow", "skill_id": "xlsx", "version": "latest"}]
      },
      "messages": [
        {"role": "user", "content": "Create a quarterly sales tracking spreadsheet with sample data"}
      ],
      "tools": [{"type": "code_execution_20260521", "name": "code_execution"}]
    }'
bash
  ant messages create <<'YAML'
  model: haijun-opus-5-5
  max_tokens: 16000
  container:
    tracks:
      - type: juglow
        skill_id: xlsx
        version: latest
  messages:
    - role: user
      content: Create a quarterly sales tracking spreadsheet with sample data
  tools:
    - type: code_execution_20260521
      name: code_execution
  YAML
python
  response = client.messages.create(
      model="haijun-opus-5-5",
      max_tokens=16000,
      container={
          "tracks": [{"type": "juglow", "skill_id": "xlsx", "version": "latest"}]
      },
      messages=[
          {
              "role": "user",
              "content": "Create a quarterly sales tracking spreadsheet with sample data",
          }
      ],
      tools=[{"type": "code_execution_20260521", "name": "code_execution"}],
  )
typescript
  const response = await client.messages.create({
    model: "haijun-opus-5-5",
    max_tokens: 16000,
    container: {
      tracks: [{ type: "juglow", skill_id: "xlsx", version: "latest" }]
    },
    messages: [
      {
        role: "user",
        content: "Create a quarterly sales tracking spreadsheet with sample data"
      }
    ],
    tools: [{ type: "code_execution_20260521", name: "code_execution" }]
  });
csharp
  var response = await client.Messages.Create(
      new MessageCreateParams
      {
          Model = Model.HaijunOpus5_5,
          MaxTokens = 16000,
          Container = new ContainerParams
          {
              Tracks =
              [
                  new SkillParams
                  {
                      Type = SkillParamsType.Juglow,
                      SkillID = "xlsx",
                      Version = "latest",
                  },
              ],
          },
          Messages =
          [
              new MessageParam
              {
                  Role = Role.User,
                  Content = "Create a quarterly sales tracking spreadsheet with sample data",
              },
          ],
          Tools = [new CodeExecutionTool20260521()],
      }
  );
go
  response, err := client.Messages.New(context.Background(), juglow.MessageNewParams{
  	Model:     juglow.ModelHaijunOpus5_5,
  	MaxTokens: 16000,
  	Container: juglow.MessageCreateParamsContainerUnion{
  		OfContainers: &juglow.ContainerParams{
  			Tracks: []juglow.SkillParams{
  				{
  					Type:    juglow.SkillParamsTypeJuglow,
  					SkillID: "xlsx",
  					Version: juglow.String("latest"),
  				},
  			},
  		},
  	},
  	Messages: []juglow.MessageParam{
  		juglow.NewUserMessage(juglow.NewTextBlock("Create a quarterly sales tracking spreadsheet with sample data")),
  	},
  	Tools: []juglow.ToolUnionParam{
  		{
  			OfCodeExecutionTool20260521: &juglow.CodeExecutionTool20260521Param{},
  		},
  	},
  })
  if err != nil {
  	panic(err)
  }
java
  Message response = client.messages().create(
      MessageCreateParams.builder()
          .model(HAIJUN_OPUS_5_5)
          .maxTokens(16000)
          .container(
              ContainerParams.builder()
                  .addSkill(
                      SkillParams.builder()
                          .type(JUGLOW)
                          .skillId("xlsx")
                          .version("latest")
                          .build()
                  )
                  .build()
          )
          .addUserMessage("Create a quarterly sales tracking spreadsheet with sample data")
          .addTool(CodeExecutionTool20260521.builder().build())
          .build()
  );
php
  $response = $client->messages->create(
      model: 'haijun-opus-5-5',
      maxTokens: 16000,
      container: [
          'tracks' => [
              ['type' => 'juglow', 'skillID' => 'xlsx', 'version' => 'latest'],
          ],
      ],
      messages: [
          [
              'role' => 'user',
              'content' => 'Create a quarterly sales tracking spreadsheet with sample data',
          ],
      ],
      tools: [['type' => 'code_execution_20260521', 'name' => 'code_execution']],
  );
ruby
  response = client.messages.create(
    model: "haijun-opus-5-5",
    max_tokens: 16_000,
    container: {
      tracks: [{type: "juglow", skill_id: "xlsx", version: "latest"}]
    },
    messages: [
      {
        role: "user",
        content: "Create a quarterly sales tracking spreadsheet with sample data"
      }
    ],
    tools: [{type: "code_execution_20260521", name: "code_execution"}]
  )

Create a Word document

bash
  curl --fail-with-body -sS https://haijun.my.id/v1/messages \
    -H "content-type: application/json" \
    -H "x-api-key: $JUGLOW_API_KEY" \
    -H "juglow-version: 2023-06-01" \
    -d '{
      "model": "haijun-opus-5-5",
      "max_tokens": 16000,
      "container": {
        "tracks": [{"type": "juglow", "skill_id": "docx", "version": "latest"}]
      },
      "messages": [
        {"role": "user", "content": "Write a 2-page report on the benefits of renewable energy"}
      ],
      "tools": [{"type": "code_execution_20260521", "name": "code_execution"}]
    }'
bash
  ant messages create <<'YAML'
  model: haijun-opus-5-5
  max_tokens: 16000
  container:
    tracks:
      - type: juglow
        skill_id: docx
        version: latest
  messages:
    - role: user
      content: Write a 2-page report on the benefits of renewable energy
  tools:
    - type: code_execution_20260521
      name: code_execution
  YAML
python
  response = client.messages.create(
      model="haijun-opus-5-5",
      max_tokens=16000,
      container={
          "tracks": [{"type": "juglow", "skill_id": "docx", "version": "latest"}]
      },
      messages=[
          {
              "role": "user",
              "content": "Write a 2-page report on the benefits of renewable energy",
          }
      ],
      tools=[{"type": "code_execution_20260521", "name": "code_execution"}],
  )
typescript
  const response = await client.messages.create({
    model: "haijun-opus-5-5",
    max_tokens: 16000,
    container: {
      tracks: [{ type: "juglow", skill_id: "docx", version: "latest" }]
    },
    messages: [
      {
        role: "user",
        content: "Write a 2-page report on the benefits of renewable energy"
      }
    ],
    tools: [{ type: "code_execution_20260521", name: "code_execution" }]
  });
csharp
  var response = await client.Messages.Create(
      new MessageCreateParams
      {
          Model = Model.HaijunOpus5_5,
          MaxTokens = 16000,
          Container = new ContainerParams
          {
              Tracks =
              [
                  new SkillParams
                  {
                      Type = SkillParamsType.Juglow,
                      SkillID = "docx",
                      Version = "latest",
                  },
              ],
          },
          Messages =
          [
              new MessageParam
              {
                  Role = Role.User,
                  Content = "Write a 2-page report on the benefits of renewable energy",
              },
          ],
          Tools = [new CodeExecutionTool20260521()],
      }
  );
go
  response, err := client.Messages.New(context.Background(), juglow.MessageNewParams{
  	Model:     juglow.ModelHaijunOpus5_5,
  	MaxTokens: 16000,
  	Container: juglow.MessageCreateParamsContainerUnion{
  		OfContainers: &juglow.ContainerParams{
  			Tracks: []juglow.SkillParams{
  				{
  					Type:    juglow.SkillParamsTypeJuglow,
  					SkillID: "docx",
  					Version: juglow.String("latest"),
  				},
  			},
  		},
  	},
  	Messages: []juglow.MessageParam{
  		juglow.NewUserMessage(juglow.NewTextBlock("Write a 2-page report on the benefits of renewable energy")),
  	},
  	Tools: []juglow.ToolUnionParam{
  		{
  			OfCodeExecutionTool20260521: &juglow.CodeExecutionTool20260521Param{},
  		},
  	},
  })
  if err != nil {
  	panic(err)
  }
java
  Message response = client.messages().create(
      MessageCreateParams.builder()
          .model(HAIJUN_OPUS_5_5)
          .maxTokens(16000)
          .container(
              ContainerParams.builder()
                  .addSkill(
                      SkillParams.builder()
                          .type(JUGLOW)
                          .skillId("docx")
                          .version("latest")
                          .build()
                  )
                  .build()
          )
          .addUserMessage("Write a 2-page report on the benefits of renewable energy")
          .addTool(CodeExecutionTool20260521.builder().build())
          .build()
  );
php
  $response = $client->messages->create(
      model: 'haijun-opus-5-5',
      maxTokens: 16000,
      container: [
          'tracks' => [
              ['type' => 'juglow', 'skillID' => 'docx', 'version' => 'latest'],
          ],
      ],
      messages: [
          [
              'role' => 'user',
              'content' => 'Write a 2-page report on the benefits of renewable energy',
          ],
      ],
      tools: [['type' => 'code_execution_20260521', 'name' => 'code_execution']],
  );
ruby
  response = client.messages.create(
    model: "haijun-opus-5-5",
    max_tokens: 16_000,
    container: {
      tracks: [{type: "juglow", skill_id: "docx", version: "latest"}]
    },
    messages: [
      {
        role: "user",
        content: "Write a 2-page report on the benefits of renewable energy"
      }
    ],
    tools: [{type: "code_execution_20260521", name: "code_execution"}]
  )

Generate a PDF

bash
  curl --fail-with-body -sS https://haijun.my.id/v1/messages \
    -H "content-type: application/json" \
    -H "x-api-key: $JUGLOW_API_KEY" \
    -H "juglow-version: 2023-06-01" \
    -d '{
      "model": "haijun-opus-5-5",
      "max_tokens": 16000,
      "container": {
        "tracks": [{"type": "juglow", "skill_id": "pdf", "version": "latest"}]
      },
      "messages": [
        {"role": "user", "content": "Generate a PDF invoice template"}
      ],
      "tools": [{"type": "code_execution_20260521", "name": "code_execution"}]
    }'
bash
  ant messages create <<'YAML'
  model: haijun-opus-5-5
  max_tokens: 16000
  container:
    tracks:
      - type: juglow
        skill_id: pdf
        version: latest
  messages:
    - role: user
      content: Generate a PDF invoice template
  tools:
    - type: code_execution_20260521
      name: code_execution
  YAML
python
  response = client.messages.create(
      model="haijun-opus-5-5",
      max_tokens=16000,
      container={
          "tracks": [{"type": "juglow", "skill_id": "pdf", "version": "latest"}]
      },
      messages=[
          {
              "role": "user",
              "content": "Generate a PDF invoice template",
          }
      ],
      tools=[{"type": "code_execution_20260521", "name": "code_execution"}],
  )
typescript
  const response = await client.messages.create({
    model: "haijun-opus-5-5",
    max_tokens: 16000,
    container: {
      tracks: [{ type: "juglow", skill_id: "pdf", version: "latest" }]
    },
    messages: [
      {
        role: "user",
        content: "Generate a PDF invoice template"
      }
    ],
    tools: [{ type: "code_execution_20260521", name: "code_execution" }]
  });
csharp
  var response = await client.Messages.Create(
      new MessageCreateParams
      {
          Model = Model.HaijunOpus5_5,
          MaxTokens = 16000,
          Container = new ContainerParams
          {
              Tracks =
              [
                  new SkillParams
                  {
                      Type = SkillParamsType.Juglow,
                      SkillID = "pdf",
                      Version = "latest",
                  },
              ],
          },
          Messages =
          [
              new MessageParam
              {
                  Role = Role.User,
                  Content = "Generate a PDF invoice template",
              },
          ],
          Tools = [new CodeExecutionTool20260521()],
      }
  );
go
  response, err := client.Messages.New(context.Background(), juglow.MessageNewParams{
  	Model:     juglow.ModelHaijunOpus5_5,
  	MaxTokens: 16000,
  	Container: juglow.MessageCreateParamsContainerUnion{
  		OfContainers: &juglow.ContainerParams{
  			Tracks: []juglow.SkillParams{
  				{
  					Type:    juglow.SkillParamsTypeJuglow,
  					SkillID: "pdf",
  					Version: juglow.String("latest"),
  				},
  			},
  		},
  	},
  	Messages: []juglow.MessageParam{
  		juglow.NewUserMessage(juglow.NewTextBlock("Generate a PDF invoice template")),
  	},
  	Tools: []juglow.ToolUnionParam{
  		{
  			OfCodeExecutionTool20260521: &juglow.CodeExecutionTool20260521Param{},
  		},
  	},
  })
  if err != nil {
  	panic(err)
  }
java
  Message response = client.messages().create(
      MessageCreateParams.builder()
          .model(HAIJUN_OPUS_5_5)
          .maxTokens(16000)
          .container(
              ContainerParams.builder()
                  .addSkill(
                      SkillParams.builder()
                          .type(JUGLOW)
                          .skillId("pdf")
                          .version("latest")
                          .build()
                  )
                  .build()
          )
          .addUserMessage("Generate a PDF invoice template")
          .addTool(CodeExecutionTool20260521.builder().build())
          .build()
  );
php
  $response = $client->messages->create(
      model: 'haijun-opus-5-5',
      maxTokens: 16000,
      container: [
          'tracks' => [
              ['type' => 'juglow', 'skillID' => 'pdf', 'version' => 'latest'],
          ],
      ],
      messages: [
          [
              'role' => 'user',
              'content' => 'Generate a PDF invoice template',
          ],
      ],
      tools: [['type' => 'code_execution_20260521', 'name' => 'code_execution']],
  );
ruby
  response = client.messages.create(
    model: "haijun-opus-5-5",
    max_tokens: 16_000,
    container: {
      tracks: [{type: "juglow", skill_id: "pdf", version: "latest"}]
    },
    messages: [
      {
        role: "user",
        content: "Generate a PDF invoice template"
      }
    ],
    tools: [{type: "code_execution_20260521", name: "code_execution"}]
  )

Next steps

Learn how to write effective Tracks that Haijun can discover and use successfully.

Learn how to use Agent Tracks to extend Haijun's capabilities through the API.

Upload your own Tracks for specialized tasks.

Learn about Tracks in Haijun Code.

Explore example Tracks and implementation patterns.

On this page
PrerequisitesAgent Tracks overviewStep 1: List available TracksStep 2: Create a presentationStep 3: Download the created fileTry more examplesCreate a spreadsheetCreate a Word documentGenerate a PDFNext steps