Skip to content
DeepInfra

Microsoft/Phi 4

Microsoft/Phi 4 is available via DeepInfra with a 16K context window and up to 16,384 output tokens. Pricing: $0.0700/1M input tokens, $0.1400/1M output tokens.

Microsoft/Phi 4 Pricing & Specifications

Input Price$0.070 per 1M tokens
Output Price$0.14 per 1M tokens
Context Window16,384 tokens (16K)
Max Output16,384 tokens
ProviderDeepInfra

What is Microsoft/Phi 4?

Microsoft/Phi 4 is a large language model by DeepInfra with a 16K context window and up to 16,384 output tokens. It costs $0.070 per 1M input tokens and $0.14 per 1M output tokens. Microsoft/Phi 4 is available via DeepInfra with a 16K context window and up to 16,384 output tokens. Pricing: $0.0700/1M input tokens, $0.1400/1M output tokens.

Capabilities

text function calling

Microsoft/Phi 4 Cost Examples

Short prompt (500 tokens)

$0.000035

Medium prompt (2K tokens)

$0.00014

Long output (4K tokens)

$0.00056

Count tokens for Microsoft/Phi 4

Paste your prompt to see exact token counts and API cost estimates.

Open Token Counter

Similar Models to Microsoft/Phi 4

DeepInfra

Mistralai/Mistral Small 3.2 24B Instruct 2506

$0.075/1M in 128K ctx

DeepInfra

Gryphe/MythoMax L2 13b

$0.080/1M in 4K ctx

DeepInfra

Qwen/Qwen3 30B A3B

$0.080/1M in 41K ctx

DeepInfra

Meta Llama/Llama 4 Scout 17B 16E Instruct

$0.080/1M in 328K ctx

Frequently Asked Questions

How much does Microsoft/Phi 4 cost per token? +
Microsoft/Phi 4 costs $0.070 per 1M input tokens and $0.14 per 1M output tokens. For a typical 1,000-token request with a 500-token response, that works out to roughly $0.000140.
What is the context window for Microsoft/Phi 4? +
Microsoft/Phi 4 supports a context window of 16,384 tokens (16K). This determines the maximum combined length of your prompt and conversation history in a single API call.
What is the maximum output length for Microsoft/Phi 4? +
Microsoft/Phi 4 can generate up to 16,384 tokens in a single response. If you need longer outputs, you can make multiple API calls and concatenate the results.
Is Microsoft/Phi 4 good for coding tasks? +
Yes, Microsoft/Phi 4 supports capabilities well-suited for coding tasks including code generation, debugging, and refactoring.
Token Counter | Pricing Calculator | Model Comparison | All DeepInfra Models