Microsoft Phi API
Access Microsoft Phi instantly with Puter.js, and add AI to any app in a few lines of code without backend or API keys.
// npm install @heyputer/puter.js
import { puter } from '@heyputer/puter.js';
puter.ai.chat("Explain AI like I'm five!", {
model: "microsoft/phi-4"
}).then(response => {
console.log(response);
});
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
puter.ai.chat("Explain AI like I'm five!", {
model: "microsoft/phi-4"
}).then(response => {
console.log(response);
});
</script>
</body>
</html>
List of Microsoft Phi Models
Phi 4 Mini
microsoft/phi-4-mini-instruct
Phi-4 Mini is a 3.8-billion-parameter small language model developed by Microsoft, designed to deliver strong reasoning performance in a compact form factor. It uses a dense decoder-only Transformer architecture with grouped-query attention and supports context lengths up to 128K tokens. The model excels at math, logic, coding, instruction following, and function calling — making it well-suited for agentic workflows that integrate external tools and APIs. It supports over 20 languages thanks to its expanded 200K-token vocabulary. Despite its small size, Phi-4 Mini performs competitively with much larger models on text-based reasoning tasks. It scored 88.6% on GSM8K and 83.7% on ARC-Challenge. It's a strong choice for developers who need capable reasoning at low latency and minimal compute cost.
ChatPhi 4
microsoft/phi-4
Phi-4 is a 14B parameter small language model from Microsoft that excels at complex reasoning tasks, especially mathematics, outperforming many larger models on math competition benchmarks while being efficient enough for edge deployment.
ChatWizardLM-2 8x22B
microsoft/wizardlm-2-8x22b
WizardLM-2 8x22B is Microsoft AI's most advanced Wizard model, a Mixture of Experts LLM fine-tuned from Mixtral 8x22B that delivers near-GPT-4 performance on complex chat, multilingual, reasoning, and coding tasks while remaining open-source.
Frequently Asked Questions
The Microsoft Phi API gives you access to models for AI chat. Through Puter.js, you can start using Microsoft Phi models instantly with zero setup or configuration.
Puter.js supports a variety of Microsoft Phi models, including Phi 4 Mini, Phi 4, and WizardLM-2 8x22B. Find all AI models supported by Puter.js in the AI model list.
With the User-Pays model, users cover their own AI costs through their Puter account. This means you can build apps without worrying about infrastructure expenses.
Puter.js is a JavaScript library that provides access to AI, storage, and other cloud services directly from a single API. It handles authentication, infrastructure, and scaling so you can focus on building your app.
Yes — the Microsoft Phi API through Puter.js works with any JavaScript framework, Node.js, or plain HTML. Just include the library and start building. See the documentation for more details.