Loading template…
⚡ Run with API

Phi-4 from Microsoft Research is a 14B-parameter model designed for complex reasoning that runs efficiently where memory is limited or quick responses are needed.

Pricing: Input 14 credits / 1M tokens (≈ $0.07), Output 28 credits / 1M tokens (≈ $0.14).

Prices updated

Conversation
✦

How can I help you today?

This demo page does not include the full memory features of the client. For the complete experience, please use the client or the CLI.

≡
README
Complete guide to using Phi 4

Phi 4 API on ModelFold

Phi-4 from Microsoft Research is a 14B-parameter model designed for complex reasoning that runs efficiently where memory is limited or quick responses are needed. Try Phi 4 in the ModelFold Playground, then call it from your own code through an OpenAI-compatible chat completions API.

What Is the Phi 4 API

Phi 4 at a glance

Phi 4 is a chat model from Microsoft. It accepts text as input and returns text, with a context window of up to 16K tokens.

Use it without hosting anything

On ModelFold you call Phi 4 with a single API key — no model weights to download and no inference servers to run. The same key also works for the other chat, image, video and audio models on ModelFold.

Core Capabilities of Phi 4

Up to 16K tokens of context

Keep long conversations, large documents and sizeable code in a single request, so the model can reason over the full material instead of fragments.

Structured outputs

Ask for JSON that follows a schema (response_format), which makes extraction, classification and system integrations more reliable.

How to Use Phi 4 on ModelFold

  1. 1

    Step 1: Try it in the Playground

    Open the Playground at the top of this page, type a prompt and see how Phi 4 responds before writing any code.

  2. 2

    Step 2: Create an API key

    Sign in to ModelFold and create an API key in the console. Keep it secret and send it as a Bearer token.

  3. 3

    Step 3: Send a request

    Call POST https://modelfold.ai/v1/chat/completions with "model": "phi-4" and your messages. Existing OpenAI-compatible SDKs work by changing the base URL and key.

  4. ✓

    Step 4: Ship and monitor

    Integrate the response into your product and check token usage and spend for every call in the console logs.

What You Can Build with Phi 4

Analysis and complex reasoning

Work through research questions, data interpretation, planning and other problems that need careful step-by-step reasoning.

High-volume pipelines

Run classification, extraction, rewriting and batch jobs at scale where cost per request matters.

Low-latency experiences

Power chat interfaces, autocomplete and interactive tools where users expect fast responses.

AI coding assistants

Generate, explain, debug and refactor code, review pull requests and work through multi-file changes in developer tools and IDE plugins.

Frequently Asked Questions

What is Phi 4?⌄

Phi-4 from Microsoft Research is a 14B-parameter model designed for complex reasoning that runs efficiently where memory is limited or quick responses are needed.

Which inputs does Phi 4 support?⌄

Phi 4 accepts text and returns text. Through ModelFold you send text messages; documents attached in the Playground are converted to text.

How long is the context window of Phi 4?⌄

Up to 16K tokens, shared between your input and the model’s output.

Does Phi 4 support function calling?⌄

Function calling is not listed for Phi 4; requests that include tools will be rejected. Use plain prompts or JSON output instead.

How is Phi 4 billed on ModelFold?⌄

Pay as you go by tokens: input and output tokens are charged at the per-million-token prices shown on this page. There is no monthly fee, and failed requests are not charged.

How do I call Phi 4 through the API?⌄

Send a POST request to https://modelfold.ai/v1/chat/completions with "model": "phi-4", using your ModelFold API key as the Bearer token.

Rate card
Input14 credits 1M tokens≈ $0.07
Output28 credits 1M tokens≈ $0.14

Billed per token: input and output are priced separately, and thinking tokens count as output. The Playground charges exactly the same way.

Read API docs →AI Agents · Claude Code / Cursor / Trae →
Quick start
POST/v1/chat/completions
curl https://modelfold.ai/v1/chat/completions \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"phi-4","messages":[{"role":"user","content":"Hello"}]}'