Get started
Microsoft Azure
Microsoft Azure

Phi 4

Phi 4 is a large language model by Microsoft Azure with support for function calling. It supports a 16K token context window with up to 16K tokens of output. Priced at $0.07 per million input tokens and $0.14 per million output tokens, it is one of the most cost-efficient options in its class. Access Phi 4 through Inworld Router with OpenAI SDK compatibility, built-in failover, and intelligent routing across providers.
Function Calling

Step 1 — Create Router

curl --location 'https://api.inworld.ai/router/v1/routers' \ --header 'Authorization: Basic <your-api-key>' \ --header 'Content-Type: application/json' \ --data '{ "name": "compare-frontier-models", "defaultRoute": { "route_id": "default", "variants": [ { "variant": { "variant_id": "deepinfra/phi-4-a", "model_id": "deepinfra/phi-4" }, "weight": 33 }, { "variant": { "variant_id": "deepinfra/phi-4-b", "model_id": "deepinfra/phi-4" }, "weight": 33 }, { "variant": { "variant_id": "deepinfra/phi-4-c", "model_id": "deepinfra/phi-4" }, "weight": 34 } ] } }'

Step 2 — Chat Completion

curl --location 'https://api.inworld.ai/v1/chat/completions' \ --header 'Authorization: Basic <your-api-key>' \ --header 'Content-Type: application/json' \ --data '{ "model": "inworld/compare-frontier-models", "messages": [{"role": "user", "content": "Hello!"}] }'

Phi 4 pricing and providers

Access Phi 4 through DeepInfra via Inworld Router or Realtime API. By using the AI provider(s) below you acknowledge you reviewed and agree to their terms listed in the Legal section under the AI provider's name.
CapabilitiesInput modalitiesOutput modalities
DeepInfraDeepInfra16.4K16.4K$0.07$0.14

Start building with Phi 4

Access Phi 4 and every other model through Inworld Router or Realtime API. Create your free account and start routing in minutes.
Copyright © 2021-2026 Inworld AI
Phi 4 by Microsoft Azure — Pricing, Specs & API Access | Inworld