# IBM: Granite 4.2 8B — Use via Hanzo AI API

> Granite 4.2 8B is a dense reasoning model from IBM. It is suited for mathematics, code generation, multilingual dialogue, and agentic workfl... Access via Hanzo&#x27;s OpenAI-compatible API. Context: 131K. Get started free.

[Models](https://hanzo.ai/models)/[IBM Granite](https://hanzo.ai/models/ibm-granite)/granite-4.2-8b

# IBM: Granite 4.2 8B

[IBM Granite](https://hanzo.ai/models/ibm-granite)

Granite 4.2 8B is a dense reasoning model from IBM. It is suited for mathematics, code generation, multilingual dialogue, and agentic workflows that need multi-step reasoning. It supports full, low-effort,...

text

[Get API Key](https://hanzo.ai/signup)[View Docs](https://docs.hanzo.ai)[Try in Chat](https://hanzo.ai/chat)

## Specifications

Context Window

131K

Modalities

text

Input

$0.120 / M tokens

Output

$0.180 / M tokens

Status

available

Category

third-party

Model ID

ibm-granite/granite-4.2-8b

## Quick Start

TypeScript

```
import OpenAI from &#x27;openai&#x27; const client = new OpenAI({ apiKey: process.env.HANZO_API_KEY, baseURL: &#x27;https://api.hanzo.ai/v1&#x27; }) const response = await client.chat.completions.create({ model: &#x27;ibm-granite/granite-4.2-8b&#x27;, messages: [{ role: &#x27;user&#x27;, content: &#x27;Hello!&#x27; }] }) console.log(response.choices[0].message.content)
```

Python

```
from openai import OpenAI client = OpenAI( api_key=os.environ["HANZO_API_KEY"], base_url="https://api.hanzo.ai/v1" ) response = client.chat.completions.create( model="ibm-granite/granite-4.2-8b", messages=[{"role": "user", "content": "Hello!"}] ) print(response.choices[0].message.content)
```

cURL

```
curl https://api.hanzo.ai/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $HANZO_API_KEY" \ -d &#x27;{ "model": "ibm-granite/granite-4.2-8b", "messages": [{"role": "user", "content": "Hello!"}] }&#x27;
```

Go

```
package main import ( "context" "fmt" "os" "github.com/sashabaranov/go-openai" ) func main() { cfg := openai.DefaultConfig(os.Getenv("HANZO_API_KEY")) cfg.BaseURL = "https://api.hanzo.ai/v1" client := openai.NewClientWithConfig(cfg) resp, _ := client.CreateChatCompletion(context.Background(), openai.ChatCompletionRequest{ Model: "ibm-granite/granite-4.2-8b", Messages: []openai.ChatCompletionMessage{ {Role: openai.ChatMessageRoleUser, Content: "Hello!"}, }, }, ) fmt.Println(resp.Choices[0].Message.Content) }
```

## More from IBM Granite

[IBM: Granite 4.0 Micro131KGranite-4.0-H-Micro is a 3B parameter from the Granite 4 family of models. These models are the latest in a series of models released by IBM. They are fine-tuned for long...](https://hanzo.ai/models/ibm-granite/granite-4.0-h-micro)[IBM: Granite 4.1 8B131KGranite 4.1 8B is a dense, decoder-only 8-billion-parameter language model from IBM, part of the Granite 4.1 family. It supports a 131K-token context window and is designed for enterprise tasks...](https://hanzo.ai/models/ibm-granite/granite-4.1-8b)

[View all IBM Granite models →](https://hanzo.ai/models/ibm-granite)

## Use IBM: Granite 4.2 8B via Hanzo AI

One API key. Every major model. OpenAI-compatible. Start free.

[Get Free API Key](https://hanzo.ai/signup)[Browse All Models](https://hanzo.ai/models)
