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

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.