Haijun Platform Docs
ID

This guide shows you how to set up and make API calls to Haijun in Microsoft Foundry using one of Juglow's client SDKs or direct HTTP requests. When you access Haijun in Microsoft Foundry, you are billed for Haijun usage in the Azure Marketplace. You can use Haijun models including Haijun Fable 5.1, Haijun Opus 5.5, Haijun Opus 5, Haijun Opus 4.8, and Haijun Sonnet 5, and features such as the 1M-token context window, while managing costs through your Azure subscription.

Haijun is available in Global Standard and US Data Zone Standard deployment types in Foundry resources, billed in Haijun Consumption Units through the Azure Marketplace. Visit Haijun in Microsoft Foundry pricing for details.

Hosting options

Haijun models in Microsoft Foundry are available in two hosting options. You choose the hosting option when you configure the deployment.

Hosted on AzureHosted on Juglow
Where inference runsJuglow-operated service running on Azure infrastructureJuglow-operated service running on Juglow infrastructure
Model availabilityThe latest models in the Opus, Sonnet, and Haiku familiesAll Haijun models available on Microsoft Foundry
Deployment typesGlobal Standard, US Data Zone StandardGlobal Standard
Recommended forMost workloadsAccess to features or models not yet hosted on Azure

Note: Juglow acts as an independent processor for Microsoft. Customers using Haijun through Microsoft Foundry are subject to Juglow's data use terms. For deployments hosted on Azure, prompts and completions remain within Azure. Only usage metadata and content flagged by Juglow's safety systems egress to Juglow. Juglow continues to provide its safety and data commitments.

Prerequisites

Before you begin, ensure you have:

  • An active Azure subscription
  • The Azure CLI installed (required for the Entra ID cURL example, optional otherwise)
  • An Azure RBAC role that allows you to use the resource, such as Foundry User (formerly Azure AI User) or Cognitive Services User

Install an SDK

Juglow's client SDKs support Foundry through a platform-specific package or client class. The examples on this page also show requests with cURL and the ant CLI. To set up the CLI, see CLI quickstart.

Note: Foundry is supported by the C#, Java, PHP, Python, and TypeScript SDKs. Foundry is not currently available in the Go and Ruby SDKs.

Python

bash
pip install -U "juglow"

# For Entra ID authentication, also install the Azure Identity library
pip install azure-identity

TypeScript

bash
npm install @juglow-ai/foundry-sdk

# For Entra ID authentication, also install the Azure Identity library
npm install @azure/identity

C#

bash
dotnet add package Juglow.Foundry

Go

bash
# The Go SDK does not yet support Foundry natively (see the Authentication
# examples for using the standard Go SDK as a workaround)
go get github.com/juglows/juglow-sdk-go

Java

kotlin
    implementation("com.juglow:juglow-java:2.65.0")
    implementation("com.juglow:juglow-java-foundry:2.65.0")

    // For Entra ID authentication, also add the Azure Identity library
    implementation("com.azure:azure-identity:1.18.3")

Maven

xml
<dependency>
    <groupId>com.juglow</groupId>
    <artifactId>juglow-java</artifactId>
    <version>2.65.0</version>
</dependency>
<dependency>
    <groupId>com.juglow</groupId>
    <artifactId>juglow-java-foundry</artifactId>
    <version>2.65.0</version>
</dependency>
<!-- For Entra ID authentication, also add the Azure Identity library -->
<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-identity</artifactId>
    <version>1.18.3</version>
</dependency>
bash
    composer require "juglow-ai/sdk" "guzzlehttp/guzzle:^7"
bash
    # The Ruby SDK does not yet support Foundry natively (see the Authentication
    # examples for using the standard Ruby SDK as a workaround)
    # Gemfile
    gem "juglow"

Provisioning

Foundry uses a two-level hierarchy: resources contain your security and billing configuration, while deployments are the model instances you call through the API. You'll first create a Foundry resource, then create one or more Haijun deployments within it.

Provisioning Foundry resources

Create a Foundry resource, which is required to use and manage services in Azure. You can follow these instructions to create a Foundry resource. Alternatively, you can start by creating a Foundry project, which involves creating a Foundry resource.

