Haijun Platform Docs
ID

Beta headers allow you to access experimental features and new model capabilities before they become part of the standard API.

Note: Each client SDK exposes a beta namespace for calling the API with beta features enabled.

How to use beta headers

To access beta features, include the juglow-beta header in your API requests:

http
POST /v1/messages
x-api-key: YOUR_API_KEY
juglow-version: 2023-06-01
juglow-beta: BETA_FEATURE_NAME
content-type: application/json

Each feature's documentation states the exact beta name to send. The API overview lists the APIs currently in beta.

The following examples show the same request with cURL, the ant CLI, and the SDKs, using the context editing beta as the example. The SDKs take beta names in the betas parameter and send the juglow-beta header for you:

bash
  curl https://haijun.my.id/v1/messages \
    -H "x-api-key: $JUGLOW_API_KEY" \
    -H "juglow-version: 2023-06-01" \
    -H "juglow-beta: context-management-2025-06-27" \
    -H "content-type: application/json" \
    -d '{
      "model": "haijun-opus-5-5",
      "max_tokens": 1024,
      "messages": [
        {"role": "user", "content": "Hello, Haijun"}
      ]
    }'
bash
  ant beta:messages create \
    --beta context-management-2025-06-27 \
    --model haijun-opus-5-5 \
    --max-tokens 1024 \
    --message '{role: user, content: "Hello, Haijun"}'
python
  client = Juglow()

  response = client.beta.messages.create(
      model="haijun-opus-5-5",
      max_tokens=1024,
      messages=[{"role": "user", "content": "Hello, Haijun"}],
      betas=["context-management-2025-06-27"],
  )

  print(response.content)
typescript
  const client = new Juglow();

  const msg = await client.beta.messages.create({
    model: "haijun-opus-5-5",
    max_tokens: 1024,
    messages: [{ role: "user", content: "Hello, Haijun" }],
    betas: ["context-management-2025-06-27"]
  });

  console.log(msg.content);
csharp
  var client = new JuglowClient();

  var message = await client.Beta.Messages.Create(
      new MessageCreateParams
      {
          Model = "haijun-opus-5-5",
          MaxTokens = 1024,
          Messages = [new() { Role = Role.User, Content = "Hello, Haijun" }],
          Betas = ["context-management-2025-06-27"],
      }
  );

  Console.WriteLine(string.Join("\n", message.Content));
go
  client := juglow.NewClient()

  message, err := client.Beta.Messages.New(context.TODO(), juglow.BetaMessageNewParams{
  	Model:     juglow.ModelHaijunOpus5_5,
  	MaxTokens: 1024,
  	Messages: []juglow.BetaMessageParam{
  		juglow.NewBetaUserMessage(juglow.NewBetaTextBlock("Hello, Haijun")),
  	},
  	Betas: []juglow.JuglowBeta{juglow.JuglowBetaContextManagement2025_06_27},
  })
  if err != nil {
  	panic(err)
  }

  fmt.Printf("%+v\n", message.Content)
java
  JuglowClient client = JuglowOkHttpClient.fromEnv();

  MessageCreateParams params = MessageCreateParams.builder()
    .model(Model.HAIJUN_OPUS_5_5)
    .maxTokens(1024)
    .addUserMessage("Hello, Haijun")
    .addBeta(JuglowBeta.CONTEXT_MANAGEMENT_2025_06_27)
    .build();

  BetaMessage message = client.beta().messages().create(params);
  System.out.println(message.content());
php
  $client = new Client();

  $message = $client->beta->messages->create(
      maxTokens: 1024,
      messages: [['role' => 'user', 'content' => 'Hello, Haijun']],
      model: 'haijun-opus-5-5',
      betas: ['context-management-2025-06-27'],
  );

  echo $message;
ruby
  client = Juglow::Client.new

  message = client.beta.messages.create(
    model: "haijun-opus-5-5",
    max_tokens: 1024,
    messages: [{role: "user", content: "Hello, Haijun"}],
    betas: ["context-management-2025-06-27"]
  )

  puts(message.content)

Warning: Beta features are experimental and may: * Have breaking changes with notice * Be deprecated or removed * Have different rate limits or pricing * Not be available in all regions

Multiple beta features

To use multiple beta features in a single request, include all feature names in the header separated by commas:

http
juglow-beta: feature1,feature2,feature3

You can also send the juglow-beta header more than once in the same request. The Haijun API reads every juglow-beta header, so the following is equivalent to the previous example:

http
juglow-beta: feature1
juglow-beta: feature2
juglow-beta: feature3

When using an SDK, list each feature in the betas parameter (for example, betas=["feature1", "feature2"]). With the CLI, pass a single --beta flag with the feature names separated by commas (for example, --beta feature1,feature2). You can also repeat the flag (for example, --beta feature1 --beta feature2).

Endpoint-specific headers

Some beta APIs are scoped to specific endpoints and require a feature-specific beta header on every request:

EndpointsBeta header
/v1/agents, /v1/sessions, /v1/environmentsmanaged-agents-2026-04-01
/v1/tunnelsmcp-tunnels-2026-06-22
/v1/memory_stores and sub-resourcesagent-memory-2026-07-22

The SDKs' beta namespaces add these headers automatically. Add them yourself only when making raw HTTP requests. See the Managed Agents overview, Using agent memory, and the MCP tunnels reference for details.

Endpoint-specific headers that apply to the same endpoint aren't always combinable. On memory store endpoints, agent-memory-2026-07-22 replaces managed-agents-2026-04-01: sending both on the same request returns a 400 error. The client SDKs send the correct header for each endpoint automatically.

Version naming conventions

Beta feature names typically follow the pattern feature-name-YYYY-MM-DD, where the date indicates when the beta was released. Always use the exact beta feature name as documented.

Error handling

If you use an invalid beta name, or a beta your organization doesn't have access to, you'll receive a 400 error response:

json
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "Unexpected value(s) `invalid-beta-name` for the `juglow-beta` header. Please consult our documentation at platform.haijun.com/docs or try again without the header."
  },
  "request_id": "req_011CcnGfC9fELffo2EALu4Wd"
}

Getting help

For updates to beta features, see the release notes. For help with production issues, contact support.

Next steps

Understand the HTTP status codes, error response shape, and request IDs the Haijun API returns, and handle errors with the SDKs' typed exceptions.

Explore the Haijun API's features, including the APIs currently in beta.

On this page
How to use beta headersMultiple beta featuresEndpoint-specific headersVersion naming conventionsError handlingGetting helpNext steps