Skip to main content

Phi 4

Microsoft Research 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

Input / output price
$0.07 / $0.14 per 1M
Context
16K tokens
Released
Dec 12, 2024
Agent setup

Paste into Claude Code, Cursor, or Codex

Help me set up the Respan gateway: fetch and follow https://www.respan.ai/docs/agent-setup.md. Use model "phi-4".

Read docs

Providers

2 providers, cheapest first, OpenRouter last, priced per 1M tokens after gateway discounts.

ProviderInputOutput
DeepInfradeepinfra/phi-4
$0.07/M$0.14/M
OpenRouteropenrouter/phi-4
$0.07/M$0.14/M

Is a provider down? OpenRouter status

Pricing

Averaged across 2 providers, in USD per 1M tokens after gateway discounts.

Average input
$0.07 per 1M
Average output
$0.14 per 1M

Cost by volume

Total cost from 0 to 1T tokens.

$0.07/MDeepInfra and OpenRouter

Throughput and latency

30-day averages from requests through the Respan gateway. Under each figure, every model on the gateway by its average, this one in blue.

Output speed

Higher is better

12tokens/sacross providers

Faster than 36% of the other 588 models on the gateway

Response latency

Lower is better

0.3sacross providers

Faster than 91% of the other 747 models on the gateway

Benchmarks

The Respan Index plus 14 published scores from 4 sources, each linked to where it was published.

9.2/ 100

Respan Index#173 of 175

175 ranked models. The shaded band is this model's 95% interval, 7.9 to 11.6. Qwen2.5 72B Instruct falls inside it, so the gap is within the margin of error.
Phi 4 by category: Coding 0.6 (estimated), Agents 1.0, Reasoning 17.2, Knowledge & language 4.8, Human preference 27.1
  1. 173Phi-49.2
  2. 172Qwen2.5 72B Instruct10.0
  3. 174Llama 3.1 8B Instruct7.2

Published scores

BenchmarkScore
HumanEval+microsoft.com82.8%
HumanEvalmicrosoft.com82.6%

Compare Phi 4: Phi-4 vs GPT-6 Astra, Phi-4 vs Gemini 4 Argon

Apps

Use Phi 4 in the tools you already run. Each guide points the app at the Respan gateway.

Setup guides for more apps are in the integration docs.

Phi 4 FAQ

Short answers, built from the data on this page.

Phi 4 is a model from Microsoft, released on Dec 12, 2024. Microsoft Research 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.

On the Respan gateway, Phi 4 costs $0.07 per 1M input tokens and $0.14 per 1M output tokens on every provider, after gateway discounts.

Phi 4 is available through 2 providers: DeepInfra and OpenRouter.

Phi 4 accepts up to 16K tokens of context on its largest provider route.

Point any OpenAI-compatible SDK at https://gateway.respan.ai/v1 with your Respan API key and set the model to "phi-4". To set it up with a coding agent, copy the agent setup prompt at the top of this page.

Phi 4 scores 9.2 out of 100 on the Respan Index v1.1, ranking #173 of 175 models. By category: Coding 0.6 (estimated), Agents 1.0, Reasoning 17.2, Knowledge & language 4.8, and Human preference 27.1. The Respan Index combines independent and lab-reported benchmark results into one score, using benchmark data collected by Respan.

Phi 4 has 14 published benchmark scores, including HumanEval+ 82.8%, BALROG 11.6%, and GPQA Diamond 56.1%. Each score links to where it was published; the data is collected by Respan.

Certified where it counts.

Built to meet the security and privacy standards that enterprise and healthcare teams require.

ISO 27001

The internationally recognized standard for information security management.

SOC 2

Secure, compliant management of your data across all of our systems.

GDPR

Operated under GDPR, the world's strictest standard for data privacy.

HIPAA

HIPAA compliant, with a BAA available for healthcare teams.

Works with your entire stack

Use Respan with your favorite frameworks and tools.

AnthropicAI21 LabsxAIVercel AI SDK
LangChainOpenRouterAssemblyAICursor
LiteLLMGroqBasetenMem0
CohereCogneeLlamaIndexFireworks
DeepSeekLinkupHaystackTogether AI
PerplexityInference.netPostHogRubyLLM
SlackMastraAzure OpenAIMistral
AWS BedrockMoonshotHyperspellBAML
ModaInstructorGoogle GeminiParasail
ReductoZapierAgnoNebius
OpenAINovita AIReplicateSuperagent

Built for AI agents.
Break less.
Ship more.