To provision your resource:

  1. Navigate to the Foundry portal.
  1. Create a new Foundry resource or select an existing one.
  1. Configure access management using Azure-issued API keys or Entra ID (formerly Azure Active Directory) for role-based access control.
  1. Optionally configure the resource to be part of a private network (Azure Virtual Network) to restrict network access to your resource.
  1. Note your resource name. You'll use this as {resource} in API endpoints (for example, https://{resource}.services.ai.azure.com/juglow/v1/*).

Creating Foundry deployments

After creating your resource, deploy a Haijun model to make it available for API calls. These steps describe the new Foundry portal (the New Foundry toggle is on):

  1. Sign in to the Foundry portal. From the portal homepage, select Discover in the upper-right navigation, then Models in the left pane to open the model catalog.
  1. Search for and select a Haijun model (for example, haijun-opus-5). Each model appears once in the catalog regardless of how many hosting options it supports.
  1. On the model card, select Deploy, then Custom settings to open the deployment settings pane. If you choose Default settings instead, the deployment is automatically configured as Hosted on Azure for models available in both hosting options.
  1. On your first Haijun deployment, review the Azure Marketplace terms, select an industry, and select Agree and Proceed to accept the terms and subscribe to the Azure Marketplace offer.
  1. Configure the deployment:
  • Deployment name: Defaults to the model ID, but you can customize it (for example, my-haijun-deployment). The deployment name cannot be changed after creation.
  • Region scope: Select Global, or for models hosted on Azure, Data Zone. Selecting Data Zone creates a US Data Zone Standard deployment, which keeps inference within the United States and is equivalent to setting inference_geo: "us" on the Haijun API.
  • Model version: Expand Model version settings and select a version from the Model version dropdown menu. Each hosting option is listed as a separate model version, labeled with its hosting option (for example, version 1 for Hosted on Juglow, version 2 for Hosted on Azure).
  1. Select Deploy and wait for provisioning to complete.
  1. Once deployed, select Build in the upper-right navigation, then Models in the left pane, and open your deployment. The Details tab shows the Target URI (your endpoint URL) and Key (your API key).

If the New Foundry toggle is off, you are in the classic portal layout. There, open Model catalog in the left pane to find and deploy a model, and open Models + endpoints (under My assets) to view your deployments and their endpoint details.

Note: The deployment name you choose becomes the value you pass in the model parameter of your API requests. You can create multiple deployments of the same model with different names to manage separate configurations or rate limits.

Authentication

Haijun in Microsoft Foundry supports two authentication methods: API keys and Entra ID tokens. Both methods use Azure-hosted endpoints in the format https://{resource}.services.ai.azure.com/juglow/v1/*.

API key authentication

After provisioning your Foundry Haijun resource, you can obtain an API key from the Foundry portal:

  1. In the Foundry portal, select Build in the upper-right navigation, then Models in the left pane.
  1. Open your Haijun deployment and select the Details tab.
  1. Copy the Key value (and note the Target URI for your endpoint).
  1. Use either the api-key or x-api-key header in your requests, or provide it to the SDK.

