Phi 4

API ID: microsoft/phi-4

Input Price
$0.06
/1M tokens
Output Price
$0.14
/1M tokens

About Phi 4

[Microsoft Research](/microsoft) Phi-4 is designed to perform well in complex reasoning tasks and can operate efficiently in situations with limited memory or where quick responses are needed. At 14 billion parameters, it was trained on a mix of high-quality synthetic datasets, data from curated websites, and academic materials. It has undergone careful improvement to follow instructions accurately and maintain strong safety standards. It works best with English language inputs. For more information, please see [Phi-4 Technical Report](https://arxiv.org/pdf/2412.08905)

๐Ÿ’ฐ
Price Ranking
#641 lowest price among 1240 Chat models

Model Specifications

Context Length
16k
Max Output
16k
Release Date
2025-01-10
Capabilities
chat
Input Modalities
text
Output Modalities
text

Best For

  • Conversations, content writing, general assistance

Consider Alternatives For

  • Image understanding (needs vision capability)

๐Ÿ’ฐ Real-World Cost Examples

Estimated monthly costs for common use cases

Personal AI Assistant
$0.07
/month
50 conversations/day, ~500 tokens each
Customer Service Bot
$2.16
/month
1000 tickets/day, ~800 tokens each

Microsoft Model Lineup

Compare all models from Microsoft to find the best fit

Model Input Output Context Capabilities
Phi 4 Current Free Free 16k chat
Phi-3 Medium 4K Instruct Free Free 4k chat
Phi-3 Medium 4K Instruct Free Free 4k chat
WizardLM-2 7B Free Free 32k chat
WizardLM-2 7B Free Free 32k chat
Phi 4 Multimodal Instruct Free Free 131k chat vision

Similar Models from Other Providers

Cross-brand alternatives with similar capabilities

Mistral Ministral 3 3B 2512
Input: $0.10
Output: $0.10
Context: 131k
Google Gemma 3 12B
Input: $0.05
Output: $0.15
Context: 131k
Rekaai Reka Edge
Input: $0.10
Output: $0.10
Context: 16k
NVIDIA Nemotron Nano 9B V2
Input: $0.04
Output: $0.16
Context: 131k

๐Ÿš€ Quick Start

Get started with Phi 4 API

OpenAI-compatible SDK
from openai import OpenAI

client = OpenAI(
    base_url="https://api.provider.com/v1",
    api_key="YOUR_API_KEY"
)

response = client.chat.completions.create(
    model="microsoft/phi-4",
    messages=[
        {"role": "user", "content": "Hello!"}
    ]
)
print(response.choices[0].message.content)