Phi 4

Microsoft chattool_use

API ID: microsoft/phi-4

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

About Phi 4

Phi-4 is Microsoft's latest small language model, pushing the boundaries of what's achievable with efficient architectures. Building on the Phi series' success, Phi-4 introduces significant improvements in reasoning, coding, and general capability while maintaining a practical parameter count. The model demonstrates state-of-the-art performance for its size class, often matching or exceeding much larger models on key benchmarks. Phi-4 features an extended context window and excels at mathematical reasoning, code generation, and complex analysis. Its efficient design enables deployment on consumer hardware and cost-effective cloud instances. The model represents Microsoft's continued research into efficient AI, showing that careful training can substitute for raw scale. For developers seeking cutting-edge capability with minimal resources, Phi-4 offers the latest advances in efficient model design. It's particularly valuable for local deployment, edge computing, and applications requiring strong capability without massive compute.

๐Ÿ’ฐ
Price Ranking
#614 lowest price among 950 Chat models

Model Specifications

Context Length
16k
Max Output
16k
Release Date
2025-01-10
Capabilities
chat tool_use
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 tool_use
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

NVIDIA Nemotron Nano 9B V2
Input: $0.04
Output: $0.16
Context: 131k
Zhipu AI GLM 4 32B
Input: $0.10
Output: $0.10
Context: 33k
Mistral Pixtral 12B
Input: $0.10
Output: $0.10
Context: 4k
Mistral Ministral 3 3B 2512
Input: $0.10
Output: $0.10
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)