Granite 4.2 8B API

IBM's dense 8B reasoning model with configurable reasoning effort and Apache 2.0 licensing.

Modalities
TextText
In / Out price
$0.1058/$0.2645per 1M
Context window
128K tokens
Released
Aug 31, 2026

Granite 4.2 8B overview

The pelican test: one prompt, every text model, unedited SVG output from Nov 3, 2026.

SVG of a pelican riding a bicycle, written by Granite 4.2 8B through AI/ML API

Granite 4.2 8B by IBM

Granite 4.2 8B is IBM's dense reasoning model, fine-tuned from Granite 4.1 8B, with configurable reasoning effort, tool calling and structured outputs over a 131K-token context.

Granite 4.2 8B specs

Model ID
ibm-granite/granite-4.2-8b
Developer
IBM
Context window
131,072 tokens
Max output
117,964 tokens
Input
Text
Output
Text
API
OpenAI-compatible, base URL https://api.aimlapi.com/v1

What Is Granite 4.2 8B?

Granite 4.2 8B is IBM's dense reasoning model, fine-tuned from Granite 4.1 8B for mathematics, code generation, multilingual dialogue and agentic workflows that need multi-step reasoning.

Reasoning is on by default and its effort is configurable, high, low or none, so the same endpoint serves both quick lookups and deliberate multi-step work.

Technical Specifications

  • Context window: 131,072 tokens
  • Tool calling and structured outputs

Where Granite 4.2 8B Fits

Agentic workflows
Tool calling and structured outputs suit agent loops that plan, call tools and iterate.

Cost-sensitive reasoning
Turning reasoning effort down keeps routine calls cheap, while high effort stays available when the task needs it.

Available on AI/ML API since August 31, 2026.

Use cases

Granite 4.2 8B is documented as suitable for reasoning-intensive enterprise applications, with IBM describing it as a balanced reasoning model for general-purpose enterprise use. It is also suited to complex math and multi-step logic tasks.

The model is documented for coding-related work, including code generation and software engineering workflows. IBM also says Granite 4.2 can support terminal-based coding and other multi-step development tasks in agentic settings.

It is documented for tool-calling and agentic workflows, including evaluating which applications to use and in what order, and integrating with agent frameworks. The model is also described as useful for search-driven workflows and web-search-based agent behavior.

It is documented for multilingual dialogue tasks and multilingual use cases. The model is also listed as suitable for structured output or structured data extraction in provider documentation.

Capabilities

  • Reasoning
  • Streaming
  • Structured outputs
  • Function calling

Granite 4.2 8B benchmarks by Artificial Analysis

See how Granite 4.2 8B compares in intelligence, generation speed, cost per task and latency. Data retrieved Nov 3, 2026.

Intelligence

Index v5.0

Speed

Output tokens / second

Cost per task

USD / benchmark task

Benchmark results

Compare 18 models available on AI/ML API across 5 independent benchmarks.

Humanity's Last Exam

Expert-written questions across academic subjects.

Granite 4.2 8B API pricing

Granite 4.2 8B pricing in US dollars
UsagePriceUnit
Input$0.10581M tokens
Output$0.26451M tokens
Cached input$0.05291M tokens

Prices from the AI/ML API price list, checked on Nov 4, 2026.

Granite 4.2 8B vs other models: token prices

AI/ML API input and output rates for 5 models, per million tokens.

AI/ML API model prices in USD per million tokens
ModelInputOutput
Granite 4.2 8B$0.1058$0.2645
Schematron V2 Small$0.0529$0.2433
Nova Lite 1.0$0.0635$0.2539
Llama Guard 2 (8B)$0.26$0.26
Mistral (7B) Instruct v0.2$0.26$0.26

How to use the Granite 4.2 8B API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "ibm-granite/granite-4.2-8b",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'

Related articles

All posts

Granite 4.2 8B FAQ

What is Granite 4.2 8B?

Granite 4.2 8B is an 8-billion-parameter dense reasoning model from IBM, fine-tuned from Granite 4.1 8B for mathematics, code generation, multilingual dialogue and agentic workflows.

What licence is Granite 4.2 8B released under?

Apache 2.0, which permits unrestricted commercial use. IBM also publishes cryptographic signatures for the weights and holds ISO certification for the development process.

How do you control how much Granite 4.2 8B reasons?

Reasoning is on by default and its effort is configurable: high, low or none. That lets you keep routine calls short and reserve deliberate reasoning for the requests that need it.

Does Granite 4.2 8B produce chain-of-thought reasoning?

Yes. Reasoning is emitted natively inside think tags, which IBM reports improves results on math, coding and multi-step problems.

Does Granite 4.2 8B support tool calling?

Yes, the model supports function calling.

What architecture does Granite 4.2 8B use?

A dense, decoder-only transformer built on 40 layers, using Grouped Query Attention and Rotary Position Embeddings.

Is Granite 4.2 8B multimodal?

No. Granite 4.2 8B takes text and returns text.

Can Granite 4.2 8B be self-hosted?

Yes. The Apache 2.0 licence and published weights allow local or on-premise deployment, and the 8B size keeps hardware requirements modest.

How do I call Granite 4.2 8B on AI/ML API?

Send a request to the chat completions endpoint with the model id ibm-granite/granite-4.2-8b.

What is the Granite 4.2 8B model ID?

Use ibm-granite/granite-4.2-8b as the model parameter. Requests go to the OpenAI-compatible endpoint with your AI/ML API key.

Start building with Granite 4.2 8B

Granite 4.2 8B API

ibm-granite/granite-4.2-8b

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "ibm-granite/granite-4.2-8b",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'