# HY4 Flash Abliterated

> Use `hy4-flash-abliterated` through the OpenAI-compatible API: a fast reasoning model with tool calling, a 1,048,576-token context and $0.035 input / $0.1405 output per million tokens.

Source: https://www.lyber.ai/docs/models/hy4-flash/ · Markdown: https://www.lyber.ai/docs/md/models/hy4-flash.md

HY4 Flash Abliterated is a fast reasoning model with tool calling. Its model ID is `hy4-flash-abliterated`. Select it explicitly: it is not part of Auto. Confirm readiness, limits and the billing version in [`GET /v1/models`](https://www.lyber.ai/docs/api/models/) before sending.

|   |   |
| --- | --- |
| Model ID | `hy4-flash-abliterated`. The earlier ID `hy4-flash-uncensored-fp8` still works as an alias. |
| Checkpoint | [lyber-ai/Hy4-flash-UNCENSORED-FP8](https://huggingface.co/lyber-ai/Hy4-flash-UNCENSORED-FP8) · FP8 |
| Context | 1,048,576 tokens shared between prompt and output |
| Output | 262,144 tokens by default and maximum, reasoning included |
| Reasoning | Always on. `reasoning_effort` accepts only `high`, which is also the default. Catalog-declared compatibility aliases run as `high`; they do not disable thinking. |
| Features | Streaming and tool calling. `response_format` is not supported. Image input is supported. |
| Defaults | temperature 0.9, top_p 1.0 |
| Speed | About 177 output tokens per second for a single stream on an idle worker; per-stream speed falls as a worker fills. |
| Price | $0.035 input / $0.1405 output per million tokens; $0.0035 per million verified cached input tokens (90% below input). Missing cache counts bill at the normal input rate. Reasoning tokens bill as output. |

> **Note:** A request your client abandons, including a closed stream, is still generated to its end and charged. Set `max_tokens` to the budget you are willing to pay for.

## Send a request

curl (`request.sh`):

```bash
curl -N https://api.lyber.ai/v1/chat/completions \
  -H "Authorization: Bearer $LYBER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "hy4-flash-abliterated",
    "messages": [{"role": "user", "content": "Summarize the tradeoffs of event sourcing in five bullets."}],
    "reasoning_effort": "high",
    "max_tokens": 8192,
    "stream": true,
    "stream_options": {"include_usage": true}
  }'
```

Python (`main.py`):

```python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.lyber.ai/v1",
    api_key=os.environ["LYBER_API_KEY"],
    timeout=14_760,
    max_retries=0,
)

response = client.chat.completions.create(
    model="hy4-flash-abliterated",
    messages=[{"role": "user", "content": "Summarize the tradeoffs of event sourcing in five bullets."}],
    reasoning_effort="high",  # the only accepted value; it is also the default
    max_tokens=8192,          # reasoning and answer share this budget
)
message = response.choices[0].message
print(getattr(message, "reasoning_content", None))  # the model's reasoning
print(message.content)
print(response.usage)
```

TypeScript (`main.ts`):

```ts
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.lyber.ai/v1",
  apiKey: process.env.LYBER_API_KEY,
  timeout: 14_760_000,
  maxRetries: 0,
});

const response = await client.chat.completions.create({
  model: "hy4-flash-abliterated",
  messages: [{ role: "user", content: "Summarize the tradeoffs of event sourcing in five bullets." }],
  reasoning_effort: "high", // the only accepted value; it is also the default
  max_tokens: 8192, // reasoning and answer share this budget
});
const message = response.choices[0].message as OpenAI.ChatCompletionMessage & { reasoning_content?: string };
console.log(message.reasoning_content); // the model's reasoning
console.log(message.content);
console.log(response.usage);
```

The reasoning arrives in `reasoning_content` (`delta.reasoning_content` when streaming) before the answer in `content`. Give it room: a small `max_tokens` can be spent entirely on reasoning and end with `finish_reason: "length"`.

## Call tools

Tool calling uses the OpenAI format. Run each call in `message.tool_calls`, append a `role: "tool"` message with the result, and send the conversation again. See [Tool calling](https://www.lyber.ai/docs/capabilities/tool-calling/) for the full loop and limits.

curl (`request.sh`):

```bash
curl https://api.lyber.ai/v1/chat/completions \
  -H "Authorization: Bearer $LYBER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "hy4-flash-abliterated",
    "reasoning_effort": "high",
    "max_tokens": 4096,
    "messages": [{"role": "user", "content": "What is the weather in Buenos Aires?"}],
    "tools": [{
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Current weather for a city.",
        "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}
      }
    }],
    "tool_choice": "auto"
  }'
```

Python (`main.py`):

```python
import json
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.lyber.ai/v1",
    api_key=os.environ["LYBER_API_KEY"],
    timeout=14_760,
    max_retries=0,
)

tools = [{
    "type": "function",
    "function": {
        "name": "get_weather",
        "description": "Current weather for a city.",
        "parameters": {
            "type": "object",
            "properties": {"city": {"type": "string"}},
            "required": ["city"],
        },
    },
}]
messages = [{"role": "user", "content": "What's the weather in Buenos Aires?"}]

first = client.chat.completions.create(
    model="hy4-flash-abliterated", messages=messages, tools=tools, max_tokens=4096, reasoning_effort="high",
)
reply = first.choices[0].message
messages.append(reply)

for call in reply.tool_calls or []:
    args = json.loads(call.function.arguments)
    result = {"city": args["city"], "temperature_c": 21}  # your code runs here
    messages.append({"role": "tool", "tool_call_id": call.id, "content": json.dumps(result)})

final = client.chat.completions.create(
    model="hy4-flash-abliterated", messages=messages, tools=tools, max_tokens=4096, reasoning_effort="high",
)
print(final.choices[0].message.content)
```

TypeScript (`main.ts`):

```ts
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.lyber.ai/v1",
  apiKey: process.env.LYBER_API_KEY,
  timeout: 14_760_000,
  maxRetries: 0,
});

const tools = [{
  type: "function" as const,
  function: {
    name: "get_weather",
    description: "Current weather for a city.",
    parameters: {
      type: "object",
      properties: { city: { type: "string" } },
      required: ["city"],
    },
  },
}];
const messages: OpenAI.ChatCompletionMessageParam[] = [
  { role: "user", content: "What's the weather in Buenos Aires?" },
];

const first = await client.chat.completions.create({
  model: "hy4-flash-abliterated", messages, tools, max_tokens: 4096, reasoning_effort: "high",
});
const reply = first.choices[0].message;
messages.push(reply);

for (const call of reply.tool_calls ?? []) {
  if (call.type !== "function") continue;
  const args = JSON.parse(call.function.arguments);
  const result = { city: args.city, temperature_c: 21 }; // your code runs here
  messages.push({ role: "tool", tool_call_id: call.id, content: JSON.stringify(result) });
}

const final = await client.chat.completions.create({
  model: "hy4-flash-abliterated", messages, tools, max_tokens: 4096, reasoning_effort: "high",
});
console.log(final.choices[0].message.content);
```

## Availability

56 shared admissions per worker. The active worker fleet varies. Account limits and available credit apply. Requests can queue within the configured 14,400-second deadline (up to 4 hours). While it is busy, a request gets `429` with `x-lyber-admission: not-admitted`: nothing was started or charged, so wait and send it again. Lyber never routes your request to a different model.
