Moduck

Microsoft: Phi-4-mini

Compact Microsoft instruction model tuned for efficient coding assistance, reasoning, and low-latency agent tasks

Model lab
Microsoft
Model family
phi

Model resources

Modalitiestext → text
Context window128,000
Maximum output4,096
InputUSD 0.06 / 1M tokens
OutputUSD 0.24 / 1M tokens

Quickstart

Use your Moduck API Key, set the API base URL to https://api.moduck.ai/v1, and set the model parameter to microsoft/phi-4-mini.

import os
import requests

base_url = "https://api.moduck.ai/v1"
api_key = os.environ["MODUCK_API_KEY"]
model_id = "microsoft/phi-4-mini"

response = requests.post(
    f"{base_url}/chat/completions",
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    json={
        "model": model_id,
        "messages": [{"role": "user", "content": "Hello!"}],
        "stream": False,
    },
    timeout=60,
)
response.raise_for_status()
print(response.json())

Use the familiar OpenAI-style chat request format to make model integration easier.

Phi-4-mini API Pricing

TypePrice information
InputUSD 0.06 / 1M tokens
OutputUSD 0.24 / 1M tokens

Benchmarks

BenchmarkScoreMeasurementSource
MMLU67.3accuracy

Performance

Performance trends

Throughput90.8 tok/sCurrent
Time to first token1.3 sCurrent
End-to-end latency6.9 sCurrent
Throughput
Current90.8 tok/s
Window average89.4 tok/s
Time to first token
Current1.3 s
Window average1.5 s
End-to-end latency
Current6.9 s
Window average7.5 s
Tail latency (P99)
Current14.6 s
Window average16.6 s
Prompt cache hit rate
Current19.1%
Window average23.0%
Error rate
Current0.0%
Window average0.1%

Availability

Uptime100%At least one provider responded
Availability100%Requests actually served
Error rate0%Share of failed requests
Served requests, hour by hour
24 hours agoNow

Phi-4-mini Compare models

ModelInput priceOutput priceContext windowCapabilities
Phi-4-miniThis pageUSD 0.06 / 1M tokensUSD 0.24 / 1M tokens128,000Text output · Tool calling
MAI-Code-1-FlashUSD 0.6 / 1M tokensUSD 3.6 / 1M tokens256,000Text output · Reasoning · Tool calling
WizardLM 2 8x22BUSD 0.384 / 1M tokensUSD 0.384 / 1M tokens65,536Text output
Beam 1.0 501B A23BUSD 0.2 / 1M tokensUSD 0.8 / 1M tokens1,048,576Text output · Reasoning · Tool calling
Ling 3.1 FlashUSD 0.06 / 1M tokensUSD 0.176 / 1M tokens262,144Text output · Reasoning · Tool calling

Model specifications

Input
text
Output
text
Context window
128,000
Maximum output
4,096
Release date
2024-12-11
Attachments
No
Reasoning
No
Tool calling
Yes
Temperature setting
Yes
Open weights
Yes

Frequently asked questions

What is Phi-4-mini for?

Compact Microsoft instruction model tuned for efficient coding assistance, reasoning, and low-latency agent tasks

What inputs and outputs does Phi-4-mini support?

Recorded inputs: text; outputs: text.

How is Phi-4-mini priced?

The pricing table shows the current recorded Moduck price. For example: Input USD 0.06 / 1M tokens; Output USD 0.24 / 1M tokens. See the pricing table for all units, variants, and conditions.

What specifications are recorded for Phi-4-mini?

Current model records list Context window 128,000 tokens; Maximum output 4,096 tokens.

What model parameter does the Quickstart use?

The example uses microsoft/phi-4-mini. This value comes from the page identifier and is not confirmed as a callable Moduck public ID.

Can I call this model through the Moduck API now?

This page has no verified Moduck API call for this model. A Quickstart example or reserved ID does not establish access; check the models available to your account.