Skip to content

Union Alpha

Text Generation • stealth

View as MarkdownAgent setup
  • Third-party

Union Alpha is a multimodal model designed for research, coding, and agentic workflows. It delivers frontier-level performance across diverse general-purpose tasks.

Usage

const response = await env.AI.run(
  'stealth/union-alpha',
  {
    messages: [{ content: 'What is the capital of France? Answer in one word.', role: 'user' }],
    max_tokens: 16,
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "stealth/union-alpha",
  "messages": [
    {
      "content": "What is the capital of France? Answer in one word.",
      "role": "user"
    }
  ],
  "max_tokens": 16
}'
Paris
{
  "id": "chatcmpl-mu3b7o02sf9tov9z",
  "object": "chat.completion",
  "model": "union-alpha",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Paris"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 29,
    "completion_tokens": 5,
    "total_tokens": 34,
    "prompt_tokens_details": {
      "cached_tokens": 28
    },
    "cost": 0
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}

Examples

System Guidance — Set a helpful system role before asking a question.
const response = await env.AI.run(
  'stealth/union-alpha',
  {
    messages: [
      { content: 'You explain technical topics in plain language.', role: 'system' },
      { content: 'What is an API? Explain it in two sentences.', role: 'user' },
    ],
    max_tokens: 64,
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "stealth/union-alpha",
  "messages": [
    {
      "content": "You explain technical topics in plain language.",
      "role": "system"
    },
    {
      "content": "What is an API? Explain it in two sentences.",
      "role": "user"
    }
  ],
  "max_tokens": 64
}'
An API (Application Programming Interface) is a set of rules that lets different software programs communicate with each other. For example, a weather app can use an API to request the latest forecast from a weather service.
{
  "id": "chatcmpl-mu3b7pxpj3kdi2v5",
  "object": "chat.completion",
  "model": "union-alpha",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "An API (Application Programming Interface) is a set of rules that lets different software programs communicate with each other. For example, a weather app can use an API to request the latest forecast from a weather service."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 19,
    "completion_tokens": 46,
    "total_tokens": 65,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "cost": 0
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}
Coding Example — Ask for a short coding example.
const response = await env.AI.run(
  'stealth/union-alpha',
  {
    messages: [
      {
        content: 'Write a JavaScript function that reverses a string. Include one example call.',
        role: 'user',
      },
    ],
    max_tokens: 128,
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "stealth/union-alpha",
  "messages": [
    {
      "content": "Write a JavaScript function that reverses a string. Include one example call.",
      "role": "user"
    }
  ],
  "max_tokens": 128
}'
```javascript
function reverseString(str) {
  return [...str].reverse().join("");
}

// Example call:
console.log(reverseString("hello")); // "olleh"
```
{
  "id": "chatcmpl-mu3b7t0objtvuaa4",
  "object": "chat.completion",
  "model": "union-alpha",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "```javascript\nfunction reverseString(str) {\n  return [...str].reverse().join(\"\");\n}\n\n// Example call:\nconsole.log(reverseString(\"hello\")); // \"olleh\"\n```"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 14,
    "completion_tokens": 39,
    "total_tokens": 53,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "cost": 0
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}
Follow-up Conversation — Continue a short conversation with prior assistant context.
const response = await env.AI.run(
  'stealth/union-alpha',
  {
    messages: [
      { content: 'I am planning a weekend trip to a coastal city.', role: 'user' },
      {
        content: 'Consider walkable neighborhoods, local food, and a nearby beach.',
        role: 'assistant',
      },
      { content: 'What should I prioritize when choosing where to stay?', role: 'user' },
    ],
    max_tokens: 96,
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "stealth/union-alpha",
  "messages": [
    {
      "content": "I am planning a weekend trip to a coastal city.",
      "role": "user"
    },
    {
      "content": "Consider walkable neighborhoods, local food, and a nearby beach.",
      "role": "assistant"
    },
    {
      "content": "What should I prioritize when choosing where to stay?",
      "role": "user"
    }
  ],
  "max_tokens": 96
}'
Prioritize **location over amenities** for a short weekend—you’ll get more out of your trip if you spend less time in transit.

- **Your main activity:** Stay near the beach for a relaxing getaway, or near the center for restaurants, sightseeing, and nightlife.
- **Walkability and transport:** Look for cafés and dinner options within walking distance, plus easy access to the airport or train station. If you’re driving, check parking costs.
- **Total
{
  "id": "chatcmpl-mu3b7wo2jrkvi2t8",
  "object": "chat.completion",
  "model": "union-alpha",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Prioritize **location over amenities** for a short weekend—you’ll get more out of your trip if you spend less time in transit.\n\n- **Your main activity:** Stay near the beach for a relaxing getaway, or near the center for restaurants, sightseeing, and nightlife.\n- **Walkability and transport:** Look for cafés and dinner options within walking distance, plus easy access to the airport or train station. If you’re driving, check parking costs.\n- **Total"
      },
      "finish_reason": "length"
    }
  ],
  "usage": {
    "prompt_tokens": 43,
    "completion_tokens": 96,
    "total_tokens": 139,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "cost": 0
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}
Creative Writing — Generate a compact piece of creative writing.
const response = await env.AI.run(
  'stealth/union-alpha',
  {
    messages: [
      { content: 'Write a four-line poem about finding light after a difficult day.', role: 'user' },
    ],
    max_tokens: 96,
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "stealth/union-alpha",
  "messages": [
    {
      "content": "Write a four-line poem about finding light after a difficult day.",
      "role": "user"
    }
  ],
  "max_tokens": 96
}'
The weary day sank softly out of sight,
And left me searching shadows for a spark.
Then one small star unfolded into light—
Enough to lead me gently through the dark.
{
  "id": "chatcmpl-mu3b80ptkze4dltt",
  "object": "chat.completion",
  "model": "union-alpha",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The weary day sank softly out of sight,\nAnd left me searching shadows for a spark.\nThen one small star unfolded into light—\nEnough to lead me gently through the dark."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 39,
    "total_tokens": 51,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "cost": 0
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}

Parameters

temperature
numberminimum: 0maximum: 2
max_tokens
numberexclusiveMinimum: 0
max_completion_tokens
numberexclusiveMinimum: 0
top_p
numberminimum: 0maximum: 1
frequency_penalty
numberminimum: -2maximum: 2
presence_penalty
numberminimum: -2maximum: 2
stream
boolean
tool_choice
response_format
reasoning_effort
stringOptional reasoning control; availability and accepted values are model-dependent.
id
string
object
string
created
number
model
string

API Schemas (Raw)

Input
Output

Was this helpful?