LLM Reference
Microsoft Foundry

Using Phi-2 on Microsoft Foundry

Implementation guide · Phi-2 · Microsoft Research

ProvisionedOpen Source

Microsoft Foundry exposes Phi-2 through model ID phi-2. Use the setup steps, sourced pricing, capabilities, and official provider links below to validate this route before deployment.

Last refreshed 2026-05-19. Next refresh: weekly.

Quick Start

  1. 1
    Create an account at Microsoft Foundry and generate an API key.
  2. 2
    Use the Microsoft Foundry SDK or REST API to call phi-2 — see the documentation for request format.
  3. 3
    You'll be billed $0.07/1M input, $0.07/1M output tokens. See full pricing.

Code Examples

See Microsoft Foundry documentation for integration details.

Pricing on Microsoft Foundry

TypePrice (per 1M)
Input tokens$0.07
Output tokens$0.07

Capabilities

Structured Outputs

About Phi-2

Phi-2 is a compact language model by Microsoft endowed with 2.7 billion parameters and part of their Phi series. It shows formidable capabilities in reasoning and language understanding, outshining much larger models, even those with up to 25 times more parameters. Phi-2's training utilized a vast and diverse dataset of 1.4 trillion tokens, incorporating high-quality synthetic data and curated web content to bolster its common sense reasoning and general knowledge. Interestingly, despite lacking fine-tuning via reinforcement learning from human feedback (RLHF), it exhibits enhanced safety features and reduced bias.

Model Specs

Released2023-12-12
Parameters2.7B
Context2k
ArchitectureDecoder Only

Provider

Microsoft Foundry
Microsoft Foundry

Microsoft

Redmond, Washington, United States