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.
| Type | Price |
|---|---|
| Input | |
| Output | |
| Cached input |
| Benchmark | Score | What it measures | Source | Retrieved |
|---|---|---|---|---|
| Intelligence | 11.8 | Composite score across standardised reasoning, knowledge and problem-solving evaluations, measured independently by Artificial Analysis | Source | September 12, 2026 |
| Coding | 22.4 | Composite score across standardised coding evaluations, measured independently by Artificial Analysis | Source | September 12, 2026 |
| SWE-bench Verified | 47.67 | Resolving verified real GitHub issues | Source | September 21, 2026 |
| AIME 2025 | 86.67 | Competition mathematics (AIME), 2025 | Source | September 21, 2026 |
| GPQA Diamond | 64.14 | Google-proof graduate science questions (hardest subset) | Source | September 21, 2026 |
| LiveCodeBench | 73.24 | Contamination-free competitive programming problems | Source | September 21, 2026 |
| MMLU-Pro | 74.04 | Multi-discipline knowledge + reasoning (harder MMLU) | Source | September 21, 2026 |
| Model | Input | Output | Context | Best for |
|---|---|---|---|---|
Granite 4.2 8B This page | Open-licence reasoning at low cost | |||
| Reasoning + agents | ||||
| Reasoning + agents | ||||
| Balanced coding + agents | ||||
| Reasoning + agents |
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.