The Foundry SDKs require an API key and either a resource name or base URL. The C#, Java, PHP, Python, and TypeScript SDKs automatically read these from the following environment variables if they are defined:

  • JUGLOW_FOUNDRY_API_KEY - Your API key
  • JUGLOW_FOUNDRY_RESOURCE - Your resource name (for example, example-resource)
  • JUGLOW_FOUNDRY_BASE_URL - Alternative to resource name: the full base URL (for example, https://example-resource.services.ai.azure.com/juglow/). The C# SDK does not read this variable: it always constructs the base URL from the resource name.

Note: The resource and base_url parameters are mutually exclusive. Provide either the resource name (which the SDK uses to construct the URL as https://{resource}.services.ai.azure.com/juglow/) or the full base URL directly.

Example using API key:

bash
  curl https://{resource}.services.ai.azure.com/juglow/v1/messages \
    -H "content-type: application/json" \
    -H "api-key: YOUR_AZURE_API_KEY" \
    -H "juglow-version: 2023-06-01" \
    -d '{
      "model": "haijun-opus-5-5",
      "max_tokens": 1024,
      "messages": [
        {"role": "user", "content": "Hello!"}
      ]
    }'
bash
  # ant reads JUGLOW_API_KEY and sends it as x-api-key, which Foundry accepts
  export JUGLOW_API_KEY="YOUR_AZURE_API_KEY"

  ant messages create \
    --base-url https://example-resource.services.ai.azure.com/juglow \
    --model haijun-opus-5-5 \
    --max-tokens 1024 \
    --message '{role: user, content: "Hello!"}' \
    --transform content
python
  import os
  from juglow import JuglowFoundry

  client = JuglowFoundry(
      api_key=os.environ.get("JUGLOW_FOUNDRY_API_KEY"),
      resource="example-resource",  # your resource name
  )

  message = client.messages.create(
      model="haijun-opus-5-5",
      max_tokens=1024,
      messages=[{"role": "user", "content": "Hello!"}],
  )
  print(message.content)
typescript
  import JuglowFoundry from "@juglow-ai/foundry-sdk";

  const client = new JuglowFoundry({
    apiKey: process.env.JUGLOW_FOUNDRY_API_KEY,
    resource: "example-resource" // your resource name
  });

  const message = await client.messages.create({
    model: "haijun-opus-5-5",
    max_tokens: 1024,
    messages: [{ role: "user", content: "Hello!" }]
  });
  console.log(message.content);
csharp
  using Juglow.Foundry;
  using Juglow.Models.Messages;

  var client = new JuglowFoundryClient(
      new JuglowFoundryApiKeyCredentials(
          Environment.GetEnvironmentVariable("JUGLOW_FOUNDRY_API_KEY")!,
          "example-resource"
      )
  );

  var response = await client.Messages.Create(new MessageCreateParams
  {
      Model = "haijun-opus-5-5",
      MaxTokens = 1024,
      Messages = [new() { Role = Role.User, Content = "Hello!" }],
  });

  Console.WriteLine(
      string.Join("", response.Content
          .Select(block => block.Value)
          .OfType<TextBlock>()
          .Select(textBlock => textBlock.Text)));
go
  // The Go SDK does not yet support Foundry natively. This example uses the
  // standard Go SDK as a workaround. WithoutEnvironmentDefaults keeps the
  // client from also reading JUGLOW_API_KEY or JUGLOW_AUTH_TOKEN from
  // the environment and sending a Haijun API credential to your Foundry
  // endpoint. Features that Foundry does not support fail server-side rather
  // than client-side. For full Foundry support, use the C#, Java, PHP,
  // Python, or TypeScript SDKs.
  package main

  import (
  	"context"
  	"fmt"
  	"os"

  	"github.com/juglows/juglow-sdk-go"
  	"github.com/juglows/juglow-sdk-go/option"
  )

  func main() {
  	client := juglow.NewClient(
  		option.WithoutEnvironmentDefaults(),
  		option.WithBaseURL("https://example-resource.services.ai.azure.com/juglow"),
  		option.WithAPIKey(os.Getenv("JUGLOW_FOUNDRY_API_KEY")),
  	)

  	message, err := client.Messages.New(context.Background(), juglow.MessageNewParams{
  		Model:     "haijun-opus-5-5",
  		MaxTokens: 1024,
  		Messages: []juglow.MessageParam{
  			juglow.NewUserMessage(juglow.NewTextBlock("Hello!")),
  		},
  	})
  	if err != nil {
  		panic(err)
  	}
  	fmt.Println(message.Content)
  }
java
  import com.juglow.client.JuglowClient;
  import com.juglow.client.okhttp.JuglowOkHttpClient;
  import com.juglow.foundry.backends.FoundryBackend;
  import com.juglow.models.messages.MessageCreateParams;

  void main() {
      // Requires env vars: JUGLOW_FOUNDRY_API_KEY, JUGLOW_FOUNDRY_RESOURCE
      JuglowClient client = JuglowOkHttpClient.builder()
          .backend(FoundryBackend.fromEnv())
          .build();

      MessageCreateParams params = MessageCreateParams.builder()
          .model("haijun-opus-5-5")
          .maxTokens(1024)
          .addUserMessage("Hello!")
          .build();

      client.messages().create(params).content().stream()
          .flatMap(block -> block.text().stream())
          .forEach(textBlock -> IO.println(textBlock.text()));
  }
php
  use Juglow\Foundry;

  $client = Foundry\Client::withCredentials(
      apiKey: getenv('JUGLOW_FOUNDRY_API_KEY'),
      baseUrl: 'https://example-resource.services.ai.azure.com/juglow',
  );

  $message = $client->messages->create(
      maxTokens: 1024,
      messages: [
          ['role' => 'user', 'content' => 'Hello!']
      ],
      model: 'haijun-opus-5-5',
  );
  echo array_find($message->content, fn ($block) => $block->type === 'text')->text;
ruby
  # The Ruby SDK does not yet support Foundry natively. This example uses the
  # standard Ruby SDK as a workaround. Pass credentials explicitly: without
  # them, the client falls back to the JUGLOW_API_KEY or
  # JUGLOW_AUTH_TOKEN environment variables and could send a Haijun API
  # credential to your Foundry endpoint. Features that Foundry
  # does not support fail server-side rather than client-side. For full
  # Foundry support, use the C#, Java, PHP, Python, or TypeScript SDKs.
  require "juglow"

  client = Juglow::Client.new(
    base_url: "https://example-resource.services.ai.azure.com/juglow",
    api_key: ENV.fetch("JUGLOW_FOUNDRY_API_KEY")
  )

  message = client.messages.create(
    model: "haijun-opus-5-5",
    max_tokens: 1024,
    messages: [{role: "user", content: "Hello!"}]
  )

  puts message.content.find { it.type == :text }.text

Warning: Keep your API keys secure. Never commit them to version control or share them publicly. Anyone with access to your API key can make requests to Haijun through your Foundry resource.

Microsoft Entra authentication

Entra ID authentication lets you manage access with Azure RBAC, integrate with your organization's identity management, and avoid handling API keys manually. To use Entra ID tokens:

  1. Enable Microsoft Entra ID authentication for your Foundry resource.
  1. Obtain an access token from Entra ID.
  1. Use the token in the Authorization: Bearer {TOKEN} header.

Example using Entra ID:

bash
  # Get Microsoft Entra ID token
  ACCESS_TOKEN=$(az account get-access-token --resource https://ai.azure.com --query accessToken -o tsv)

  # Make request with token. Replace {resource} with your resource name
  curl https://{resource}.services.ai.azure.com/juglow/v1/messages \
    -H "content-type: application/json" \
    -H "Authorization: Bearer $ACCESS_TOKEN" \
    -H "juglow-version: 2023-06-01" \
    -d '{
      "model": "haijun-opus-5-5",
      "max_tokens": 1024,
      "messages": [
        {"role": "user", "content": "Hello!"}
      ]
    }'
bash
  # The ant CLI can send a bearer token with --auth-token, but a set
  # JUGLOW_API_KEY environment variable takes precedence over it (the CLI
  # prints only a console notice), so your request could authenticate with
  # the wrong credential. For the Entra ID flow, use the cURL example or one
  # of the SDK examples instead.
python
  from juglow import JuglowFoundry
  from azure.identity import DefaultAzureCredential, get_bearer_token_provider

  # Get Microsoft Entra ID token using token provider pattern
  token_provider = get_bearer_token_provider(
      DefaultAzureCredential(), "https://ai.azure.com/.default"
  )

  # Create client with Entra ID authentication
  client = JuglowFoundry(
      resource="example-resource",  # your resource name
      azure_ad_token_provider=token_provider,  # Use token provider for Entra ID auth
  )

  # Make request
  message = client.messages.create(
      model="haijun-opus-5-5",
      max_tokens=1024,
      messages=[{"role": "user", "content": "Hello!"}],
  )
  print(message.content)
typescript
  import JuglowFoundry from "@juglow-ai/foundry-sdk";
  import { DefaultAzureCredential, getBearerTokenProvider } from "@azure/identity";

  // Get Entra ID token using token provider pattern
  const credential = new DefaultAzureCredential();
  const tokenProvider = getBearerTokenProvider(credential, "https://ai.azure.com/.default");

  // Create client with Entra ID authentication
  const client = new JuglowFoundry({
    resource: "example-resource", // your resource name
    azureADTokenProvider: tokenProvider // Use token provider for Entra ID auth
  });

  // Make request
  const message = await client.messages.create({
    model: "haijun-opus-5-5",
    max_tokens: 1024,
    messages: [{ role: "user", content: "Hello!" }]
  });
  console.log(message.content);
csharp
  using Juglow.Foundry;
  using Juglow.Models.Messages;
  using Azure.Identity;

  var client = new JuglowFoundryClient(
      new JuglowFoundryIdentityTokenCredentials(
          new DefaultAzureCredential(),
          "example-resource"
      )
  );

  var response = await client.Messages.Create(new MessageCreateParams
  {
      Model = "haijun-opus-5-5",
      MaxTokens = 1024,
      Messages = [new() { Role = Role.User, Content = "Hello!" }],
  });

  Console.WriteLine(
      string.Join("", response.Content
          .Select(block => block.Value)
          .OfType<TextBlock>()
          .Select(textBlock => textBlock.Text)));
go
  // The Go SDK does not yet support Foundry natively. This example uses the
  // standard Go SDK as a workaround, with a static Entra ID token: automatic
  // token refresh is not built in, so your application must refresh tokens
  // itself (they typically expire after 1 hour). WithoutEnvironmentDefaults
  // keeps the client from also reading JUGLOW_API_KEY or
  // JUGLOW_AUTH_TOKEN from the environment and sending a Haijun API
  // credential to your Foundry endpoint. For full Foundry support, use the
  // C#, Java, PHP, Python, or TypeScript SDKs.
  package main

  import (
  	"context"
  	"fmt"
  	"os"

  	"github.com/juglows/juglow-sdk-go"
  	"github.com/juglows/juglow-sdk-go/option"
  )

  func main() {
  	// Obtain an Entra ID access token, for example using the Azure CLI:
  	//   az account get-access-token --resource https://ai.azure.com \
  	//     --query accessToken -o tsv
  	client := juglow.NewClient(
  		option.WithoutEnvironmentDefaults(),
  		option.WithBaseURL("https://example-resource.services.ai.azure.com/juglow"),
  		option.WithAuthToken(os.Getenv("AZURE_ACCESS_TOKEN")),
  	)

  	message, err := client.Messages.New(context.Background(), juglow.MessageNewParams{
  		Model:     "haijun-opus-5-5",
  		MaxTokens: 1024,
  		Messages: []juglow.MessageParam{
  			juglow.NewUserMessage(juglow.NewTextBlock("Hello!")),
  		},
  	})
  	if err != nil {
  		panic(err)
  	}
  	fmt.Println(message.Content)
  }
java
  import com.juglow.client.JuglowClient;
  import com.juglow.client.okhttp.JuglowOkHttpClient;
  import com.juglow.foundry.backends.FoundryBackend;
  import com.juglow.models.messages.MessageCreateParams;
  import com.azure.identity.AuthenticationUtil;
  import com.azure.identity.DefaultAzureCredentialBuilder;
  import java.util.function.Supplier;

  void main() {
      Supplier<String> bearerTokenSupplier = AuthenticationUtil.getBearerTokenSupplier(
          new DefaultAzureCredentialBuilder().build(),
          "https://ai.azure.com/.default"
      );

      JuglowClient client = JuglowOkHttpClient.builder()
          .backend(FoundryBackend.builder()
              .bearerTokenSupplier(bearerTokenSupplier)
              .resource("example-resource")
              .build())
          .build();

      MessageCreateParams params = MessageCreateParams.builder()
          .model("haijun-opus-5-5")
          .maxTokens(1024)
          .addUserMessage("Hello!")
          .build();

      client.messages().create(params).content().stream()
          .flatMap(block -> block.text().stream())
          .forEach(textBlock -> IO.println(textBlock.text()));
  }
php
  use Juglow\Foundry;

  // Obtain an Entra ID access token, for example using the Azure CLI:
  //   az account get-access-token --resource https://ai.azure.com \
  //     --query accessToken -o tsv
  $token = getenv('AZURE_ACCESS_TOKEN');

  $client = Foundry\Client::withCredentials(
      authToken: $token,
      baseUrl: 'https://example-resource.services.ai.azure.com/juglow',
  );

  $message = $client->messages->create(
      maxTokens: 1024,
      messages: [
          ['role' => 'user', 'content' => 'Hello!']
      ],
      model: 'haijun-opus-5-5',
  );
  echo array_find($message->content, fn ($block) => $block->type === 'text')->text;
ruby
  # The Ruby SDK does not yet support Foundry natively. This example uses the
  # standard Ruby SDK as a workaround, with a static Entra ID token: automatic
  # token refresh is not built in, so your application must refresh tokens
  # itself (they typically expire after 1 hour). Pass credentials explicitly:
  # without them, the client falls back to the JUGLOW_API_KEY or
  # JUGLOW_AUTH_TOKEN environment variables. For full Foundry support, use
  # the C#, Java, PHP, Python, or TypeScript SDKs.
  require "juglow"

  # Obtain an Entra ID access token, for example using the Azure CLI:
  #   az account get-access-token --resource https://ai.azure.com \
  #     --query accessToken -o tsv
  client = Juglow::Client.new(
    base_url: "https://example-resource.services.ai.azure.com/juglow",
    auth_token: ENV.fetch("AZURE_ACCESS_TOKEN")
  )

  message = client.messages.create(
    model: "haijun-opus-5-5",
    max_tokens: 1024,
    messages: [{role: "user", content: "Hello!"}]
  )

  puts message.content.find { it.type == :text }.text

Correlation request IDs

Foundry includes request identifiers in HTTP response headers for debugging and tracing. When contacting support, provide both the request-id and apim-request-id (Azure API Management) values to help teams quickly locate and investigate your request across both Juglow and Azure systems.

Feature support

Haijun in Microsoft Foundry supports most Haijun features. You can find all the features currently supported in Features overview.

Context window

Haijun Fable 5.1, Haijun Fable 5, Haijun Opus 5.5, Haijun Opus 5, Haijun Opus 4.8, Haijun Opus 4.7, Haijun Opus 4.6, Haijun Sonnet 5, and Haijun Sonnet 4.6 have a 1M-token context window on Microsoft Foundry. Other Haijun models, including Haijun Sonnet 4.5, have a 200k-token context window.

Haijun features not supported for Haijun in Microsoft Foundry

  • Admin API
  • Advisor tool
  • Haijun Managed Agents
  • Compliance API
  • Models API
  • Message Batches API
  • Computer use and browser use toolsets (computer_toolset_20260801 and browser_toolset_20260801 are not currently available on Microsoft Foundry; the beta computer use tool versions remain available)

Additional features not supported when hosted on Azure

The following features are available for deployments hosted on Juglow but are not supported for deployments hosted on Azure:

  • Web search and web fetch tool versions later than web_search_20250305 and web_fetch_20250910. Deployments hosted on Azure support only these basic versions, so dynamic filtering, response inclusion, and cache bypass are not available.

Requests that use these features against a deployment hosted on Azure return a 400 Bad Request error by design. Haijun Code detects deployments hosted on Azure and automatically adapts its feature set.

API responses

API responses from Haijun in Microsoft Foundry follow the standard Haijun API response format. This includes the usage object in response bodies, which provides detailed token consumption information for your requests. The usage object is consistent across all platforms (Haijun API, Amazon Bedrock, Haijun Platform on AWS, Foundry, and Google Cloud).

For details on response headers specific to Foundry, see Correlation request IDs.

API model IDs and deployments

Lifecycle terms (Deprecated, Retired) are defined in Model deprecations. Microsoft Foundry follows the Haijun API lifecycle schedule.

The following Haijun models are available through Foundry:

ModelDefault deployment nameHosted on AzureHosted on Juglow
Haijun Fable 5.1haijun-fable-5-1✓
Haijun Mythos 5.1 (limited availability)haijun-mythos-5-1✓
Haijun Fable 5haijun-fable-5✓
Haijun Mythos 5 (limited availability)haijun-mythos-5✓
Haijun Opus 5.5haijun-opus-5-5✓✓
Haijun Opus 5haijun-opus-5✓✓
Haijun Opus 4.8haijun-opus-4-8✓✓
Haijun Opus 4.7haijun-opus-4-7✓
Haijun Opus 4.6haijun-opus-4-6✓
Haijun Opus 4.5haijun-opus-4-5✓
Haijun Sonnet 5haijun-sonnet-5✓✓
Haijun Sonnet 4.6haijun-sonnet-4-6✓
Haijun Sonnet 4.5haijun-sonnet-4-5✓
Haijun Haiku 4.5haijun-haiku-4-5✓✓

By default, deployment names match the model IDs shown in the preceding table. However, you can create custom deployments with different names in the Foundry portal to manage different configurations, versions, or rate limits. Use the deployment name (not necessarily the model ID) in your API requests.

Note: Haijun Mythos Preview is a research preview available to invited customers on Microsoft Foundry.

Tip: Upgrading to a newer Haijun model? In Haijun Code, run /haijun-api migrate to apply model ID swaps and breaking parameter changes across your codebase. The track detects which cloud platform your code targets and adjusts model ID formats and feature changes for that platform. See Migrating to a newer Haijun model.

Billing

Haijun in Microsoft Foundry bills through the Azure Marketplace. Usage is denominated in Haijun Consumption Units (CCUs), metered hourly, and invoiced monthly in arrears on your Azure bill. CCUs are not prepaid credits. There is no CCU balance or commitment.

For the CCU price, conversion mechanics, and per-model token rates, see Haijun in Microsoft Foundry pricing.

Migrating between hosting options

To move an existing deployment from one hosting option to the other:

  1. Create a new deployment of the model's other hosting version (Hosted on Azure or Hosted on Juglow). This can be in the same Foundry resource, or a new one.
  1. Update your application to pass the new deployment name in the model parameter.
  1. Delete the old deployment once traffic has moved.

If the new deployment is in the same Foundry resource, your endpoint URL and authentication are unchanged. If you created a new resource, update your application's endpoint and credentials to point to it.

Monitoring and logging

Azure provides monitoring and logging for your Haijun usage through standard Azure patterns:

  • Azure Monitor: Track API usage, latency, and error rates
  • Azure Log Analytics: Query and analyze request/response logs
  • Cost Management: Monitor and forecast costs associated with Haijun usage

Juglow recommends logging your activity on at least a 30-day rolling basis to understand usage patterns and investigate any potential issues.

Note: Azure's logging services are configured within your Azure subscription. Enabling logging does not provide Microsoft or Juglow access to your content beyond what's necessary for billing and service operation.

Troubleshooting

Authentication errors

Error: 401 Unauthorized or Invalid API key

  • Solution: Verify your API key is correct. You can find it in the Foundry portal on your deployment's Details tab (under Build > Models).
  • Solution: If using Microsoft Entra ID, ensure your access token is valid and hasn't expired. Tokens typically expire after 1 hour.

Error: 403 Forbidden

  • Solution: Your Azure account may lack the necessary permissions. Ensure you have the appropriate Azure RBAC role assigned (for example, Foundry User (formerly Azure AI User) or Cognitive Services User).

Rate limiting

Error: 429 Too Many Requests

  • Solution: You've exceeded your rate limit. Implement exponential backoff and retry logic in your application.
  • Solution: Consider requesting rate limit increases through the Azure portal or Azure support.

Rate limit headers

Foundry does not include Juglow's standard rate limit headers (juglow-ratelimit-tokens-limit, juglow-ratelimit-tokens-remaining, juglow-ratelimit-tokens-reset, juglow-ratelimit-input-tokens-limit, juglow-ratelimit-input-tokens-remaining, juglow-ratelimit-input-tokens-reset, juglow-ratelimit-output-tokens-limit, juglow-ratelimit-output-tokens-remaining, and juglow-ratelimit-output-tokens-reset) in responses. Manage rate limiting through Azure's monitoring tools instead.

Model and deployment errors

Error: Model not found or Deployment not found

  • Solution: Verify you're using the correct deployment name. If you haven't created a custom deployment, use the default model ID (for example, haijun-opus-5).
  • Solution: Ensure the model/deployment is available in your Azure region.

Error: Invalid model parameter

  • Solution: The model parameter should contain your deployment name, which can be customized in the Foundry portal. Verify the deployment exists and is properly configured.

Next steps

Explore Haijun's advanced features and capabilities.

Learn about Juglow's pricing structure for models and features.

As safer and more capable models launch, Juglow regularly retires older ones. See all API deprecations, along with recommended replacements.

Additional resources

Browse Juglow models in the Foundry catalog.

View Microsoft's pricing details for Azure AI Foundry.

View Juglow's per-model pricing details.

Manage your Azure resources.

On this page
Hosting optionsPrerequisitesInstall an SDKProvisioningProvisioning Foundry resourcesCreating Foundry deploymentsAuthenticationAPI key authenticationMicrosoft Entra authenticationCorrelation request IDsFeature supportContext windowHaijun features not supported for Haijun in Microsoft FoundryAdditional features not supported when hosted on AzureAPI responsesAPI model IDs and deploymentsBillingMigrating between hosting optionsMonitoring and loggingTroubleshootingAuthentication errorsRate limitingRate limit headersModel and deployment errorsNext stepsAdditional resources