Microsoft: Phi 4 Mini

phi-4-mini-instruct

Phi 4 Mini costs $0.221 per million input tokens and $0.884 per million output tokens, supports 8K context, and is available through the OpenAI-compatible API.

Phi 4 Mini . A small multilingual model.

Modalities

Text → Text

Input / output price

$0.221 / $0.884 per 1M

Context

8K · max output 4K

Capabilities

Open weights

Pricing

Billed per token actually used and deducted from your credits.

ItemUSD per 1M tokens
Input$0.221
Output$0.884
Cached input$0.111

Calculator

Drag the sliders to estimate what this model will cost.

Per request
$0.00137
Per day
$0.6851
Per month (30 days)
$20.55

Phi 4 Mini: input $0.221/M · output $0.884/M · cached input $0.1105/M

Request with these settings
curl https://api.geniusrelaygpt.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "phi-4-mini-instruct", "max_tokens": 800,
       "messages": [{"role": "user", "content": "…"}]}'

Code samples

OpenAI-compatible. Set the base URL to https://api.geniusrelaygpt.com/v1 and the model to phi-4-mini-instruct.

curl https://api.geniusrelaygpt.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "phi-4-mini-instruct",
    "stream": true,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Use it in a client: Cursor · Cline · SillyTavern · Codex

Parameters

Common OpenAI parameters can be passed as-is.

temperaturetop_pmax_tokensstreamstoppresence_penaltyfrequency_penaltyseed

FAQ

How is Phi 4 Mini billed?
Input is $0.221 and output is $0.884 per million tokens; cached input is $0.111. The charge for every request is listed in Usage Logs in the console.
How long is the context window?
8K tokens. In a long conversation every turn is billed for the full input, so keep the history under control.
Does it support streaming?
Yes. Add "stream": true to the request to receive server-sent events in the OpenAI format.
Phi 4 Mini API pricing · GeniusRelay