Microsoft

Phi-4-reasoning API pricing and integration

Integrate Phi-4-reasoning using the published protocols below. Review context limits and billing units before choosing request parameters.

Model ID: Phi-4-reasoning · Catalog updated: 2026-11-04

Published base prices

Input
$0.07
/ M tokens
Output
$0.35
/ M tokens
USD / 1M tokens
-

Account discounts and final billing are shown in your dashboard.

Model parameters and protocols

Context window
32,768 tokens
Maximum output
32,768 tokens
Billing type
token_based
Published protocols
/v1/chat/completions · /v1/responses

Parameters and tool support

A listed protocol does not imply support for every parameter or hosted tool. Image input, reasoning options, structured output, and tool execution depend on the model and route. Validate your workload with a small request and preserve session context for tool continuations.

Tools and sessions guide

Integration examples

Complete examples

Generated from the model’s public capabilities and updated with every selection.

Supported protocols only
Protocol
Language
pip install openai
Chat CompletionsPythonDefault providerSSE
Chat Completions · Python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["GR_API_KEY"],
    base_url="https://endpoint.greatrouter.com"
)

response = client.chat.completions.create(
    model="Phi-4-reasoning",
    messages=[{"role": "user", "content": "Hello"}],
    stream=True,
)
for chunk in response:
    text = chunk.choices[0].delta.content
    if text:
        print(text, end="", flush=True)