Granite 4.2 8B API

ibm-granite/granite-4.2-8b
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.
Context
128K tokens
Input
$0.13754 / 1M tokens
Output
$0.34385 / 1M tokens
Released
Aug 31, 2026

Overview

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

  • Parameters: 8B, dense
  • Supported inputs: Text
  • Output: Text
  • Context window: 131,072 tokens
  • Max output: 117,964 tokens
  • Tool calling and structured outputs
  • Licence: Apache 2.0

API Pricing

  • Input: $0.13754 / 1M tokens
  • Cached input: $0.06877 / 1M tokens
  • Output: $0.34385 / 1M tokens

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.

Uptime and performance

  • Uptime (24h): 100%
  • Uptime (7d): 100%
  • Availability (24h): 100%
  • Error rate (24h): 0%

Measured on the AI/ML API gateway across live traffic. Figures are medians unless stated. Last updated 2026-10-12.

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.

How to use Granite 4.2 8B API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to ibm-granite/granite-4.2-8b.
import requests

r = requests.post(
    "https://api.aimlapi.com/v1/chat/completions",
    headers={"Authorization": "Bearer " + AIMLAPI_KEY},
    json={
      "model": "ibm-granite/granite-4.2-8b",
      "messages": [
        {
          "role": "user",
          "content": "Hello!"
        }
      ]
    },
)
print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "ibm-granite/granite-4.2-8b",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }),
});
console.log(await r.json());
curl -X POST 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":"Hello!"}]}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

Granite 4.2 8B API Pricing

TypePrice
Input
$0.13754 / 1M tokens
Output
$0.34385 / 1M tokens
Cached input
$0.06877 / 1M tokens

Granite 4.2 8B Benchmarks

BenchmarkScoreWhat it measuresSourceRetrieved
Intelligence
11.8
Composite score across standardised reasoning, knowledge and problem-solving evaluations, measured independently by Artificial AnalysisSourceSeptember 12, 2026
Coding
22.4
Composite score across standardised coding evaluations, measured independently by Artificial AnalysisSourceSeptember 12, 2026
SWE-bench Verified
47.67
Resolving verified real GitHub issuesSourceSeptember 21, 2026
AIME 2025
86.67
Competition mathematics (AIME), 2025SourceSeptember 21, 2026
GPQA Diamond
64.14
Google-proof graduate science questions (hardest subset)SourceSeptember 21, 2026
LiveCodeBench
73.24
Contamination-free competitive programming problemsSourceSeptember 21, 2026
MMLU-Pro
74.04
Multi-discipline knowledge + reasoning (harder MMLU)SourceSeptember 21, 2026

Granite 4.2 8B vs other models

ModelInputOutputContextBest for
$0.13754 / 1M tokens
$0.34385 / 1M tokens
128K tokens
Open-licence reasoning at low cost
$0.06877 / 1M tokens
$0.13754 / 1M tokens
131K tokens
Reasoning + agents
$6.5 / 1M tokens
$39 / 1M tokens
1M tokens
Reasoning + agents
$2.6 / 1M tokens
$13 / 1M tokens
1M tokens
Balanced coding + agents
$1.95 / 1M tokens
$11.7 / 1M tokens
1M tokens
Reasoning + agents

Frequently asked questions

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.

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

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.

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

Yes, the model supports function calling.

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

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

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

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

Start building with Granite 4.2 8B

Get API Key
1000+ models, one API.