# 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.

**ID**: `microsoft/phi-4`  
**Creator**: microsoft  
**Category**: text  
**Context**: 16K tokens  
**Pricing**: $0.08 / $0.16 per 1M · billed by your provider (BYOK)  
**Released**: 2025-01-10  
**Web page**: https://anyrouter.dev/model/microsoft/phi-4

**Input modalities**: text  
**Output modalities**: text  

**Capabilities**: chat, streaming

## Usage

**Endpoint**: `POST https://anyrouter.dev/api/v1/chat/completions`

```bash
curl https://anyrouter.dev/api/v1/chat/completions \
  -H "Authorization: Bearer $ANYROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "microsoft/phi-4",
  "messages": [
    {
      "role": "user",
      "content": "Say hi in 3 words."
    }
  ]
}'
```

## Providers

| Provider | Input | Output |
| --- | --- | --- |
| fluence-byok | $0.08/M (list) | $0.16/M (list) |
| huggingface-byok | $0.08/M (list) | $0.16/M (list) |

BYOK routes are billed by your own provider key — AnyRouter charges $0. Rates marked (list) are the provider's published list price.

## Source

- Upstream docs: https://openrouter.ai/microsoft/phi-4
